Repository navigation
W3CBaggagePropagator: support multiple baggage headers in extract - #5814
knowprasad wants to merge 2 commits into
Conversation
…agator Fixes open-telemetry#5811 by extracting all baggage header values returned by getter instead of only the first element, combining multiple header fields with commas in compliance with W3C Baggage and RFC 9110 specifications. Signed-off-by: prsdx <prsdx.dev@gmail.com>
Pull request dashboard statusWaiting on maintainers · refreshed 2026-10-26 20:57 UTC Merge when ready. Status above doesn't look right?
|
Signed-off-by: prsdx <prsdx.dev@gmail.com>
pmcollins
left a comment
There was a problem hiding this comment.
LGTM, thanks for the fix.
BTW, might want to look into the (harmless) extraneous characters in the PR description and how they got there. Code looks good though.
|
Fyi, I've opened #5823 which bundles together a number of fixes (including this one), so we should probably hold off on this for now. The new PR also addresses a gap in this implementation which is that |
|
Thanks @pmcollins! Cleaned up the formatting in the PR description. @herin049 thanks for linking #5823; happy to either land this targeted fix first or let #5823 supersede if maintainers prefer to merge the broader spec alignment as a single unit. /dashboard route:reviewers |
Description
In opentelemetry.baggage.propagation.W3CBaggagePropagator.extract, the implementation extracted only the first element from getter.get(carrier, self._BAGGAGE_HEADER_NAME). When a carrier contains multiple �aggage header entries (for example, when using frameworks that return a list of headers or when multiple integrations such as Sentry and OpenTelemetry inject separate baggage headers), all entries after the first were discarded.
Per the W3C Baggage specification:
And RFC 9110 Section 5.3:
This PR updates W3CBaggagePropagator.extract to:
Fixes #5811
Type of change
Checklist: