Repository navigation
fix(tracing): keep W3C tracestate dd= member within 256 chars - #20820
julinvictus wants to merge 6 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
Yun-Kim
left a comment
There was a problem hiding this comment.
Small nits but LGTM otherwise!
|
/merge |
|
View all feedbacks in Devflow UI.
The base branch of this pull request is currently frozen (see incident #61179). If you need to change something else, your pull request can still be merged by commenting |
brettlangdon
left a comment
There was a problem hiding this comment.
nit about brevity in the release note, otherwise lgtm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/merge |
|
View all feedbacks in Devflow UI.
The base branch of this pull request is currently frozen (see incident #61179). If you need to change something else, your pull request can still be merged by commenting |
Description
w3c_get_dd_list_memberkeeps thedd=list-member of the W3Ctracestateheader under 256 characters, but it only counted the tag text. Three things that end up in the header were not counted:;separators between tags (1 char each)p:<16 hex>;parent id field, prepended at injection time byw3c_tracestate_add_p/ the nativebuild_tracestate(19 chars)dd=prefix (3 chars)So the injected member could exceed the limit by roughly 30 characters. This now shows up in practice because LLM Observability propagates more
_dd.p.llmobs_*tags (llmobs_sid,llmobs_pagent_span_id,llmobs_pagent_name). With a typical set of those tags, the injecteddd=member was 285 characters. Proxies that enforce the W3C limit drop the wholetracestateheader, which breaks LLM Observability trace linking across services.The fix:
dd=andp:<16 hex>;up front (_W3C_DD_LIST_MEMBER_RESERVED_LEN).s:,o:,t.dm:,t.usr.id:) as they are written, separators included.;before each optional_dd.p.*tag.As before, tags that don't fit are dropped whole and never truncated.
Before (285 chars):
After (240 chars,
t.llmobs_pagent_span_iddropped because it no longer fits):Testing
w3c_get_dd_list_member/ tracecontext / inject tests fromtests/tracer/test_utils.pyandtests/tracer/test_propagation.pywith and without the patch. The patch introduced no new failures.Risks
p:space is reserved even when nop:field is added (no active Datadog span and no known last parent id). In that case up to 19 fewer characters are used for propagated tags than strictly allowed.llmobs_pagent_span_idis the one most likely to be dropped.Additional Notes
Opened from a fork, so some required CI can't run here and will need a maintainer to mirror the branch.
🤖 Generated with Claude Code