Autoconfiguration rejects OTEL_EXPORTER_OTLP_PROTOCOL=http/json

Đang mở Phù hợp với người mới
#5,981 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

@WendeelMarinho đang làm issue này rồi.

Từ ngày 28/11/2026.

  • #5982 của @WendeelMarinho — đang mở

Đá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
82/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ệ
python
Lĩnh vực
observability-sre

Hướng nghiên cứu

Đọc opentelemetry/sdk/_configuration/__init__.py, đặc biệt là _EXPORTER_BY_OTLP_PROTOCOL, và tái hiện lỗi với OTEL_EXPORTER_OTLP_PROTOCOL=http/json và OTEL_TRACES_EXPORTER=otlp. Thêm ánh xạ http/json vào exporter otlp_json_http hiện có và tìm các bài kiểm thử cấu hình SDK cho việc chọn giao thức OTLP. Hoàn thành nghĩa là traces, metrics và logs sử dụng exporter JSON HTTP thay vì phát sinh lỗi giao thức không được hỗ trợ, kèm theo kiểm thử hồi quy.

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

Mô tả

bug
Describe your environment

OS: Debian (python:3.12-slim container)
Python version: 3.12
SDK version: 1.45.2
API version: 1.45.2
opentelemetry-distro 0.66b2, opentelemetry-exporter-otlp-json-http 0.66b2
Also checked on main (817f6d2): same table.

What happened?

http/json is one of the three values the spec allows for OTEL_EXPORTER_OTLP_PROTOCOL, and since #5374 there's an exporter for it (opentelemetry-exporter-otlp-json-http, registered as otlp_json_http for traces, metrics and logs). But _EXPORTER_BY_OTLP_PROTOCOL in opentelemetry/sdk/_configuration/__init__.py only knows grpc and http/protobuf, so the default otlp exporter fails at startup and the app runs without telemetry.

Steps to Reproduce

pip install opentelemetry-distro opentelemetry-exporter-otlp-json-http
OTEL_EXPORTER_OTLP_PROTOCOL=http/json OTEL_TRACES_EXPORTER=otlp
opentelemetry-instrument python -c "print('ok')"

Expected Result

The otlp_json_http exporter is picked, same as http/protobuf picks otlp_proto_http.

Actual Result

RuntimeError: Unsupported OTLP protocol 'http/json' is configured

Additional context

Workaround: OTEL_TRACES_EXPORTER=otlp_json_http. Mapping http/json to otlp_json_http in that table fixes it for all three signals.

Would you like to implement a fix?

Yes

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Ngôn ngữ chính
Python
Star
2.7k
Fork
1.1k
Merge trung bình
3 ngày 12 giờ
Pull request đã merge (30 ngày)
16

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-python

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

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.