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. PHP has no OTLP trace export, so the value is always false. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 10 Pipeline jobs failed
ℹ️ InfoNo other issues found (see more)❄️ No new flaky tests detected 🎯 Code Coverage (details) Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 842e535 | Docs | View more details | Give us feedback! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This adds
_dd.sdk.otlp_export: "false"to the meta of the first span of each trace chunk. It's set at the start of theis_first_spanblock inddtrace_serialize_span_to_rust_span(tracer/serializer.c), right before_dd.tags.process, using the existingddog_add_str_span_meta_strFFI call. No libdatadog change is needed.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.PHP has no OTLP trace export (
otlp_traces_export_enabledis hardcoded false), so the value is always"false". The OTLP-onlydatadog.sdk.semanticsresource attribute doesn't apply.Details:
dd_trace_serialize_closed_spansall serialize through this function. No other path writes chunk-level tags.is_first_spanis true when the trace is still empty, so if stats computation drops a span, the next serialized span gets the marker.Tests:
tests/ext/sdk_otlp_export_marker.phptbuilds two traces of three spans and checks the marker is'false'on each chunk's first span only.SpanChecker,SnapshotTestTrait(test-agent ignore list) anddd_dumper.incignore the marker the same way they already ignore_dd.tags.process/_dd.svc_src. So existing tag and snapshot assertions don't need to list it..phptfiles undertests/ext/and 7 underappsec/tests/extension/that print first-span meta.ddog_add_str_span_meta_str(rust_span, "track_error", "false")usage in the same file. Affected tests were found by grepping, so CI may surface a missed expectation.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.
Reviewer checklist
🤖 Generated with Claude Code