Repository navigation
Conversation
Contributor
Contributor
🟢 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. |
This was referenced Oct 23, 2026
The Datadog extractor parsed x-datadog-tags as soon as it saw the header, before the sampling priority was necessarily known, so the tags started at UNSET and the root span's constructor installed the priority as a second sampling state. The raw header is now kept and parsed when the context is built, starting from the priority the trace will inherit, so the root span's reconcile is a no-op. When APM tracing is disabled, the upstream priority may not be inherited, so the tags still start at UNSET there. 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>
dougqh
force-pushed
the
dougqh/extract-priority-in-ptags
branch
from
October 23, 2026 20:26
ec3b0d3 to
67e1349
Compare
This branch has not been deployed
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.
What Does This Do
The Datadog extractor now keeps the raw
x-datadog-tagsvalue and parses it when the context is built. At that point the sampling priority is known, so the extractedPropagationTagsstarts from the priority the trace will inherit.Before, the tags were parsed as soon as the header was seen, which isn't necessarily after
x-datadog-sampling-priority. They started at UNSET, and the root span's constructor then installed the priority as a second sampling-state snapshot (setSamplingPriority(priority, UNKNOWN)). That install is now a no-op.With APM tracing disabled, the upstream priority may not be inherited, so the tags still start at UNSET and behave exactly as before.
Motivation
TraceSegment work (APMLP-2049), step 2: one sampling state per extracted trace.
I counted
SamplingStateconstructions with a temporary counter while runningPropagationScenariosBenchmark's two upstream header sets through extract, root start, inject and finish. Per extracted trace, the count goes from 4 to 3:The remaining extra two are the throwaway W3C
PropagationTagsfrom compound extraction and the compound merge's new state. Removing them is the next step.Allocation (
PropagationScenariosBenchmark, JDK 17,@Threads(8), 1 fork × 5 iterations,-prof gc; base = #13009):Throughput is pending. The host was busy during these runs, and all pairs overlap within their error. A quiet run will be added before this is marked ready.
Additional Notes
Output is unchanged. Starting from the priority at extract leads to the same final state as installing it at root start:
otconsistency check now runs at the compound merge instead of at the root reconcile. That check is idempotent and order-independent (see Defer parsing the extracted OpenTelemetry tracestate member #12987).UNKNOWNnever changes the decision maker.Tests:
DatadogHttpExtractorTest: the extracted tags carry the priority whichever header comes first, and don't when APM tracing is disabled.DDSpanContextPropagationTagsTest: the root span keeps the extractedSamplingStateinstance.The full
dd-trace-coresuite passes, apart from the 2TracerConnectionReliabilityTestcases, which need Docker.Stacked: master ← #13008 ← #13000 ← #13009 ← this PR.
🤖 Generated with Claude Code