Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

W3CBaggagePropagator.extract ignores all but the first baggage header

Closed Beginner friendly
#5,811 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@knowprasad is already working on this.

Since Oct 23, 2026.

  • #5814 by @knowprasad — open
  • #5823 by @herin049 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start by reading W3CBaggagePropagator.extract and the baggage propagation tests; the issue names the propagator and provides a reproducer. Run the relevant tests with a baggage getter returning two header values, then confirm both key/value pairs appear in the extracted baggage. The issue reports no assignee or linked pull request.

Written by the indexing model from the issue text.

Description

bug
Describe your environment

OS:Debian 12 bookworm / Debian 11 bullseye / macOS 26.7.1 (local)
Python version: Python 3.11 / Python 3.11.5 / 3.13.11 (local)
SDK version: 1.30.0
API version: 1.30.0 / 1.45.1 (local)

Tested this both locally and in our production on different / multiple versions.
We encountered this when using both sentry-sdk and otel together, as sentry is adding its own baggage first, our otel baggage is lost 😭

What happened?

Currently the W3CBaggagePropagator.extract keeps only the first value the getter returns. So if the integration has multiple baggage header entries only the first entry is kept and all other entries are lost. Entries in one baggage header work as expected, multiple baggage headers only the first one is kept.

We encountered this when using both sentry-sdk and otel together, as sentry is adding its own baggage first, our otel baggage is lost 😭

Steps to Reproduce

#Steps to reproduce
from opentelemetry.baggage import get_all
from opentelemetry.baggage.propagation import W3CBaggagePropagator

baggages = {"baggage": ["key1=value1", "key2=value2"]}
print(dict(get_all(W3CBaggagePropagator().extract(baggages))))
#Run with opentelemetry-api==1.45.1.
#Expected result: {'key1': 'value1', 'key2': 'value2'}
#Actual result: {'key1': 'value1'}

Expected Result

{'key1': 'value1', 'key2': 'value2'}

Actual Result

{'key1': 'value1'}

Additional context

I could not find any open issues or PRs fixing this, I also find out that our Go services (otel-go) instances handle this correctly,
they did fix it via: https://github.com/open-telemetry/opentelemetry-go/pull/5973

I do have a CLAUDed draft fix https://github.com/Luxas98/opentelemetry-python/compare/main...fix/baggage-multiple-headers

Would you like me to open the PR against your repo?

Would you like to implement a fix?

Yes

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Dominant language
Python
Stars
2.7k
Forks
1.1k
Avg merge
3d 17h
Merged PRs (30d)
51

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from open-telemetry/opentelemetry-python

All issues in open-telemetry/opentelemetry-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.