Autoconfiguration rejects OTEL_EXPORTER_OTLP_PROTOCOL=http/json

Abierto Apto para principiantes
#5,981 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@WendeelMarinho ya está trabajando en esto.

Desde el 28/11/2026.

  • #5982 de @WendeelMarinho — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
82/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

Lee opentelemetry/sdk/_configuration/__init__.py, especialmente _EXPORTER_BY_OTLP_PROTOCOL, y reproduce el fallo con OTEL_EXPORTER_OTLP_PROTOCOL=http/json y OTEL_TRACES_EXPORTER=otlp. Añade la asignación http/json al exportador otlp_json_http existente y localiza las pruebas de configuración del SDK para la selección del protocolo OTLP. Terminar significa que los traces, las métricas y los logs usan el exportador JSON HTTP en lugar de generar el error de protocolo no compatible, con cobertura de regresión.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
2.7k
Forks
1.1k
Merge medio
3 d 12 h
PR fusionados (30 d)
16

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de open-telemetry/opentelemetry-python

Todos los issues de open-telemetry/opentelemetry-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.