W3CBaggagePropagator drops a list-member over 4096 bytes that W3C Baggage requires it to propagate
Mantenedores costumam responder em até 2 dias
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 70/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- python
- Domínio
- observability
Direção de pesquisa
O limite por membro é a constante _MAX_PAIR_LENGTH, verificada tanto no caminho de extract quanto no de inject de W3CBaggagePropagator; comece lendo onde essa constante é usada e como cada caminho descarta um membro. Confirme a direção proposta com um maintainer antes de editar, já que a interpretação da especificação é a questão em aberto. Adicione testes de extract e inject com 4100 bytes em tests/propagators/test_w3cbaggagepropagator.py e verifique se os limites de 180 membros e 8192 bytes continuam valendo.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Python
- Estrelas
- 2.7k
- Forks
- 1.1k
- Merge médio
- 4d 13min
- PRs com merge (30d)
- 38
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de open-telemetry/opentelemetry-python
-
opentelemetry-configuration: OTLP HTTP exporter does not validate TLS files exist at startupTalvez já em andamento @Dotify71 assumiu há 5 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
open-telemetry/opentelemetry-python#5928 ·
Mantenedores costumam responder em até 2 dias
-
otel.sdk.processor.{span,log}.queue.capacity uses synchronous UpDownCounter recorded once in __init__Talvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
open-telemetry/opentelemetry-python#5891 ·
Mantenedores costumam responder em até 2 dias
-
Prometheus map_unit incorrectly normalizes percent ratio units such as %/sTalvez já em andamento @knowprasad assumiu há 10 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
open-telemetry/opentelemetry-python#5875 · 1 comentário · 1 reação ·
Mantenedores costumam responder em até 2 dias
-
OTLP HTTP exporter reports a 3xx response as a successful export, so redirected batches are dropped without any logTalvez já em andamento @d4rshnn assumiu há 18 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
open-telemetry/opentelemetry-python#5865 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 70/100
open-telemetry/opentelemetry-python#5700 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
Todas as issues de open-telemetry/opentelemetry-python
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Deltares/numba_celltree#100 · 1 comentário ·
-
auto-reported bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 63/100
Mantenedores costumam responder em até 1 dia
-
soup airgap-bundle --bundle-size-cap nan, inf or a cap above ~1.67e299 GiB stops with an internal ValueError/OverflowError (exit 1) instead of a usage errorTalvez já em andamento @Keshemir assumiu hoje. Abertabug claimed difficulty:2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
MakazhanAlpamys/Soup#3045 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
dagster-io/skills#80 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia