Repository navigation
Require explicit opt-in for OTLP APM RED metrics computation - #13261
gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
Conversation
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4aa04808b9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
An explicit DDAgentWriter override can lose APM RED metrics: the new guard disables local aggregation while native trace requests still tell the Agent that stats were computed.
🤖 Bits Code Review · Commit 4aa0480
dougqh
left a comment
There was a problem hiding this comment.
The bots' point about isTraceOtlpExporterEnabled() vs the effective writer is real, and I think it goes a bit further. DDAgentApi sets Datadog-Client-Computed-Stats from config.isTracerMetricsEnabled() independently of the aggregator factory. So with trace.otel.exporter=otlp but traces still going to the agent (writer.type=DDAgentWriter, or a MultiWriter shipping to both agent and OTLP during a migration), we'd install the no-op aggregator while telling the agent stats were computed client-side, and those traces would get no stats at all. isOtlpTracesExportEnabled() alone wouldn't cover the MultiWriter case either.
Could we derive a single "native stats active" predicate (tracer metrics on and traces reach a DD agent writer) and use it in both the factory and the DDAgentApi header, so they can't disagree?
Also, since the old tri-state default shipped in 1.64.0, the release note should spell out that OTLP users relying on it will stop getting SDK-computed span metrics on upgrade.
There was a problem hiding this comment.
More details
The PR makes SDK-computed OTLP APM RED metrics opt-in, delegating computation to the Collector or intake by default. The earlier native-writer override defect is fixed: aggregation and Agent headers now share writer-aware eligibility, including mixed writers, and no findings remain open.
🤖 Bits Code Review · Commit 3239dc1
mhlidd
left a comment
There was a problem hiding this comment.
Overall looks good.
nit: Can we also update DDAgentFeaturesDiscovery and DDAgentWriter where isTracerMetricsEnabled() is still invoked?
dougqh
left a comment
There was a problem hiding this comment.
Thanks, this addresses my earlier comments. isNativeTracerMetricsEnabled() is now the single check behind both the aggregator choice and the Datadog-Client-Computed-Stats header, and statsAggregatorMatchesAgentHeader covers the writer-override and mixed MultiWriter cases. The upgrade note is in the description too.
Non-blocking nit: Config.isAgentWriterType copies WriterFactory's fallback for unrecognized writer types (unknown means DDAgentWriter). The table test would catch drift, but a comment pointing at WriterFactory would help the next person who adds a writer type.
One GitLab smoke shard (test_smoke: [21, 5/8]) is red. I didn't dig into it, so it's worth a retry before merging.
Confirmed: |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
Require explicit opt-in for SDK-computed APM RED metrics when exporting traces over OTLP. By default, the OpenTelemetry Collector or Datadog intake computes these metrics.
Native stats remain enabled when traces go to a Datadog Agent writer, including writer overrides and mixed Agent/OTLP writers. The aggregator and Agent request header use the same decision, so the Agent is told that stats are computed only when the SDK actually computes them.
Motivation
Align Java with the shared OTLP metrics contract in DataDog/system-tests#8237 and avoid duplicate SDK computation by default.
Additional Notes
Upgrade / release note: Implicit SDK span-metrics enablement shipped in 1.64.0. OTLP users who relied on that default will stop receiving SDK-computed span metrics after upgrading with this change. Configure APM RED metrics computation in the Collector or Datadog intake; SDK computation now requires explicit opt-in.
Validation: 5,837 internal API tests and 89 selected core tests passed, including 16 writer/aggregator/header combinations. Five of those regression cases failed before the fix. Full Spotless formatting, changed-module formatting checks, and a fresh agent/API build passed. All 18 focused shared system tests passed against merged revision
339de2815c638ce0faa98e02570301ad82e2473b, covering opt-in/defaults, native/OTLP mutual exclusion and client-computed-stats headers (--runxfailto exercise the pending Java activation).Related: DataDog/dd-trace-py#21389 (merged), DataDog/dd-trace-go#5773 (merged), DataDog/dd-trace-js#11105, DataDog/dd-trace-dotnet#9628.
Contributor Checklist