OTLP exporter error with non-global autoconfigured OpenTelemetry
instance
#5862
Labels
Bug
Something isn't working
OpenTelemetry
instance
#5862
Describe the bug
Using autoconfigure to create a global
OpenTelemetry
instance works correctly with the OTLP exporter for traces and metrics export.However, creating a non-global
OpenTelemetry
instance has some issues. Two symptoms occur:otlp_exporter_exported
andotlp_exporter_seen
are no longer exportedNo traces or metrics created by the application itself are impacted, they are exported correctly as expected. It would appear the OTLP exporter is attempting to use the global
OpenTelemetry
instance for these two internal metrics created by the exporter, despite autoconfiguration for the global instance being disabled.Steps to reproduce
Use the files below to create a Gradle Java project, and a Docker Compose configuration for spinning up a Collector, Jaeger and Prometheus instances.
src/main/java/org/example/OtlpExporterIssue.java
build.gradle
gradle.properties
compose.yaml
otel-collector.yaml
prometheus.yaml
Use the following commands to build the project, start the telemetry backends and run the project:
Wait at least 10 seconds before looking in Prometheus / Jaeger for exported telemetry.
What did you expect to see?
OpenTelemetry
, namely:otlp_exporter_exported
otlp_exporter_seen
processedSpans
queueSize
target_info
What did you see instead?
otlp_exporter_exported
andotlp_exporter_seen
are missing in the Metrics Explorer in PrometheusprocessedSpans
queueSize
target_info
What version and what artifacts are you using?
As noted in the
build.gradle
file above:io.opentelemetry:opentelemetry-api:1.30.1
io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:1.30.1
io.opentelemetry:opentelemetry-exporter-otlp:1.30.1
Environment
Additional context
The error does not occur if using a global
OpenTelemetry
instance. To see this, change a line in the Java program to the following:The text was updated successfully, but these errors were encountered: