Emit decimal span_id and zero-padded 32-char hex trace_id in RUM resource events#185
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
ambushwork
force-pushed
the
yl/fix-span-id
branch
from
June 9, 2026 16:43
3438a71 to
7b95c4b
Compare
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
ambushwork
force-pushed
the
yl/fix-span-id
branch
from
June 10, 2026 08:45
7b95c4b to
1dd549a
Compare
ambushwork
marked this pull request as ready for review
June 10, 2026 08:47
abrooksv
approved these changes
Jun 11, 2026
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 PR do?
Fixes RUM → APM correlation for resources tracked via
DdUrlTransfer. RUM resource events now carry a backend-valid_dd.trace_id(32-char zero-padded hexadecimal) and_dd.span_id(decimal), so the rum-span-mapper backend can generate the corresponding APM span instead of silently dropping the event.Trace IDs were appearing on the RUM side but the trace was never propagated to APM.
The rum-span-mapper backend validates each RUM resource before generating a span:
The Roku SDK violated both:
A hex span_id containing any a–f fails isDigits, so for the W3C/B3 header types correlation essentially never worked; an unpadded trace_id (leading-zero nibbles) caused intermittent failures across all types.
Changes
generateTraceId()/generateSpanId()helpers that generate an id once and expose every representation each consumer needs (decimal, 16-char and 32-char zero-padded hex)._addSampledInHeadersso the RUM event always stores traceId as 32-char padded hex and spanId as decimal, while each wire header keeps its own required format (datadog low-decimal + _dd.p.tid hex, b3/b3multi/tracecontext padded hex).After change
Review checklist (to be filled by reviewers)