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

Ouverte
#6,796 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 3 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
38/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
java
Domaine
observability

Piste de recherche

Commencez par comparer la gestion du endpoint OTLP et des variables d’environnement du protocole par Java agent et AutoConfigure SDK. Reproduisez la configuration signalée avec le chemin de l’endpoint OTLP et examinez la validation de OtlpConfigUtil décrite dans la stack trace. Le travail est terminé lorsque la même configuration se comporte de manière cohérente dans les deux configurations sans nécessiter de paramètre de protocole supplémentaire.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
Java
Étoiles
2.5k
Forks
1.1k
Merge moyen
5 j 11 h
PR mergées (30 j)
41

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de open-telemetry/opentelemetry-java

Toutes les issues de open-telemetry/opentelemetry-java

Issues similaires

Plus d'issues Java

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.