Autoconfiguration rejects OTEL_EXPORTER_OTLP_PROTOCOL=http/json

Aperta Adatta ai principianti
#5,981 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@WendeelMarinho ci sta già lavorando.

Dal 28/11/2026.

  • #5982 di @WendeelMarinho — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Leggi opentelemetry/sdk/_configuration/__init__.py, in particolare _EXPORTER_BY_OTLP_PROTOCOL, e riproduci l'errore con OTEL_EXPORTER_OTLP_PROTOCOL=http/json e OTEL_TRACES_EXPORTER=otlp. Aggiungi la mappatura http/json all'esporter otlp_json_http esistente e individua i test di configurazione dell'SDK per la selezione del protocollo OTLP. Fatto significa che trace, metriche e log utilizzano l'esporter JSON HTTP anziché generare l'errore di protocollo non supportato, con copertura di regressione.

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

Descrizione

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.

Lingua principale
Python
Stelle
2.7k
Fork
1.1k
Merge medio
3g 12h
PR unite (30g)
16

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

Tutte le issue di open-telemetry/opentelemetry-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.