W3CBaggagePropagator.extract ignores all but the first baggage header
Maintainers usually reply within 2 days
@knowprasad is already working on this.
Since Oct 23, 2026.
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
- Domain
- backend, distributed-systems
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
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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-telemetry/opentelemetry-python
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
open-telemetry/opentelemetry-python#5700 · 1 comment ·
Maintainers usually reply within 2 days
-
Tests in test_metric_reader_storage.py assert on process-global mock state instead of on the storage under testPossibly taken @ocelotl claimed this 51 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
open-telemetry/opentelemetry-python#5638 ·
Maintainers usually reply within 2 days
-
`SpanProcessor.on_end` exceptions escape cleanup and replace application exceptionsPossibly taken @somuai claimed this 55 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
open-telemetry/opentelemetry-python#5624 ·
Maintainers usually reply within 2 days
-
PeriodicExportingMetricReader discards its shutdown timeoutPossibly taken @dwin-gharibi claimed this 67 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open-telemetry/opentelemetry-python#5574 · 1 comment ·
Maintainers usually reply within 2 days
-
W3C Baggage propagator uses form encoding instead of percent encodingPossibly taken @rxchitrx claimed this 12 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open-telemetry/opentelemetry-python#5566 · 2 comments · 1 reaction ·
Maintainers usually reply within 2 days
All issues in open-telemetry/opentelemetry-python
Similar issues
-
enhancement help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Git-Hospital/githealthcheck#61 ·
Maintainers usually reply within 1 day
-
changelog investigate
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
ramnes/notion-sdk-py#433 ·
-
Partial method descriptors raise on class accessPossibly taken @Gambit-Checkmate claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 19 days
-
docs pkg:core
Difficulty 1/5 Under an hour Newbie friendliness 84/100
pydantic/pydantic-ai#11929 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
intake/intake-esm#789 ·