SpringBootVersion: 3.0.6
I was hoping to configure MetricExporter in default SpanProcessor provided in OpenTelemetryAutoConfiguration
OpenTelemetry code: https://github.com/open-telemetry/opentelemetry-java/blob/0bad3c982ad05f54461e241f8a402536c6f9d4b9/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessor.java#L187-L219
Current workaround:
Create @Primary SpanProcessor bean and redeclare SdkTracerProvider (using custom SpanProcessor bean). One downside is that 2 SpanProcessor beans are created with dandling default one.
If possible I would like to have a simple way to overwrite SpanProcessor bean
In PR discussion: https://github.com/spring-projects/spring-boot/pull/35558
Comment From: mhalbritter
Just to clarify: You mean MeterProvider instead of MetricExporter, right? The code you linked only deals with MeterProvider. And judging from your comments in the PR, it has to be MeterProvider.
Comment From: mhalbritter
I implemented two changes:
- There's now a
SpanProcessorsbean, which collects all availableSpanProcessorbeans. If you want full control over the span processors, provide your ownSpanProcessorsbean. - If a
MeterProviderbean is found, it's automatically registered on the defaultSpanProcessor.
Comment From: mmeller-wikia
That's all I need :) Thank you!
Comment From: mhalbritter
Thanks for the feedback and glad that this solves your problem!