Repository navigation
Expose the trace's global tags and span defaults to serializers (OTLP trace/resource-level split) - #12960
Conversation
This comment has been minimized.
This comment has been minimized.
🟢 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. |
mcculls
left a comment
There was a problem hiding this comment.
The changes here make sense, building on the separation in the earlier PR
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.
More details
The tag-level separation preserves span-default precedence, and serializers receive the trace collector’s captured maps, keeping each trace consistent across configuration changes.
🤖 Bits Code Review · Commit 709a142
Serializers get the global tags (DD_TAGS, or their remote-config override) and the span defaults from the trace's config snapshot, so an OTLP export can write the global tags once as resource attributes instead of on every span. Both come from the snapshot the trace started with, so a config change mid-trace can't split one trace across two sets. getTags() is unchanged and still includes both. Test call sites pass empty maps; PayloadDispatcherImplTest's mocked PendingTrace now returns a real snapshot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also restores the Properties import the Metadata test still needs, which #12937's switch to injectSysConfig dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
709a142 to
017f6e6
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
Adds two values to
Metadata, the per-span object serializers receive:getGlobalTags(): the trace's global tags (DD_TAGS, or their remote-config override, which keeps the configuredenvandversion);getSpanDefaultTags(): the trace's span defaults (DD_TRACE_SPAN_TAGSplus tracer-defined tags such asenv), without the global tags. While a remote-config override is active, only the tracer-defined tags.DDSpanContextfills both from the trace's config snapshot (TraceCollector.getTraceConfig()), using the maps #12937 added. Every span in a trace shares its collector's snapshot, so a config change mid-trace can't split one trace across two sets of global tags.getTags()is unchanged and still includes both. Serializers that don't care about tag levels need no changes.Motivation
This gets #12813 (OTLP) what it needs to write
DD_TAGSonce on the Resource instead of on every span, without reaching intoTagMapinternals or comparing values against the staticConfig:getSpanDefaultTags()minus the keys the span sets itself;getGlobalTags().The encoder change itself stays with #12813.
The accessors are named for what the tags are, not where they come from. If trace-level state later moves to its own object (a trace segment), only
DDSpanContextchanges and serializers don't notice.Additional Notes
Metadata(one per serialized span, on the serializer thread) and one field read from the trace's snapshot. No change on the application thread.CoreTracerTest.metadataCarriesTheTraceConfigTagLevels: a span started before a config change still serializes its trace's original maps (same instances);Metadataconstructor call sites in tests passTagMap.EMPTY;PayloadDispatcherImplTestbuilds a realDDSpanContexton a mockedPendingTracewhose default answer returned a null snapshot. It now returns a real one. In production the snapshot is never null:PendingTraceandStreamingTraceCollectorfall back tocaptureTraceConfig().dd-trace-core: the only failures are two Docker-based tests (no Docker locally) and two known timing tests (DDAgentWriterCombinedTest,PendingTraceBufferTest). Both timing tests pass when run on their own.dd-trace-otpasses, and thetraceAgentTestandjmhsource sets compile.🤖 Generated with Claude Code