Autoconfiguration rejects OTEL_EXPORTER_OTLP_PROTOCOL=http/json

オープン 初心者向け
#5,981 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

@WendeelMarinho がすでに取り組んでいます。

2026年11月28日 から。

  • #5982 @WendeelMarinho による — オープン

評価

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

調査の方向性

opentelemetry/sdk/_configuration/__init__.py、特に _EXPORTER_BY_OTLP_PROTOCOL を読み、OTEL_EXPORTER_OTLP_PROTOCOL=http/json と OTEL_TRACES_EXPORTER=otlp で失敗を再現します。既存の otlp_json_http Exporter に http/json のマッピングを追加し、OTLP プロトコル選択に関する SDK 設定テストを特定します。完了とは、traces、metrics、logs がサポートされていないプロトコルのエラーを発生させる代わりに JSON HTTP Exporter を使用し、リグレッションカバレッジがあることです。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
2.7k
フォーク
1.1k
平均マージ
3日 12時間
マージ済み PR(30日)
16

環境構築

はじめの一歩

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

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

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

似ている issue

Python の issue をもっと見る

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

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