Skip to content

Collect SQL Server view schema metadata - #24928

Open
mobuchowski wants to merge 7 commits into
mobuchowski/schema-collector-count-telemetryfrom
mobuchowski/sqlserver-view-schema-metadata
Open

Collect SQL Server view schema metadata#24928
mobuchowski wants to merge 7 commits into
mobuchowski/schema-collector-count-telemetryfrom
mobuchowski/sqlserver-view-schema-metadata

Conversation

@mobuchowski

@mobuchowski mobuchowski commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a dedicated SQL Server view collector that runs alongside table schema collection and emits a separate sqlserver_views DBM metadata payload. Each schema contains an empty tables array and a populated views array. Views include ID, name, creation and modification dates, nullable definition, and table-compatible column metadata.

Adds an independent max_views configuration option with a default of 1000. The existing sqlserver_databases payload and max_tables limit remain unchanged.

Shared telemetry dependency: #24947

Companion backend change: https://github.com/ddoghq/dd-go/pull/11536

Motivation

DBM schema collection currently discovers only SQL Server tables. UGP needs view definitions and projected column metadata to represent SQL Server views without treating them as physical tables.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 20, 2026

Copy link
Copy Markdown

evalya-impact-summary

evalya impact analysis
Impact analysis: 0 selected, 0 skipped (of 0 test tasks)
Publish tasks:   1 (always emitted)
Diff (11 files):
  datadog_checks_base/changelog.d/24947.fixed
  datadog_checks_base/datadog_checks/base/utils/db/schemas.py
  sqlserver/assets/configuration/spec.yaml
  sqlserver/changelog.d/24928.added
  sqlserver/datadog_checks/sqlserver/config_models/instance.py
  sqlserver/datadog_checks/sqlserver/data/conf.yaml.example
  sqlserver/datadog_checks/sqlserver/metadata.py
  sqlserver/datadog_checks/sqlserver/queries.py
  sqlserver/datadog_checks/sqlserver/views.py
  sqlserver/tests/test_schemas.py
  sqlserver/tests/test_unit.py

Debug a specific task: evalya plan impact --path <path> --task <task>

Learn more about CI impact filtering

@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Pipelines  Tests  Code Coverage

⚠️ Warnings

🚦 3 Pipeline jobs failed

Check PR | run / Check PR changelog

View in Datadog · View in GitHub Actions

Changelog entry has the wrong PR number. Correct by moving the file from 'datadog_checks_base/changelog.d/24947.fixed' to 'datadog_checks_base/changelog.d/24928.fixed'.

PR All | test / j636396f / n8n

View in Datadog · View in GitHub Actions

Error executing Docker command to import workflow: returned non-zero exit status 1.

PR All | test / j8217a3a / TeamCity

View in Datadog · View in GitHub Actions

Error: unable to start CMD API server: unable to listen to address localhost:46525: bind: address already in use

🧪 4 Tests failed in 1 job

PR All | run — ❌ 4 tests failed

View in GitHub Actions

❌ test_e2e_all_projects from test_e2e.py   View in Datadog
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership &amp; permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-check-apikey.sh: executing... 
[cont-init.d] 01-check-apikey.sh: exited 0.
[cont-init.d] 50-ci.sh: executing... 
[cont-init.d] 50-ci.sh: exited 0.
[cont-init.d] 50-ecs-managed.sh: executing... 
...
❌ test_e2e_legacy from test_e2e.py   View in Datadog
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership &amp; permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-check-apikey.sh: executing... 
[cont-init.d] 01-check-apikey.sh: exited 0.
[cont-init.d] 50-ci.sh: executing... 
[cont-init.d] 50-ci.sh: exited 0.
[cont-init.d] 50-ecs-managed.sh: executing... 
...

↳ ❄️ test_all_metadata_metrics_emitted from test_integration.py   View in Datadog

↳ ❄️ test_readiness_check_metric from test_integration.py   View in Datadog

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 96.77%
Overall Coverage: 88.75%

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: dd7c8b6 | Docs | View more details | Give us feedback!

@mobuchowski
mobuchowski marked this pull request as ready for review August 20, 2026 12:28
@mobuchowski
mobuchowski requested review from a team as code owners August 20, 2026 12:28
@mobuchowski
mobuchowski force-pushed the mobuchowski/sqlserver-view-schema-metadata branch from 5f2d779 to 0aee51b Compare August 21, 2026 14:37
@mobuchowski
mobuchowski force-pushed the mobuchowski/sqlserver-view-schema-metadata branch from 063f1be to dd7c8b6 Compare August 21, 2026 17:41
@mobuchowski
mobuchowski changed the base branch from master to mobuchowski/schema-collector-count-telemetry August 21, 2026 17:41
@dd-octo-sts

dd-octo-sts Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

"""
if self._is_2016_or_earlier:
query += """
SELECT schema_views.schema_id, schema_views.schema_name, schema_views.owner_name,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Limit is missing from the legacy query

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants