From bfecf760ca4309444213748a3b9c62f9a5badcb0 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 3 Jul 2023 13:22:25 +0300 Subject: [PATCH] Fix span export issue when user provided SpanProcessor beans exist SpanProcessor implementations are hooked into OTel in Quarkus via the AutoConfiguredOpenTelemetrySdkBuilder#addTracerProviderCustomizer mechanism, which in turn obtains those processor from CDI. However, because LateBoundBatchSpanProcessor (which is the one that ends up being responsible for the span export via its BatchSpanProcessor delegate) was marked as a @DefaultBean, when a user provided SpanProcessor became part of the application, the LateBoundBatchSpanProcessor was completely ignored. The fix is simply to remove @DefaultBean and always have LateBoundBatchSpanProcessor be considered as a SpanProcessor. Fixes: #33407 --- .../runtime/exporter/otlp/OtlpExporterProvider.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/OtlpExporterProvider.java b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/OtlpExporterProvider.java index e7aff0612c956..4d8b016d97b02 100644 --- a/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/OtlpExporterProvider.java +++ b/extensions/opentelemetry/runtime/src/main/java/io/quarkus/opentelemetry/runtime/exporter/otlp/OtlpExporterProvider.java @@ -3,14 +3,11 @@ import jakarta.enterprise.inject.Produces; import jakarta.inject.Singleton; -import io.quarkus.arc.DefaultBean; - @Deprecated @Singleton public class OtlpExporterProvider { @Produces @Singleton - @DefaultBean public LateBoundBatchSpanProcessor batchSpanProcessorForOtlp() { return new LateBoundBatchSpanProcessor(); }