Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

UpstreamGrpcSender ignores a "Host" header when overriding the authority

Đã đóng Phù hợp với người mới
#8,956 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Một pull request liên quan đã được merge.

  • #8957 của @thswlsqls — đã merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
grpc, java
Lĩnh vực
backend, testing

Hướng nghiên cứu

Bắt đầu với UpstreamGrpcSender.send() và phần tìm header host, sau đó xem lại AbstractGrpcTelemetryExporterTest.overrideHost cùng các bài kiểm thử sender được nhắc đến trong issue. Tái hiện trường hợp với Host và HOST, rồi so sánh các sender dùng managed channel với sender OkHttp mặc định. Hoàn tất khi cách viết hoa thường của header luôn ghi đè :authority và các bài kiểm thử liên quan đều đạt.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Java
Star
2.5k
Fork
1k
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
68

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của open-telemetry/opentelemetry-java

Tất cả issue của open-telemetry/opentelemetry-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.