Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

UpstreamGrpcSender ignores a "Host" header when overriding the authority

Chiusa Adatta ai principianti
#8,956 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Una pull request collegata è già stata integrata.

  • #8957 di @thswlsqls — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
grpc, java
Ambito
backend, testing

Direzione di ricerca

Inizia da UpstreamGrpcSender.send() e dalla ricerca dell’header host, poi esamina AbstractGrpcTelemetryExporterTest.overrideHost e i test dei sender citati nell’issue. Riproduci il caso con Host e HOST, confrontando i sender con managed channel con il sender OkHttp predefinito. Il lavoro è completato quando la combinazione di maiuscole e minuscole dell’header sovrascrive :authority in modo coerente e i test pertinenti passano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Java
Stelle
2.5k
Fork
1k
Merge medio
2g 23h
PR unite (30g)
68

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di open-telemetry/opentelemetry-java

Tutte le issue di open-telemetry/opentelemetry-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.