Closed
Description
This issue was originally reported here: #34508 (comment) by @chicobento:
Hi @jonatan-ivanov , we are facing some issues integrating this into our project. The scenario is the following:
- we have a custom class that implements
SpanExporter
interface and internally wraps our own mutableOtlpHttpSpanExporter
- with this, we need to prevent the
OtlpAutoConfiguration
from creating theOtlpHttpSpanExporter
Bean. However, the @ConditionalOnMissingBean is based only on OtlpHttpSpanExporter and OtlpGrpcSpanExporter beans, which is not our case as we implementSpanExporter
interface and cannnot descend from theOtlpHttpSpanExporter
since its finalSome possible solutions to my problem that I tried:
- Remove
OtlpAutoConfiguration
: this behavior is added by a internal library, so I cannot easily remove theOtlpAutoConfiguration
without impacting the applications that uses our lib- Replace the
SpanProcessor
: as theOpenTelemetryAutoConfiguration.otelSpanProcessor
method does not have a@ConditionalOnMissingBean
. I cannot easily replace theSpanProcessor
with a custom one that would ignore theOtlpHttpSpanExporter
Bean provided byOtlpAutoConfiguration
- Replace the
OpenTelemetryAutoConfiguration.otelSdkTracerProvider
: this would not work because theSpanProcessor.otelSpanProcessor
will always instantiate a BatchSpanProcessor and start its thread. I'd have to shutdown itDo you have any other suggestion on how can I overcome this ?
I was wondering if isn't the current
OtlpAutoConfiguration.otlpHttpSpanExporter
factory method too intrusive as it always provide aSpanExporter
Bean even when the application has already defined its ownSpanExporter
? Can we change this to a simple@ConditionalOnMissingBean(SpanExporter.class)
?