🪞 12279 - Fix span link span ID hex padding - #12356
Conversation
DDSpanLink serialises link ids into the _dd.span_links tag with DDTraceId.toHexString for the trace id, which pads to 32 characters, but DDSpanId.toHexString for the span id, which delegates to Long.toHexString and strips leading zeros. Span ids are generated as non-zero positive longs, so the leading hex nibble is zero for one id in eight and those ids serialise to 15 characters or fewer. Consumers that treat the field as fixed-width hex reject them: the OpenTelemetry Collector's Datadog receiver calls SpanIDFromHex, which requires exactly 16 characters, and drops the link. The trace id is unaffected because both DD64bTraceId and DD128bTraceId pad to 32. Use DDSpanId.toHexStringPadded, which is the existing padded variant on the same class, so the emitted id is always 16 characters.
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
There was a problem hiding this comment.
More details
The encoder now writes each span-link span ID as a 16-character hexadecimal string. It keeps all leading zeroes.
🤖 Datadog Autotest · Commit 2ee853c · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
This comment has been minimized.
This comment has been minimized.
🟢 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. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Build pipeline has failing jobs for 5118a35: What to do next?
DetailsSince those jobs are not marked as being allowed to fail, the pipeline will most likely fail. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
This PR mirrors the changes from the original community contribution to enable CI testing with maintainer privileges.
Original PR: #12279
Original Author: @itsamenathan
Original Branch: itsamenathan/dd-trace-java:fix/pad-span-link-span-id-hex
Closes #12279
This is an automated mirror created to run CI checks. See tooling/mirror-community-pull-request.sh for details.