Conversation
The Datadog and X-Ray context interpreters both consumed X-Amzn-Trace-Id as AWS X-Ray context and returned from accept() immediately, so the header never reached handleTags(). A DD_TRACE_REQUEST_HEADER_TAGS entry mapping that header to a tag was therefore silently dropped whenever the interpreter that consumed it produced the winning context. Because CompoundExtractor keeps the tags of only the first extractor to return a context, the mapping appeared to work intermittently: it was honoured only when the Datadog interpreter returned no context at all and the tracecontext interpreter's tags were used instead. Any request that carried Datadog propagation headers, or merely a User-Agent, lost the tag. Drop the early return in both interpreters so the header is still passed to handleTags() after the X-Ray context has been extracted from it. Co-authored-by: Cursor <cursoragent@cursor.com>
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. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
ValentinZakharov
left a comment
There was a problem hiding this comment.
Looks good, for exactly this case
However, the same pattern (issue) occures with other special headers:
handledUserAgent- User-AgenthandledXForwarding- X-Forwarded-Proto/Host/For/PorthandledForwarding- Forwarded, Forwarded-ForhandledIpHeaders- X-Real-IP, True-Client-IP, CF-Connecting-IP, etc + custom IP-header
|
Closing in favour of #12695, which fixes the same bug more generally. |
What Does This Do
Makes a
DD_TRACE_REQUEST_HEADER_TAGSmapping onx-amzn-trace-idactually produce its tag.Both the Datadog and the X-Ray context interpreters recognise
X-Amzn-Trace-Id, extract AWS X-Ray context from it, and then return fromaccept()immediately. That early return means the header never reacheshandleTags(), so a header tag mapped onto it is silently dropped. This PR removes the early return in both interpreters, leaving X-Ray extraction itself unchanged.Motivation
APMS-20654
Additional Notes
Falling through to the shared tail of
accept()also routes the header pasthandledIpHeaders()and the baggage mapping.x-amzn-trace-idcannot match an IP header, so the only behaviour change beyond the tag is that an explicit baggage mapping on the header is now honoured too — consistent with every other header.Both regression tests were confirmed to fail without the codec changes.
Contributor Checklist
type:andcomp:labels assigned./gradlew spotlessApply