Conversation
Set _dd.sdk.otlp_export=false on the local root span of each trace chunk sent to the agent, so the backend can tell native export apart from OTLP export. dd-trace-cpp has no OTLP trace export, so the marker is unconditional. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
BenchmarksBenchmark execution time: 2026-10-01 18:40:53 Comparing candidate commit 95a0890 in PR branch Found 1 performance improvements and 5 performance regressions! Performance is the same for 2 metrics, 0 unstable metrics.
|
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 2 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 95a0890 | Docs | View more details | Give us feedback! |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches the stated wire-format requirement and has focused test coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Adds the native OTLP export marker to each trace chunk’s first span.
Changes:
- Defines the
_dd.sdk.otlp_exportinternal tag. - Sets the marker to
"false"during trace-segment finalization. - Tests that only the first span carries the marker.
| File | Description |
|---|---|
src/datadog/tags.h |
Declares the marker constant. |
src/datadog/tags.cpp |
Defines the marker key. |
src/datadog/trace_segment.cpp |
Adds the marker to the local root span. |
test/test_trace_segment.cpp |
Verifies marker placement and value. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@mhlidd |
|
@zacharycmontoya @xlamorlette-datadog The |
Description
As of today, we have no way of measuring OTLP export adoption throughout our tracers. As a result, we want the tracers to emit an
_dd.sdk.otlp_exporttag as a source of truth for the export mode that is used. This tag will be used in the backend with the ingested spans metric to determine the overall adoption of OTLP export. Despite dd-trace-cpp not supporting OTLP Export today, we still want an explicit tag to be set in the tracer, so only the value offalseis relevant here.Motivation
Additional Notes
Tests:
test/test_trace_segment.cpp("TraceSegment finalization of spans"). It builds a root with one child and checks there's one chunk, the marker is"false"onchunk[0], and it's absent onchunk[1].cmake -B build -DDD_TRACE_BUILD_TESTING=1 . && cmake --build build -j && ./build/test/tests: 134 test cases, 199,859 assertions, all passing.bin/formatwasn't run becauseclang-format-14isn't installed. Homebrewclang-format20.1.6 (--dry-run --Werror) reports the changed source files clean.Benchmarks:
check-big-regressionsflagsBM_TraceID_ParseHex(+9–12%) plus smallerBM_Hex*moves in both runs. Those benchmarks don't run the changed code;BM_TraceTinyCCSource, which does, is ~4% faster. The same benchmarks moved 5–20% on unrelated PRs (#366, #374), which points to binary layout or heap-state effects rather than this change.Related changes:
_dd.sdk.otlp_exportfrom Tracer to Intake datadog-agent#56749 hoists the marker from the first span of the first chunk into the payload.This change was written with AI assistance and reviewed before submission.
Jira ticket: N/A
🤖 Generated with Claude Code