Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenTelemetryAutoConfiguration: allow to override SpanProcessor bean #35558

Closed
wants to merge 1 commit into from

Conversation

mmeller-wikia
Copy link

Allow to customize only SpanProcessor bean without the need to throw away all OpenTelemetryAutoConfiguration value.
This is the only one bean in this class which is not annotated with @ConditionalOnMissingBean.

@pivotal-cla
Copy link

@mmeller-wikia Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@mmeller-wikia Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 18, 2023
@wilkinsona
Copy link
Member

wilkinsona commented May 18, 2023

The lack of @ConditionalOnMissingBean is intentional. It was removed as part of #32480. The intention is to allow additional span processors to be defined while keeping the default span processor. I'm afraid we cannot make the proposed change as it would break anyone that currently relies upon it. Thanks anyway for the suggestion. If you would like us to consider ways in which we can make it easier to replace the default span processor without breaking those who are relying on the current behaviour, please open an issue explaining your use case.

@wilkinsona wilkinsona closed this May 18, 2023
@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels May 18, 2023
@mmeller-wikia
Copy link
Author

Thanks for clarification and quick response :)
I was hoping to use BatchSpanProcessorBuilder.setMeterProvider() to collect metrics from BatchSpanProcessor.Worker
See https://github.com/open-telemetry/opentelemetry-java/blob/0bad3c982ad05f54461e241f8a402536c6f9d4b9/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessor.java#L187-L219

I was able to do this by creating @Primary SpanProcessor bean and redeclaring SdkTracerProvider (using only one SpanProcessor). One downside is that 2 SpanProcessor beans are created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants