UpstreamGrpcSender ignores a "Host" header when overriding the authority
メンテナーはふだん 2 日以内に返信
関連するプルリクエストがすでにマージされています。
- #8957 @thswlsqls による — マージ済み
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
調査の方向性
まず UpstreamGrpcSender.send() と host ヘッダーの検索処理を確認し、次に AbstractGrpcTelemetryExporterTest.overrideHost と issue で言及されている sender のテストを確認します。Host と HOST のケースを再現し、managed channel の sender とデフォルトの OkHttp sender を比較します。ヘッダーの大文字と小文字にかかわらず :authority が一貫して上書きされ、関連するテストが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
With opentelemetry-exporter-sender-grpc-managed-channel, a host header spelled Host (or HOST) does not override the gRPC :authority. Only the exact lowercase host works.
Steps to reproduce
- Put
opentelemetry-exporter-sender-grpc-managed-channelon the classpath with an OTLP gRPC exporter. - Set
OTEL_EXPORTER_OTLP_HEADERS=Host=collector.example, or callOtlpGrpcSpanExporter.builder().addHeader("Host", "collector.example"). - Export and inspect the
:authoritythe server receives.
What did you expect to see?
:authority is collector.example, as with the default OkHttp sender; #4514 added the gRPC override to match it. HTTP field names are case-insensitive (RFC 9110 §5.1).
What did you see instead?
:authority stays the endpoint address (e.g. 127.0.0.1:<port>) and the value goes out only as host metadata. UpstreamGrpcSender.send() looks up the override with the case-sensitive headers.get("host").
What version and what artifacts are you using?
Artifacts: opentelemetry-exporter-otlp, opentelemetry-exporter-sender-grpc-managed-channel
Version: main @ b32298a83 (1.68.0-SNAPSHOT)
How did you reference these artifacts? Gradle implementation
Environment
Compiler: Temurin 21
OS: N/A
Additional context
Adding addHeader("Host", ...) to AbstractGrpcTelemetryExporterTest.overrideHost fails on testGrpcNetty and testGrpcOkhttp and passes on testOkHttpVersionLATEST.
- 主要言語
- Java
- スター
- 2.5k
- フォーク
- 1k
- 平均マージ
- 2日 23時間
- マージ済み PR(30日)
- 68
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
open-telemetry/opentelemetry-java のほかの issue
-
OkHttpGrpcSender no longer logs retry attempts対応中かも @thswlsqls が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
open-telemetry/opentelemetry-java#8966 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
JdkHttpSender passes CompletionException instead of the original exception to onError対応中かも @thswlsqls が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-telemetry/opentelemetry-java#8961 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Fix `otel.sdk.log.created` counting semantics対応中かも @anuraaga が 75 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-telemetry/opentelemetry-java#8688 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 20/100
open-telemetry/opentelemetry-java#8971 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
open-telemetry/opentelemetry-java#8970 ·
メンテナーはふだん 2 日以内に返信
open-telemetry/opentelemetry-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
account bug communication lecture
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
area/server bug P2
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/java-sdk#1196 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Consumer progress rows interleave topics with equal queue IDs対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/rocketmq-dashboard#7250 ·
メンテナーはふだん 3 日以内に返信