W3CBaggagePropagator drops a list-member over 4096 bytes that W3C Baggage requires it to propagate
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 70/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- observability
Direzione di ricerca
Il limite per membro è la costante _MAX_PAIR_LENGTH, verificata sia nel percorso di extract sia in quello di inject di W3CBaggagePropagator; inizia leggendo dove viene usata questa costante e come ciascun percorso scarta un membro. Conferma la direzione proposta con un maintainer prima di modificare il codice, dato che l'interpretazione della specifica è la questione aperta. Aggiungi test di extract e inject a 4100 byte in tests/propagators/test_w3cbaggagepropagator.py e verifica che i limiti di 180 membri e 8192 byte continuino a valere.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe your environment
- OS: macOS 26.7.2
- Python version: Python 3.15.2
- SDK version:
mainat66ec883 - API version:
mainat66ec883
What happened?
W3CBaggagePropagator drops any list-member longer than 4096 bytes (_MAX_PAIR_LENGTH), on extract and on inject, even when the whole header is far below 8192 bytes. W3C Baggage has no per-member limit. Its Limits section says a platform MUST propagate all list-members while the baggage-string has 64 members or fewer and is 8192 bytes or smaller, and only past that MAY it drop some.
Steps to Reproduce
from opentelemetry import baggage
from opentelemetry.baggage.propagation import W3CBaggagePropagator
p = W3CBaggagePropagator()
header = "session=" + "a" * 4092 + ",user=alice" # 2 members, 4112 bytes
print("extract:", {k: len(v) for k, v in baggage.get_all(p.extract({"baggage": header})).items()})
carrier = {}
p.inject(carrier, baggage.set_baggage("session", "a" * 4092)) # 1 member, 4100 bytes
print("inject:", carrier)
Expected Result
extract: {'session': 4092, 'user': 5}
inject: {'baggage': 'session=aaaa...'}
Actual Result
$ python bag.py
Baggage entry with key `session` exceeded the maximum number of bytes per list-member with length 4100
Baggage entry with key `session` exceeded the maximum number of bytes per list-member with length 4100
extract: {'user': 5}
inject: {}
Additional context
With _MAX_PAIR_LENGTH = 8192 the same script prints the expected result, and tests/propagators/test_w3cbaggagepropagator.py still passes (34 passed), because its tests derive their sizes from the constant. The 4096 comes from the 2020 Working Draft ("Maximum number of bytes per a single name-value pair: 4096"), which #5163 followed on inject; the current text dropped it, and #5823 kept it. opentelemetry-go has no per-member limit, and its larger members vanish at the first Python hop.
My pick is to remove the per-member check and keep the 180-member and 8192-byte limits. Shall I send that as a pull request with an extract and an inject test at 4100 bytes?
Would you like to implement a fix?
Yes
- Lingua principale
- Python
- Stelle
- 2.7k
- Fork
- 1.1k
- Merge medio
- 4g 13m
- PR unite (30g)
- 38
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di open-telemetry/opentelemetry-python
-
opentelemetry-configuration: OTLP HTTP exporter does not validate TLS files exist at startupForse già presa @Dotify71 l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
open-telemetry/opentelemetry-python#5928 ·
I maintainer di solito rispondono entro 2 giorni
-
otel.sdk.processor.{span,log}.queue.capacity uses synchronous UpDownCounter recorded once in __init__Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
open-telemetry/opentelemetry-python#5891 ·
I maintainer di solito rispondono entro 2 giorni
-
Prometheus map_unit incorrectly normalizes percent ratio units such as %/sForse già presa @knowprasad l’ha presa 10 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
open-telemetry/opentelemetry-python#5875 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
OTLP HTTP exporter reports a 3xx response as a successful export, so redirected batches are dropped without any logForse già presa @d4rshnn l’ha presa 18 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
open-telemetry/opentelemetry-python#5865 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
open-telemetry/opentelemetry-python#5700 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di open-telemetry/opentelemetry-python
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
docling-project/docling-pipelines#669 ·
I maintainer di solito rispondono entro 1 giorno
-
blocked kind/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
opendatahub-io/agent-eval-harness#329 · 2 commenti · 1 reazione ·
-
cc_wrapper crashes with ValueError on Windows when a path is on another driveForse già presa @TrapsterDK l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
tweag/rules_haskell#2492 ·
I maintainer di solito rispondono entro 1 giorno