Repository navigation
Conversation
…ring The W3C injector passed the span's id for the tracestate's p element as DDSpanId.toHexStringPadded, a byte array and a String per injection that the encoder then copied into the header. PaddedHexSpanId carries the id as a long and the encoder appends its 16 digits directly. The header is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 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
Writes the injecting span's id into the W3C
tracestate'spelement straight from thelong, instead of formatting it into a padded hexStringfirst.PaddedHexSpanIdis a smallCharSequenceholding the id.W3CPTagsCodec.appendPrefixrecognizes it and appends its 16 digits directly into the header it is building. The parent-id override is only ever measured (length()) and appended, so no API changes. The header is byte-identical: the compound extraction golden, which records every injected header, is unchanged.Motivation
The W3C injector passed
DDSpanId.toHexStringPadded(spanId), which costs abyte[]and aStringper injection, only for the encoder to copy them into the header. In a JFR profile of a Kafka enricher this formatting was about 3% of inject time. It's a small item from the Kafka per-record cost work.Results
InjectorBenchmark.injectContext(default inject styles, Datadog + W3C), 3 forks × 5 iterations:Quiet re-run (3 forks × 5 iterations): 17.31 ± 0.20 → 17.23 ± 0.16 µs/op (no change within error), allocation 10,348 → 10,214 B/op (−134 B). So it saves allocation without costing time.
Additional Notes
PaddedHexSpanIdTestcheckscharAt,appendTo,subSequenceandtoStringagainstDDSpanId.toHexStringPaddedfor zero, one, a typical id, and the signed extremes.🤖 Generated with Claude Code