← Back to Pull requests

Exclude db and internal tags from schema payloads #25691

Closed
unknown closed this pull request without merging on Oct 22, 2026 14:33 UTC
View on GitHub
unknown unknown commented on Oct 19, 2026 17:37 UTC
Author

What does this PR do?

SchemaCollector.base_event now builds schema payload tags from the check's TagManager with get_tags(include_internal=False, include_db=False). The per-database db tag and the internal resource tags (dd.internal.resource:*) are no longer sent on schema payloads. Checks without a tag_manager (SAP HANA) still send check.tags. The schema status metrics keep using check.tags.

Effect per integration:

  • Postgres and ClickHouse: schema tags now match their database_instance payloads.

  • SQL Server: schemas drop internal resource tags. #25692 drops them from its database_instance and settings payloads.

  • MySQL: unchanged, because it overrides the schema tags.
  • Motivation

    DBMON-6988: several payloads write the database_instance row's tags. Schema payloads included db: (and on Postgres, internal resource tags), but the instance metadata did not. As a result, the row's tags flapped between payloads. Internal resource tags are only enriched by metrics intake, so on metadata payloads they are raw strings. This fixes an issue where we're accidentally retaining and attaching an incorrectly scoped db tag that doesn't apply to the scope of the schema events

    Checklist before requesting review

  • I self-reviewed the full diff, and this description matches the final change

  • Tests cover the change, or this description explains why none are needed

  • Automated review comments, including Codex review, were addressed or answered

  • I, the human author, understand this change, can explain it to reviewers, and believe it meets the repository standards
  • [DBMON-6988]: https://datadoghq.atlassian.net/browse/DBMON-6988?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

    Diff: 248 lines (+186 / -62) across 3 files Reviewer: HadhemiDD Review duration: 4135m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.62) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.62 · 248 lines diff across 3 files
    0.62
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.330
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.062
    Real PR Conversation Timeline
    1 comments
    "Review active on #25691"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 62.1% (MEDIUM) · Higher = larger blast radius
    62.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.5% · Safe to merge
    24.5%