Skip to content

Hand parse-only Kafka header values to extraction as views - #13620

Draft
dougqh wants to merge 2 commits into
dougqh/datadog-id-viewsfrom
dougqh/kafka-value-views
Draft

dougqh wants to merge 2 commits into
dougqh/datadog-id-viewsfrom
dougqh/kafka-value-views

Conversation

@dougqh

@dougqh dougqh commented Nov 21, 2026 •

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

🤖 Generated with Claude Code

@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 •

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!

@dd-octo-sts

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

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.

@pr-commenter

pr-commenter Bot commented Nov 21, 2026 •

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

@pr-commenter

pr-commenter Bot commented Nov 21, 2026 •

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

@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
@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
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
@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

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

Development

Successfully merging this pull request may close these issues.

1 participant