Skip to content

Provide more control over the OTel SpanProcessors #35560

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

Closed
Tracked by #35776
mmeller-wikia opened this issue May 18, 2023 · 4 comments
Closed
Tracked by #35776

Provide more control over the OTel SpanProcessors #35560

mmeller-wikia opened this issue May 18, 2023 · 4 comments
Assignees
Labels
theme: observability Issues related to observability type: enhancement A general enhancement
Milestone

Comments

@mmeller-wikia
Copy link

mmeller-wikia commented May 18, 2023

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: #35558

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 18, 2023
@wilkinsona wilkinsona added the theme: observability Issues related to observability label May 18, 2023
@philwebb philwebb changed the title OpenTelemetryAutoConfiguration: it's impossible to configure MetricExporter in default SpanProcessor OpenTelemetryAutoConfiguration: it's impossible to configure MetricExporter in default SpanProcessor May 26, 2023
@mhalbritter mhalbritter changed the title OpenTelemetryAutoConfiguration: it's impossible to configure MetricExporter in default SpanProcessor Impossible to override OTEL default SpanProcessor bean Jun 5, 2023
@mhalbritter mhalbritter changed the title Impossible to override OTEL default SpanProcessor bean OpenTelemetryAutoConfiguration: it's impossible to configure MetricExporter in default SpanProcessor Jun 5, 2023
@philwebb philwebb added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 7, 2023
@philwebb philwebb added this to the 3.2.x milestone Jun 7, 2023
@philwebb philwebb mentioned this issue Jun 7, 2023
31 tasks
@mhalbritter mhalbritter self-assigned this Jun 16, 2023
@mhalbritter
Copy link
Contributor

mhalbritter commented Jun 16, 2023

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.

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Jun 16, 2023
@mhalbritter mhalbritter changed the title OpenTelemetryAutoConfiguration: it's impossible to configure MetricExporter in default SpanProcessor OpenTelemetryAutoConfiguration: it's impossible to configure MeterProvider in default SpanProcessor Jun 16, 2023
@mhalbritter
Copy link
Contributor

I implemented two changes:

  • There's now a SpanProcessors bean, which collects all available SpanProcessor beans. If you want full control over the span processors, provide your own SpanProcessors bean.
  • If a MeterProvider bean is found, it's automatically registered on the default SpanProcessor.

@mhalbritter mhalbritter removed the status: waiting-for-feedback We need additional information before we can continue label Jun 16, 2023
@mhalbritter mhalbritter modified the milestones: 3.2.x, 3.2.0-M1 Jun 16, 2023
@wilkinsona wilkinsona changed the title OpenTelemetryAutoConfiguration: it's impossible to configure MeterProvider in default SpanProcessor Provide more control over the OTel SpanProcessors Jun 16, 2023
@mmeller-wikia
Copy link
Author

That's all I need :) Thank you!

@mhalbritter
Copy link
Contributor

Thanks for the feedback and glad that this solves your problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: observability Issues related to observability type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants