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

UpstreamGrpcSender ignores a "Host" header when overriding the authority

クローズ 初心者向け
#8,956 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

関連するプルリクエストがすでにマージされています。

  • #8957 @thswlsqls による — マージ済み

評価

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

調査の方向性

まず 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

  1. Put opentelemetry-exporter-sender-grpc-managed-channel on the classpath with an OTLP gRPC exporter.
  2. Set OTEL_EXPORTER_OTLP_HEADERS=Host=collector.example, or call OtlpGrpcSpanExporter.builder().addHeader("Host", "collector.example").
  3. Export and inspect the :authority the 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

環境構築

はじめの一歩

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

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

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

似ている issue

Java の issue をもっと見る

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

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