← Back to Pull requests

chore(telemetry): remove unused metrics from telemetry check and push users towards OpenMetrics-based telemetry over expvars #55721

Closed
unknown closed this pull request without merging on Sep 24, 2026 20:56 UTC
View on GitHub
unknown unknown commented on Sep 01, 2026 17:00 UTC
Author

What does this PR do?

This PR revamps the telemetry core check, removing metrics that aren't required to be sent directly to the customer's account, and updates our guidance around how to collect the Agent's internal telemetry to prefer the OpenMetrics telemetry endpoint over the expvar endpoint.

Motivation

Our approach for how we expose internal telemetry from the Datadog Agent is fractured due to a long list of incremental changes over time, and this PR aims to improve that by starting to clean things up and aligning the Core Agent with the broader guidance we offer customers.

We're doing a few things here:

  • removing some metrics from the list of metrics sent by the telemetry check

  • getting rid of the the default-vs-non-default metrics registry paradigm to collapse everything down to a _single_ metrics registry

  • updating the telemetry check to only emit metrics that are _directly_ required by product features on the Datadog UI through a dedicated allowlist

  • _also_ updating the telemetry check to support remapping the name of the metrics defined in its allowlist

  • _internally_ renaming the metrics that the telemetry check still emits but remapping their name to avoid any breaking changes with customers

  • pushing customers away from collecting telemetry via expvars, and instead having them use the OpenMetrics endpoint
  • All of these things generally fall into one of two buckets: removing complexity with how internal telemetry is defined, and making the metrics we emit (whether by default or when scraped through /telemetry) more consistent.

    Removing internal complexity (mostly)

    This one is the big one here as it deals with the refactoring and renaming we've done.

    Prior to this PR, the whole "default vs non-default" metrics registry thing meant that we collected some metrics that literally never made it into the /telemetry output, which is kind of dumb from a user perspective: it's just internal telemetry, but due to this weird thing we did to emit it by default, they can't _intentionally_ scrape it and send it somewhere else.

    That pattern also had implications with telemetry coming in over RAR, which landed in the non-default registry, and then required jumping through hoops to extract and merge into the default registry metrics ... it was just a mess. We now put everything into a single registry which means that the telemetry check, COAT, and /telemetry endpoint all have a consistent view of the world.

    One caveat here is that we had to rename the internal metrics that we emit by default to avoid double counting. Going back to the above, default and non-default metrics couldn't mix before, which meant while that, for example, while point.sent might be sent by default, you couldn't also define an OpenMetrics check to scrape /telemetry and collect it _again_ and end up with double counting at query time: point.sent just wasn't exposed on /telemetry. Collapsing the registries means it _is_ exposed via /telemetry now, along with any other metric that was specifically a "default" metric.

    In order to get around this -- continue sending these metrics to customers by default to avoid breakage, but also avoid the double counting risk -- we added support to remap the name of metrics sent by the telemetry check, and changed the base name of these metrics while remapping them back to their old names. This is safe because it avoids customer breakage (due) and because they only show up in /telemetry as of this PR, so we're not changing the name of the metric in /telemetry: it's brand new from the perspective of users.

    Pushing users towards the OpenMetrics endpoint instead of expvars

    This aspect is part of a broader alignment around getting away from expvars.

    Expvars are effectively soft deprecated: we expose them, but we hardly ever add new ones anymore. In contrast, our OpenMetrics-based telemetry is richer (tags, types, _more_ metrics in general) and is the blessed approach for Agent development, also serving as the source for COAT data.

    As we add more subagents which are not Go-based, we also lack the ability to consistently expose expvar endpoints, while OpenMetrics is more or less the unofficial industry standard for exposing internal telemetry from daemons.

    In order to push this forward, we've added a new openmetrics.d/agent_stats.yaml.example example configuration that aligns with the default set of internal metrics collected by the expvar-based configuration and left the go_expvar.d/agent_stats.yaml.example example configuration in place _but_ marked it as deprecated via a comment block at the top of the file.

    Likewise, as part of this clean up, we removed an old expvar in the aggregator, HostnameUpdate, and the associated channels, as the functionality was removed from the aggregator many years ago, and also added a number of new internal telemetry metrics (mostly in the aggregator and logs agent) to match parity with expvar-based versions referenced in agent_stats.yaml.example.

    Describe how you validated your changes

    New unit tests, existing unit tests, E2E tests, all the tests.

    Additional Notes

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: eliottness Review duration: 33356m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    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.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #55721"
    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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 20.5% · Safe to merge
    20.5%