GeezerVison is showing github.com — Merge a W3C trace context from the header cache without running its interpreter by dougqh · Pull Request #13651 · DataDog/dd-trace-java
Conversation
dougqh
commented
Nov 23, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
What Does This Do
When the Datadog headers have already given a context, compound extraction merges the W3C trace context into it. With a carrier that knows each key's header constant (the composite propagator's cache), the merge now reads traceparent and tracestate straight from it, instead of running the W3C interpreter over every cached header. Extracted contexts are unchanged.
Stacked on #13620.
Additional Notes
-
Same handling as the interpreter:
traceparent is trimmed, and a second traceparent means no context to merge;
- each
tracestate is trimmed, and the non-empty ones are joined with ,;
- neither header present means nothing to merge.
-
Same parse: the interpreter's traceparent parse is split into static helpers (validateTraceParent, traceParentTraceId, traceParentSpanId, traceParentPriority) that both paths call, and the tracestate parse is unchanged.
-
Falls back to the interpreter when header names are being logged, or when the carrier has a trace context key without a constant (a key the composite cache couldn't classify).
-
A mismatched trace id still builds the whole W3C context, for the span link (through extract, which gives what completeExtraction did).
-
Tests (ExtractorKeysForkedTest.mergingFromHeaderConstantsMatchesInterpretingEveryKey): runs the full compound-extraction corpus through both paths and checks the contexts are identical. That's every traceparent against every tracestate, with Datadog headers matching, mismatching or absent, and all priorities and tags. CompoundExtractionGoldenTest passes unchanged.
-
Numbers (KafkaFetchedHeadersBenchmark, same 5-vCPU Linux Xeon, JDK 21, BASE and this PR each run twice, interleaved, 5 forks per run): medians of all 10 forks per cell, since the sandbox was noisy in some runs:
The interpreter run was a modest part of the merge's cost; most of it is parsing, which Check tracestate members in one pass and skip t.* keys the merge never reads #13610 and Read only the priority and parent id from a lower-priority W3C tracestate #13650 address. With Read only the priority and parent id from a lower-priority W3C tracestate #13650's change stacked on top (same runs), fetchedAccessor is about −10% vs BASE.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
🎯 Code Coverage (details) • Patch Coverage: 85.33% • Overall Coverage: 59.70% (+0.02%)
This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4cd9ccf | Docs | Give us feedback!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
dd-octo-sts
Bot
commented
Nov 23, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
🟢 Java Benchmark SLOs — All performance SLOs passed
| Suite |
Status |
| Startup |
🟢 pass |
SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.
PR vs. master results
| Scenario |
Candidate |
master |
Δ (95% CI of mean) |
| startup:insecure-bank:iast:Agent |
14.06 s |
13.95 s |
[+0.3%; +1.4%] (maybe worse) |
| startup:insecure-bank:tracing:Agent |
12.96 s |
13.07 s |
[-1.6%; -0.1%] (maybe better) |
| startup:petclinic:appsec:Agent |
17.81 s |
17.66 s |
[-0.3%; +1.9%] (no difference) |
| startup:petclinic:iast:Agent |
17.72 s |
17.69 s |
[-0.8%; +1.1%] (no difference) |
| startup:petclinic:profiling:Agent |
17.58 s |
17.54 s |
[-1.1%; +1.5%] (no difference) |
| startup:petclinic:sca:Agent |
17.42 s |
17.10 s |
[-4.0%; +7.9%] (unstable) |
| startup:petclinic:tracing:Agent |
16.85 s |
16.86 s |
[-1.2%; +1.0%] (no difference) |
Commit: 4cd9ccf3 · CI Pipeline · Benchmarking Platform UI
Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
pr-commenter
Bot
commented
Nov 23, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Kafka / producer-benchmark
Parameters
|
Baseline |
Candidate |
| baseline_or_candidate |
baseline |
candidate |
| git_branch |
dougqh/kafka-value-views |
dougqh/w3c-merge-from-constants |
| git_commit_sha |
effc650 |
4cd9ccf |
See matching parameters
|
Baseline |
Candidate |
| ci_job_date |
1795555108 |
1795555108 |
| ci_job_id |
2298331819 |
2298331819 |
| ci_pipeline_id |
156344243 |
156344243 |
| cpu_model |
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz |
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz |
| git_commit_date |
1795553626 |
1795553626 |
| jdkVersion |
11.0.31 |
11.0.31 |
| jmhVersion |
1.36 |
1.36 |
| jvm |
/usr/lib/jvm/java-11-openjdk-amd64/bin/java |
/usr/lib/jvm/java-11-openjdk-amd64/bin/java |
| jvmArgs |
-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15002 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15002 -Dhttp.nonProxyHosts=localhost |
*.localhost |
| kernel_version |
Linux runner-zfyrx7zua-project-304-concurrent-1-mgde59sc 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux |
Linux runner-zfyrx7zua-project-304-concurrent-1-mgde59sc 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux |
| vmName |
OpenJDK 64-Bit Server VM |
OpenJDK 64-Bit Server VM |
| vmVersion |
11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu |
11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu |
Summary
Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.
See unchanged results
| scenario |
Δ mean throughput |
| scenario:not-instrumented/KafkaProduceBenchmark.benchProduce |
same |
| scenario:only-tracing-dsm-disabled-benchmarks/KafkaProduceBenchmark.benchProduce |
same |
| scenario:only-tracing-dsm-enabled-benchmarks/KafkaProduceBenchmark.benchProduce |
same |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
pr-commenter
Bot
commented
Nov 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Kafka / consumer-benchmark
Parameters
|
Baseline |
Candidate |
| baseline_or_candidate |
baseline |
candidate |
| git_branch |
dougqh/kafka-value-views |
dougqh/w3c-merge-from-constants |
| git_commit_sha |
effc650 |
4cd9ccf |
See matching parameters
|
Baseline |
Candidate |
| ci_job_date |
1795555148 |
1795555148 |
| ci_job_id |
2298331821 |
2298331821 |
| ci_pipeline_id |
156344243 |
156344243 |
| cpu_model |
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz |
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz |
| git_commit_date |
1795553626 |
1795553626 |
| jdkVersion |
11.0.31 |
11.0.31 |
| jmhVersion |
1.36 |
1.36 |
| jvm |
/usr/lib/jvm/java-11-openjdk-amd64/bin/java |
/usr/lib/jvm/java-11-openjdk-amd64/bin/java |
| jvmArgs |
-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=15002 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=15002 -Dhttp.nonProxyHosts=localhost |
*.localhost |
| kernel_version |
Linux runner-zfyrx7zua-project-304-concurrent-1-kwxr1g8m 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux |
Linux runner-zfyrx7zua-project-304-concurrent-1-kwxr1g8m 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux |
| vmName |
OpenJDK 64-Bit Server VM |
OpenJDK 64-Bit Server VM |
| vmVersion |
11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu |
11.0.31+11-post-1ubuntu1-22.04.2-Ubuntu |
Summary
Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.
See unchanged results
| scenario |
Δ mean throughput |
| scenario:not-instrumented/KafkaConsumerBenchmark.benchConsume |
same |
| scenario:only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark.benchConsume |
unsure [-12213.968op/s; -1903.976op/s] or [-3.894%; -0.607%] |
| scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume |
unsure [+236.619op/s; +10061.755op/s] or [+0.130%; +5.531%] |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…terpreter
When the Datadog headers have already given a context, compound extraction only
needs a few parts of the W3C trace context to merge into it, but ran the W3C
interpreter over every cached header to get them. With a carrier that knows
each key's header constant (the composite propagator's cache), the merge now
reads traceparent and tracestate straight from it: the same handling as the
interpreter (trimming, multiple traceparents, joined tracestates), the same
traceparent parse, now shared as static helpers, and the same tracestate parse.
A mismatched trace id still builds the whole W3C context, for the span link.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|