GeezerVison is showing github.com — Hand parse-only Kafka header values to extraction as views by dougqh · Pull Request #13620 · DataDog/dd-trace-java
Conversation
dougqh
commented
Nov 21, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
What Does This Do
The Kafka 3.8+ consumer's extraction hands the Datadog trace id, parent id and sampling priority headers' values as views of the record's bytes (AsciiSequence, #13617) instead of decoding them into Strings, so the Datadog extractor parses them in place (#13619). Extracted contexts are unchanged.
Stacked on #13619. Part 5 of the value-views series (#13616, #13617, #13618, #13619). Includes #13617's commit (Add AsciiSequence), cherry-picked because #13617 is based on master; it drops out on rebase once #13617 lands.
Additional Notes
- When: the visitor implements
TransientValueConsumer (the composite propagator's cache does), the adapter isn't in Base64 mode, the header has the agent's accessor (Read fetched Kafka headers without copying them first #13600), its HeaderSchema constant is parse-only, and the value bytes are ASCII and in a heap buffer (or an array Kafka already copied). Otherwise it decodes as before.
- The constant comes from
CarrierKeys.header(key), an identity check, since a matched fetched key is the declared name itself.
- Retention: the view shares the fetch buffer. It goes into the composite propagator's cache, which lives for the extraction, and the Datadog extractor parses it within the call (Parse Datadog ids and sampling priority from transient views #13619's retention test checks nothing keeps one).
- Tests (
RecordHeaderAccessTest): parse-only values arrive as AsciiSequences and others as Strings, including a header type other than Kafka's; values Kafka already copied are viewed too; non-ASCII and missing values aren't viewed; Base64 mode and visitors that don't take views get Strings. The module's tests pass (40, and 87 forked).
- Numbers (local smoke run, 2 forks, JDK 21,
KafkaFetchedHeadersBenchmark, fetchedAccessor): the whole series (Let carriers hand parse-only header values as transient views #13618–this PR) against Dispatch extraction on header constants instead of comparing names #13613: −104 B per record at appHeaders=0 (3084 → 2980, −3.4%) and −105 B at appHeaders=3; time within the error bars. A multi-fork A/B is pending.
An earlier version of the series added allocation: every interpreter in the compound extraction copied each view, and the cache kept views in a second array. Both are fixed (Parse Datadog ids and sampling priority from transient views #13619, Let carriers hand parse-only header values as transient views #13618).
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
datadog-prod-us1-6
Bot
commented
Nov 21, 2026
•
edited by datadog-datadog-prod-us1
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
🎯 Code Coverage (details) • Patch Coverage: 100.00% • Overall Coverage: 59.68% (+0.00%)
This comment will be updated automatically if new data arrives.
🔗 Commit SHA: effc650 | 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 21, 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.10 s |
14.06 s |
[-0.5%; +1.2%] (no difference) |
| startup:insecure-bank:tracing:Agent |
12.97 s |
13.09 s |
[-1.5%; -0.3%] (maybe better) |
| startup:petclinic:appsec:Agent |
17.27 s |
17.17 s |
[-0.4%; +1.6%] (no difference) |
| startup:petclinic:iast:Agent |
17.15 s |
17.14 s |
[-0.7%; +0.7%] (no difference) |
| startup:petclinic:profiling:Agent |
16.79 s |
16.24 s |
[-1.0%; +7.8%] (no difference) |
| startup:petclinic:sca:Agent |
17.24 s |
17.06 s |
[+0.2%; +1.9%] (maybe worse) |
| startup:petclinic:tracing:Agent |
16.23 s |
16.20 s |
[-0.6%; +0.9%] (no difference) |
Commit: effc650f · 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 21, 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/datadog-id-views |
dougqh/kafka-value-views |
| git_commit_date |
1795553625 |
1795553626 |
| git_commit_sha |
76b5f3d |
effc650 |
See matching parameters
|
Baseline |
Candidate |
| ci_job_date |
1795555111 |
1795555111 |
| ci_job_id |
2298338840 |
2298338840 |
| ci_pipeline_id |
156344471 |
156344471 |
| cpu_model |
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz |
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz |
| 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-0-33cby3f0 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-0-33cby3f0 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 21, 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/datadog-id-views |
dougqh/kafka-value-views |
| git_commit_date |
1795553625 |
1795553626 |
| git_commit_sha |
76b5f3d |
effc650 |
See matching parameters
|
Baseline |
Candidate |
| ci_job_date |
1795555045 |
1795555045 |
| ci_job_id |
2298338842 |
2298338842 |
| ci_pipeline_id |
156344471 |
156344471 |
| cpu_model |
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz |
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz |
| 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-0-jt5ghgv4 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-0-jt5ghgv4 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 1 performance regressions! Performance is the same for 2 metrics, 0 unstable metrics.
| scenario |
Δ mean throughput |
| scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume |
worse [-10301.412op/s; -4478.874op/s] or [-5.503%; -2.393%] |
See unchanged results
| scenario |
Δ mean throughput |
| scenario:not-instrumented/KafkaConsumerBenchmark.benchConsume |
same |
| scenario:only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark.benchConsume |
unsure [+230.724op/s; +15826.006op/s] or [+0.075%; +5.134%] |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 23, 2026
The byte counterpart of SubSequence: a view of a range of an array whose
bytes are all ASCII, without copying or decoding them, so a value that
arrived as bytes can be parsed in place. ofAscii returns null if a byte
isn't ASCII, and the caller decodes as before. @NoEscape, like
SubSequence: a view of a fetched record's bytes shares the whole fetch
buffer, so a value that must be kept is copied with toString().
Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the visitor takes transient views (the composite propagator's cache
does) and values are plain UTF-8, the Kafka 3.8 adapter hands a fetched
header's parse-only value (the Datadog trace id, parent id and sampling
priority) as an AsciiSequence over its bytes instead of decoding it, so
the Datadog extractor parses it in place. Non-ASCII values, direct
buffers, Base64 mode and other visitors take the String path as before.
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.
|