← Back to Pull requests

Add collect_histograms_as_distributions option to OpenMetrics V2 #25378

Closed
unknown closed this pull request without merging on Oct 08, 2026 20:24 UTC
View on GitHub
unknown unknown commented on Sep 28, 2026 14:15 UTC
Author

What does this PR do?

Adds an opt-in OpenMetrics V2 option, collect_histograms_as_distributions. It sends histogram buckets as distributions without the upper_bound and lower_bound tags, so each series becomes one distribution instead of one per bucket. The numeric bounds are still sent with each bucket. The option stands alone: it implies histogram_buckets_as_distributions, so new users only need to set this one.

  • Buckets sent this way go through AgentCheck.submit_histogram_bucket(..., multiple_buckets=True), which calls a new aggregator builtin, submit_histogram_bucket_multi. That builtin is added in DataDog/datadog-agent#57029 and routes to the Agent's per-bounds bucket path.

  • If the running Agent does not provide submit_histogram_bucket_multi, or the check runs under process_isolation, the check fails at configuration time with a ConfigurationError, instead of sending broken data.

  • The default is unchanged. With the option off, buckets are submitted exactly as before.

  • The two identical _bucket blocks in the histogram transformer are merged into one helper.

  • AggregatorStub and the discovery probe proxy support the new builtin. assert_histogram_bucket gains a multiple_buckets filter.
  • Motivation

    AI-7188. The upper_bound and lower_bound tags create one context per bucket, which drives a large share of the cardinality of histogram distributions. The Agent needs the tags today because it tracks bucket deltas per context, and the tags are what keep each bucket's context unique. The new datadog-agent path tracks state per context and bounds, so the tags can be dropped.

    The option is opt-in because existing dashboards, monitors and queries may group or filter by these tags, and they stop matching once the tags are removed.

    Follow-ups:

  • datadog-agent: DataDog/datadog-agent#57029 adds the submit_histogram_bucket_multi builtin.

  • integrations-core: add the option to the shared OpenMetrics configuration template, with the minimum Agent version, once the datadog-agent change ships.
  • 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
  • Diff: 312 lines (+234 / -78) across 3 files Reviewer: steveny91 Review duration: 14768m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 312 lines diff across 3 files
    0.40
    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.344
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #25378"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    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: 40.3% (MEDIUM) · Higher = larger blast radius
    40.3%
    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: 15.9% · Safe to merge
    15.9%