Autoconfiguration rejects OTEL_EXPORTER_OTLP_PROTOCOL=http/json

Aberta Para iniciantes
#5,981 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

@WendeelMarinho já está trabalhando nisso.

Desde 28/11/2026.

  • #5982 de @WendeelMarinho — aberto

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
82/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python

Direção de pesquisa

Leia opentelemetry/sdk/_configuration/__init__.py, especialmente _EXPORTER_BY_OTLP_PROTOCOL, e reproduza a falha com OTEL_EXPORTER_OTLP_PROTOCOL=http/json e OTEL_TRACES_EXPORTER=otlp. Adicione o mapeamento http/json ao exporter otlp_json_http existente e localize os testes de configuração do SDK para a seleção do protocolo OTLP. Concluído significa que traces, métricas e logs usam o exporter JSON HTTP em vez de gerar o erro de protocolo não suportado, com cobertura de regressão.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Python
Estrelas
2.7k
Forks
1.1k
Merge médio
3d 12h
PRs com merge (30d)
16

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de open-telemetry/opentelemetry-python

Todas as issues de open-telemetry/opentelemetry-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.