W3CBaggagePropagator.extract ignores all but the first baggage header
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
まず W3CBaggagePropagator.extract と baggage 伝播のテストを読みます。issue には propagator の名前と再現用のコードが記載されています。2 つのヘッダー値を返す baggage getter を使って関連するテストを実行し、抽出された baggage に両方のキーと値のペアが含まれることを確認します。issue には担当者もリンクされた pull request も記載されていません。
索引モデルが issue の本文から書いたものです。
説明
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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
open-telemetry/opentelemetry-python のほかの issue
-
Delta exponential histogram never goes back to the maximum scale after a wide-range interval対応中かも @inchang-ing が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
open-telemetry/opentelemetry-python#5716 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
open-telemetry/opentelemetry-python#5700 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Tests in test_metric_reader_storage.py assert on process-global mock state instead of on the storage under test対応中かも @ocelotl が 47 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
open-telemetry/opentelemetry-python#5638 ·
メンテナーはふだん 2 日以内に返信
-
`SpanProcessor.on_end` exceptions escape cleanup and replace application exceptions対応中かも @somuai が 50 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
open-telemetry/opentelemetry-python#5624 ·
メンテナーはふだん 2 日以内に返信
-
PeriodicExportingMetricReader discards its shutdown timeout対応中かも @dwin-gharibi が 63 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
open-telemetry/opentelemetry-python#5574 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
open-telemetry/opentelemetry-python の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
GoogleCloudPlatform/gce-rescue#195 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
intake mcp-intake needs-ac needs-human-review priority:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
Ikalus1988/MisakaNet#3848 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
521xueweihan/HelloGitHub#4105 ·
-
bug size:XS
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信