AutoConfigure SDK doesn't behave in the same way as the java agent regarding OTLP protocol

Abierto
#6,796 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
java

Línea de trabajo

Comienza comparando cómo Java agent y AutoConfigure SDK gestionan el endpoint OTLP y las variables de entorno del protocolo. Reproduce la configuración indicada con la ruta del endpoint OTLP e inspecciona la validación de OtlpConfigUtil descrita en el stack trace. Se considera terminado cuando la misma configuración se comporta de forma coherente en ambas configuraciones sin requerir un ajuste de protocolo adicional.

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

Descripción

blocked-v2 Bug

Describe the bug

For an application using the java agent, we can publish metrics using OTLP exporter with the following configurations:

OTEL_SERVICE_NAME="some-service-name"
OTEL_METRICS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_ENDPOINT="https://prometheus.mycompany.net/api/v1/otlp" # OTLP Receiver in Prometheus
OTEL_TRACES_EXPORTER=none
OTEL_LOGS_EXPORTER=none

For another application, using the AutoConfigure SDK, we face the following error:

io.opentelemetry.sdk.autoconfigure.spi.ConfigurationException: OTLP endpoint must not have a path: /api/v1/otlp
    at io.opentelemetry.exporter.otlp.internal.OtlpConfigUtil.validateEndpoint(OtlpConfigUtil.java:375) ~[opentelemetry-exporter-otlp-1.42.1.jar:1.42.1]

It seems to assume gRPC by default, which doesn't allow a path. We have had to explicitly set OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf for it to work fine.

What did you expect to see?

I expected the same configuration to be needed if using the java agent or not.

What version and what artifacts are you using?
Artifacts: opentelemetry-api, opentelemetry-sdk-extension-autoconfigure, opentelemetry-exporter-otlp
Version: v1.42.1
How did you reference these artifacts? pom.xml with the Maven BOM

Environment
Compiler: 11
OS: CentOS Stream 8

Lenguaje dominante
Java
Estrellas
2.5k
Forks
1.1k
Merge medio
5 d 11 h
PR fusionados (30 d)
41

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

Todos los issues de open-telemetry/opentelemetry-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.