GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@dougqh dougqh commented Nov 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions
@dougqh dougqh added tag: performance Performance related changes type: refactoring inst: kafka Kafka instrumentation tag: ai generated Largely based on code generated by an AI or LLM labels Nov 21, 2026
@dougqh
dougqh force-pushed the dougqh/kafka-value-views branch from dc3fa0c to ff9248d Compare November 21, 2026 15:03
@dougqh
dougqh force-pushed the dougqh/datadog-id-views branch from 60b0a1f to 34e9eee Compare November 21, 2026 15:11
@dougqh
dougqh force-pushed the dougqh/kafka-value-views branch from ff9248d to c93abef Compare November 21, 2026 15:11
@datadog-prod-us1-6

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.

Copy link
Copy Markdown

🎯 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!
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dd-octo-sts

dd-octo-sts Bot commented Nov 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

🟢 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pr-commenter

pr-commenter Bot commented Nov 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pr-commenter

pr-commenter Bot commented Nov 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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%]
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dougqh dougqh mentioned this pull request Nov 21, 2026
Dispatch extraction on header constants instead of comparing names #13613
Draft
@dougqh
dougqh force-pushed the dougqh/datadog-id-views branch from 34e9eee to 06bd242 Compare November 21, 2026 19:14
@dougqh
dougqh force-pushed the dougqh/kafka-value-views branch 2 times, most recently from 08e45a4 to cf19f37 Compare November 21, 2026 19:39
@dougqh
dougqh force-pushed the dougqh/datadog-id-views branch from 06bd242 to 11bb1c7 Compare November 21, 2026 19:39
This was referenced Nov 23, 2026
Merge a W3C trace context from the header cache without running its interpreter #13651
Draft
Read only the priority and parent id from a lower-priority W3C tracestate #13650
Draft
@dougqh
dougqh force-pushed the dougqh/datadog-id-views branch from 11bb1c7 to ba28504 Compare November 23, 2026 21:17
@dougqh
dougqh force-pushed the dougqh/kafka-value-views branch from cf19f37 to afee6bc Compare November 23, 2026 21:17
@dougqh
dougqh force-pushed the dougqh/datadog-id-views branch from ba28504 to 0d337eb Compare November 23, 2026 23:36
@dougqh
dougqh force-pushed the dougqh/kafka-value-views branch from afee6bc to 20f4cf5 Compare November 23, 2026 23:36
@dougqh
dougqh force-pushed the dougqh/datadog-id-views branch from 0d337eb to 6bea93d Compare November 23, 2026 23:47
@dougqh
dougqh force-pushed the dougqh/kafka-value-views branch 2 times, most recently from 019c24c to f1f822e Compare November 24, 2026 02:33
@dougqh
dougqh force-pushed the dougqh/datadog-id-views branch 2 times, most recently from 76394da to fbcec63 Compare November 24, 2026 18:30
@dougqh
dougqh force-pushed the dougqh/kafka-value-views branch 2 times, most recently from 65a1922 to e6f4a95 Compare November 24, 2026 20:10
@dougqh
dougqh force-pushed the dougqh/datadog-id-views branch from fbcec63 to c36aa26 Compare November 24, 2026 20:10
dougqh and others added 2 commits November 24, 2026 15:53
@dougqh @claude
Add AsciiSequence, a CharSequence view of ASCII bytes
14bd8b4
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]>
@dougqh @claude
Hand parse-only Kafka header values to extraction as views
effc650
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]>
@dougqh
dougqh force-pushed the dougqh/kafka-value-views branch from e6f4a95 to effc650 Compare November 24, 2026 21:00
@dougqh
dougqh force-pushed the dougqh/datadog-id-views branch from c36aa26 to 76b5f3d Compare November 24, 2026 21:00

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

inst: kafka Kafka instrumentation tag: ai generated Largely based on code generated by an AI or LLM tag: performance Performance related changes type: refactoring

Projects

None yet

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.

1 participant

@dougqh
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.