Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

W3CBaggagePropagator.extract ignores all but the first baggage header

オープン 初心者向け
#5,811 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@knowprasad がすでに取り組んでいます。

2026年10月23日 から。

  • #5814 @knowprasad による — オープン
  • #5823 @herin049 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python

調査の方向性

まず W3CBaggagePropagator.extract と baggage 伝播のテストを読みます。issue には propagator の名前と再現用のコードが記載されています。2 つのヘッダー値を返す baggage getter を使って関連するテストを実行し、抽出された baggage に両方のキーと値のペアが含まれることを確認します。issue には担当者もリンクされた pull request も記載されていません。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
2.7k
フォーク
1k
平均マージ
3日 5時間
マージ済み PR(30日)
45

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

open-telemetry/opentelemetry-python のほかの issue

open-telemetry/opentelemetry-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。