feat(telemetry): respect OTEL_EXPORTER_OTLP_PROTOCOL — support HTTP/protobuf exporter

Đang mở Phù hợp với người mới
#1,210 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 3 ngày

Chưa có ai nhận issue này.

Đá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
66/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
observability

Hướng nghiên cứu

Các exporter gRPC được import vô điều kiện từ opentelemetry.exporter.otlp.proto.grpc (OTLPSpanExporter và OTLPMetricExporter), vì vậy hãy bắt đầu bằng việc tìm xem phần thiết lập telemetry của mellea import chúng ở đâu. Kiểm tra cách nó đọc endpoint và biến môi trường, sau đó thêm một nhánh cho OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf để dùng các exporter từ opentelemetry.exporter.otlp.proto.http. Công việc hoàn tất khi thiết lập này chọn các exporter HTTP, giá trị mặc định và grpc hoạt động như trước, và một bài test hoặc lần chạy thủ công xác nhận đường dẫn HTTP.

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

Mô tả

area/telemetry enhancement p2

Mellea unconditionally imports `OTLPSpanExporter` and `OTLPMetricExporter` from `opentelemetry.exporter.otlp.proto.grpc`, hardcoding the gRPC transport for all signals. The standard `OTEL_EXPORTER_OTLP_PROTOCOL` environment variable is ignored.

The OTel SDK specification requires that `OTEL_EXPORTER_OTLP_PROTOCOL` be honoured. Most production collector stacks support both gRPC (port 4317) and HTTP/protobuf (port 4318), so this is not a critical gap for most deployments. However:

  • Users who prefer or require HTTP/protobuf (e.g. environments where gRPC is blocked, or sidecar collectors configured for HTTP only) cannot switch without patching mellea.
  • The hardcoded gRPC path means the transport cannot be overridden via the standard env var, diverging from the behaviour users expect from any other OTel-instrumented service.

Expected behaviour

When `OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf` is set, mellea should use `opentelemetry.exporter.otlp.proto.http` exporters targeting port 4318. When unset or `grpc`, current behaviour is correct.

HTTP/protobuf on port 4318 is confirmed to work with standard OTLP receivers; the exporter package is already a transitive dependency of the OTel Python SDK.

Ngôn ngữ chính
Python
Star
1.8k
Fork
161
Merge trung bình
4 ngày 3 giờ
Pull request đã merge (30 ngày)
45

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 generative-computing/mellea

Tất cả issue của generative-computing/mellea

Issue tương tự

Thêm issue về Python

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.