Repository navigation
Keep global tags apart from span defaults in the config snapshot (OTLP trace/resource-level split) - #12937
Keep global tags apart from span defaults in the config snapshot (OTLP trace/resource-level split)#12937dougqh wants to merge 7 commits into
Conversation
Remote config tracing_tags replaces the global tags (DD_TAGS), and removing the override restores them. This pins the intent stated in system-tests' TestDynamicConfigV2.test_tracing_client_tracing_tags, which only asserts that the RC tags are present. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remote config tracing_tags now replaces only the global tags (DD_TAGS). Previously the dynamic config held DD_TAGS and DD_SPAN_TAGS merged, so an RC tag override also dropped DD_SPAN_TAGS until it was removed. ConfigSnapshot now keeps the global tags and the span defaults as separate frozen TagMaps, and builds mergedTracerTags from them (span defaults win, as before). Span defaults are DD_SPAN_TAGS, or the tags given to the builder's defaultSpanTags, and are no longer lost on the first RC tag change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🟢 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.
More details
Remote-config tracing-tag replacements preserve local span defaults, including their precedence over global tags. The completed static review identified no reportable regression.
🤖 Bits Code Review · Commit 3d144d9
…nv and version Keeps the split of global tags and span defaults in the config snapshot, but restores the existing remote config behavior: while a tracing_tags override is active, it replaces DD_TRACE_SPAN_TAGS too. Whether span defaults should survive an override is left for a separate change. The override's global tags keep the configured env and version, so a consumer of the global tags (the OTLP resource) still sees them. Also names the span tags setting DD_TRACE_SPAN_TAGS, and switches the remote config tests to injectSysConfig. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mcculls
left a comment
There was a problem hiding this comment.
Nice, thanks for the cleanup
I noted a small discrepancy for an edge-case where the RC tracing_tags override is exactly the same as DD_TAGS but that's not a blocker to merging this improvement.
There was a problem hiding this comment.
An RC tracing_tags override equal to the configured global tags fails to replace span defaults. This includes an empty override intended to clear DD_TRACE_SPAN_TAGS when DD_TAGS is unset.
🤖 Bits Code Review · Commit 734aa30
…-span-tags # Conflicts: # dd-trace-core/src/test/java/datadog/trace/core/CoreTracerTest.java
Deciding whether an override was active by comparing the tags to DD_TAGS missed an override equal to them, including an empty override when no global tags are set. Mark tags set from remote config in DynamicConfig and use that, also when deciding whether to reuse a snapshot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What Does This Do
Keeps the global tags (
DD_TAGS) apart from the span defaults (DD_TRACE_SPAN_TAGS) in the tracer's config snapshot. Remote configtracing_tagsbehaves as before.Dynamic config:
tracingTagsnow holds only the global tags, seeded fromConfig.getGlobalTags(). The test-runner path,rebuildTraceConfig, already did this.Span defaults:
DD_TRACE_SPAN_TAGS(newConfig.getSpanTags()), or the tags given to the builder'sdefaultSpanTags.ConfigSnapshot: keeps two frozen maps alongsidemergedTracerTags:globalTags: the global tags as given, or their RC override. The override keeps the configuredenvandversion;spanDefaultTags: the span defaults plus the tracer-defined tags (env,_dd.dsm.enabled, …). While an RCtracing_tagsoverride is active, only the tracer-defined tags.mergedTracerTagsis built from both, with span defaults winning as before. Read-through and span semantics are unchanged.Motivation
#12813 (OTLP): to put
DD_TAGSon the OTLP Resource without repeating them on every span, the exporter needs the global tags as their own set. Today it has to recover them by comparing values against the staticConfig. With this change, core can build the Resource fromglobalTagsand writespanDefaultTagson spans, taking both from the trace's snapshot (TraceCollector.getTraceConfig()). The Resource then also follows RC tag changes, and keepsenvandversionthrough them. The OTLP side is a follow-up and isn't included here.Behavior changes (release notes)
tracing_tags: unchanged. While an override is active, it still replacesDD_TRACE_SPAN_TAGSalong withDD_TAGS, as Add test for remote config tracing tags overriding DD_TAGS (OTLP trace/resource-level split) #12936's test pins. Languages differ here (see Add test for remote config tracing tags overriding DD_TAGS (OTLP trace/resource-level split) #12936), so whether span defaults should survive an override is left for a separate PR.DDTracerdefaultSpanTags: explicit defaults are now the span-defaults level.DD_TAGSnow apply alongside them. Before, explicit defaults replaced the config tags at startup.env, dsm/djm) are now added at startup too. Before, they were only added after an RC tag change.Additional Notes
envandversioninglobalTags:Config.getGlobalTags()includes them whenDD_ENV/DD_VERSIONare set, and an RC override keeps them, so a Resource built fromglobalTagsdoesn't lose them while an override is active.globalTags/spanDefaultTagsyet. The consumer is the Stop repeating global tags as OTLP span attributes #12813 rebuild.remoteConfigTracingTagsOverrideGlobalTagshas aDD_TRACE_SPAN_TAGSrow, expecting the override to replace span tags too;configSnapshotSeparatesGlobalTagsFromSpanDefaults, covering the override and its removal;injectSysConfig, so each table row can set its own config.🤖 Generated with Claude Code