Conversation
Tag the first span of each chunk with _dd.sdk.otlp_export=false, next to _dd.tags.process, so the backend can tell native-exported spans from spans that reached it through the datadogreceiver instead of inferring it at ingest time. Ruby has no OTLP trace export, so the value is always false. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 84fbf2e | Docs | View more details | Give us feedback! |
BenchmarksBenchmark execution time: 2026-09-25 19:29:44 Comparing candidate commit 84fbf2e in PR branch Found 0 performance improvements and 1 performance regressions! Performance is the same for 51 metrics, 0 unstable metrics.
|
What does this PR do?
Tags the first span of each trace chunk with
_dd.sdk.otlp_export: "false":Tracing::Metadata::Ext::TAG_SDK_OTLP_EXPORTholds the key.TraceFormatter#tag_sdk_otlp_export!sets it, inside the existingif first_spanblock, between_dd.tags.processand the git tags.The marker follows the same first-span rules as process tags. Both the HTTP transport and the native (libdatadog) transport go through
TraceFormatter.format!, so both carry it. The native transport's C extension (meta_iter_cbinext/libdatadog_api/trace_exporter.c) copies every string meta entry with no allowlist, so no C change is needed.Motivation:
This is part of the "Measuring Adoption of Datadog SDKs in OTel Mode (Traces)" RFC.
Today the backend infers which spans came from Datadog SDKs exporting OTLP at ingest time, using
telemetry.sdk.nameandspan_source. That's unreliable: the OpenTelemetry Collector'sdatadogreceiverhardcodestelemetry.sdk.name:Datadogon native payloads it converts. So tracers now declare their export mode on the wire."true"goes on the OTLP resource when exporting over OTLP, and"false"goes on the first span of each chunk for native export. An absent marker means an older tracer.Ruby has no OTLP trace export today (the startup log reports
otlp_traces_export_enabled: false), so the value is always"false", and the OTLP-onlydatadog.sdk.semanticsresource attribute doesn't apply.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, and intake resolves it into thedatadog.sdk.otlp_exporttag ondd.trace.intake.ingested_spans.Change log entry
None. This is an internal
_dd.*tag with no customer-visible behavior change.Additional Notes:
find_root_spanfalls back to the last span, and only a chunk with no spans returns early.How to test the change?
spec/datadog/tracing/transport/trace_formatter_spec.rbcover:bundle exec rspec spec/datadog/tracing/transport/: 343 examples, 0 failures, 6 pending (the pending ones needTEST_DATADOG_INTEGRATION=1)tracer-4.0image: rubocop reports no offenses, andsteep checkon the changed lib files reports no errors.🤖 Generated with Claude Code