-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Add auto-configuration for OTLP span exporter #34508
Conversation
.../java/org/springframework/boot/actuate/autoconfigure/tracing/otlp/OtlpAutoConfiguration.java
Outdated
Show resolved
Hide resolved
.../java/org/springframework/boot/actuate/autoconfigure/tracing/otlp/OtlpAutoConfiguration.java
Outdated
Show resolved
Hide resolved
I put this back to draft since support for (auth) headers should be also added. |
* @author Jonatan Ivanov | ||
* @since 3.1.0 | ||
*/ | ||
@ConfigurationProperties("management.otlp.tracing") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jonatan-ivanov , I see that spring is diverging from the configuration properties proposed by the otel-sdk. For instance, the properties managed by this class maps to otel-sdk "otel.exporter.otlp.endpoint", "otel.exporter.otlp.compression" and so on...
Are there any plans to converge the config property names to the same used by otel-sdk ?
If no, isnt there another way to make them at least seem easier to map. E.g, spring version would only add the management.otlp prefix ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the rationale behind the current structure: #30381 This PR follows that pattern.
There are at least two tricky things here:
- There are at least two components that can export OTLP right now in Boot, the Micrometer Tracing OTel bridge (in this PR) and Micrometer's OTLP Meter Registry. I think users need to be able to configure them separately and
otel.exporter.otlp.endpoint
does not really make that distinction. - Under the hood, shipping OTLP does not need to use the OTel SDK at all, e.g.: Micrometer's OTLP registry does not use it, if for example Brave will add OTLP support, I guess that won't either. Check out the Zipkin properties and auto-configuration. Boot does not use OTel properties there and it needs to auto-configure either OTel or Brave based on those properties.
I think right now this is the easiest thing you can do to set these:
otel.exporter.otlp.xyz=...
management.otlp.metrics.export.xyz=${otel.exporter.otlp.xyz}
management.otlp.tracing.xyz=${otel.exporter.otlp.xyz} // maybe I should add export here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should figure out what would be the best and your feedback is apprechiated, right now this is what we have:
OtlpProperties
for metrics- has a different prefix:
management.otlp.metrics.export
(this PR hasmanagement.otlp.tracing
) - has a different property
url
(this PR calls itendpoint
)
- has a different prefix:
ZipkinProperties
for tracing (Brave/OTel)- has similar prefix:
management.zipkin.tracing
(this PR follows that convention)
- has similar prefix:
- OTel SDK Properties
- has the prefix:
otel.exporter.otlp
- has similar properties
- has the prefix:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There are at least two components that can export OTLP right now in Boot, the Micrometer Tracing OTel bridge (in this PR) and Micrometer's OTLP Meter Registry. I think users need to be able to configure them separately and
otel.exporter.otlp.endpoint
does not really make that distinction.
Fair enough, makes sense as users could possibly use 2 different otel-compatible backends: one for metrics and other for tracing
management.otlp.metrics.export.xyz=${otel.exporter.otlp.xyz}
Im doing the opposite: trying to support the SDK props as they are more widely known, so end-users would be able to configure it based on SDK docs, but it is really hard to map all the spring props to the sdk props. If it was just a matter of prefixes, life would be easier. But I understand the complexity and the other scenarios that you mention. There's even a more complex one such as management.tracing.sampling.probability=${otel.traces.sampler.arg}
- the otel.traces.sampler.arg
(urgh!) is a beast on its own as it includes inner properties on it depending on the sampler implementation. Perhaps somewhere in the docs we could have a section mapping the spring->otel-sdk properties.
has a different prefix:
management.otlp.metrics.export
(this PR hasmanagement.otlp.tracing
)has a different property
url
(this PR calls itendpoint
)
I personally like management.otlp.tracing.export.http.endpoint
more.
I also liked that you exposed all the OtlpHttpSpanExporterBuilder configurations, different from the OpenTelemetryAutoConfiguration.otelSpanProcessor
which is using the BatchSpanProcessor internally and not offering the possibility to configure its propertyes such as batch/queue size, timeouts and so on...
@jonatan-ivanov Really looking forward to this feature being made available, as it is really the last thing that is preventing us from migrating to Spring Boot 3.x. Can you tell me which release you're aiming for? Cheers |
@AndersClausen See Andy setting the milestone on this PR (formerly, the connected issue had the same milestone). |
.../java/org/springframework/boot/actuate/autoconfigure/tracing/otlp/OtlpAutoConfiguration.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/springframework/boot/actuate/autoconfigure/tracing/otlp/OtlpProperties.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/springframework/boot/actuate/autoconfigure/tracing/otlp/OtlpProperties.java
Outdated
Show resolved
Hide resolved
With these changes an OTLP HTTP/protobuf exporter is auto-configured if opentelemetry-exporter-otlp is on the classpath. See spring-projectsgh-34508
With these changes an OTLP HTTP/protobuf exporter is auto-configured if opentelemetry-exporter-otlp is on the classpath. See gh-34508
Hi @jonatan-ivanov , we are facing some issues integrating this into our project. The scenario is the following:
Some possible solutions to my problem that I tried:
Do you have any other suggestion on how can I overcome this ? I was wondering if isn't the current |
@chicobento I created a separate issue to discuss this, could you please check my answer there and reply to my questions? #35596 |
With these changes an OTLP HTTP/protobuf exporter is auto-configured if
opentelemetry-exporter-otlp
is on the classpath.Closes gh-34390