Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

W3CBaggagePropagator.extract ignores all but the first baggage header

Aperta Adatta ai principianti
#5,811 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@knowprasad ci sta già lavorando.

Dal 23/10/2026.

  • #5814 di @knowprasad — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Inizia leggendo W3CBaggagePropagator.extract e i test di propagazione del baggage; l’issue indica il propagatore e fornisce un riproduttore. Esegui i test pertinenti con un getter di baggage che restituisca due valori di intestazione, quindi conferma che entrambe le coppie chiave/valore compaiano nel baggage estratto. L’issue non segnala alcun assignee né alcuna pull request collegata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
2.7k
Fork
1k
Merge medio
3g 8h
PR unite (30g)
45

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di open-telemetry/opentelemetry-python

Tutte le issue di open-telemetry/opentelemetry-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.