-
Notifications
You must be signed in to change notification settings - Fork 848
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
SDK AutoConfigure not working when switching from logging to otlp exporter #6018
Comments
That should not be true. See the POM from Maybe something else is causing the dependency conflict? I know I've seen issues in the past with the gradle spring dependency management plugin overriding the version of OpenTelemetry specified by the user. See here that the 3.2.0 version of spring boot depends on version 1.31.0 of OpenTelemetry java, which is suspiciously the same version you're seeing resolved. |
Thanks for the prompt reply @jack-berg I've just tested various versions of spring 3 and it seems that in this case for a given artifact you never get 1.32.0 for the dependent ones. They even vary as you change from 3.0.0, 3.0.6, 3.0.13 etc...Not sure exactly why but I'll dig deeper to figure out. Thank you |
I've actually come across this before. I couldn't find a way to get gradle dependencies to respect the versions from the |
Interesting. I'm just wondering if this couldn't be related to the gradle plugin itself for that particular version of spring. I'll try using maven to verify and also give it a shot by downgrading the gradle version. I'll keep you posted. Thanks for all your help so far! |
Hey @jack-berg Just following up on this. Worth noting that 3 of them are still in alpha (
|
Hey @jack-berg 👋 @ptabasso2 reach me out about the issue and I start investigating it. Issue InvestigationSpring Boot uses a Gradle plugin to manage dependencies: the Dependency Management Plugin. I found two options to fix it:
dependencyManagement {
imports {
mavenBom 'io.opentelemetry:opentelemetry-bom:1.32.0'
}
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web");
implementation("io.opentelemetry:opentelemetry-api");
implementation("io.opentelemetry:opentelemetry-sdk");
implementation("io.opentelemetry:opentelemetry-sdk-metrics");
implementation("io.opentelemetry:opentelemetry-exporter-logging");
implementation("io.opentelemetry.semconv:opentelemetry-semconv:1.23.1-alpha")
implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure");
implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi");
} Using this configuration will properly include the expected OTel dependencies at compile and runtime. Note I think we can rename the issue to point that it is a Spring+Gradle specific issue. It will help other developers to find the workaround. About the documentation pageAs Spring is a popular framework, I think this detail should be mentioned in the documentation page to avoid future (hard-to-diagnosticate) issues. And by the way, there is an error in the manual instrumentation page where is shows to import semconv 1.32.0-alpha which is absent from Maven Central (1.30.1-alpha at best). implementation("io.opentelemetry:opentelemetry-semconv:1.32.0-alpha"); Would you like me to have a PR about those two points? |
the semconv doc needs to be updated to pointed to the new semconv artifact from the new semantic conventions repo, FYI:
|
linking to related open-telemetry/opentelemetry.io#3613 and yes, doc help is always appreciated! |
I may be facing a similar issue with a maven build. Since 1.22 I can only have one exporter dependency added in a build. Ie. if my
and I use
If I switch the dependencies around, adding logging before otlp I get:
|
Can you check that the versions of all your dependencies are aligned and if so, post a small reproduction app? The behavior you're reporting is not expected, and I believe there are unit tests which confirm that. |
I believe they were but now I've yanked out the manual instrumentation code and switched to using the agent instead. Less detailed than what I had before but seems to behave with both exporter types. |
Describe the bug
Hitting an issue when using the SDK AutoConfigure with the otlp exporter.
This has been observed when following the getting started guide instructions
(Getting started - Manual instrumentation)
Steps to reproduce
What works:
Using the logging exporter works well, the application starts and prints the expected output.
What does not work:
Using the otlp exporter makes the application failing during bootstrap with the exception below:
What did you expect to see?
I would have expected to see the spring boot app starting and sending traces to the otel collector when issuing a curl command against the controller endpoint
What did you see instead?
The app crashes during startup with the following exception:
What version and what artifacts are you using?
Environment
Compiler + runtime
Build tool:
Additional context
It seems that the issue is tied to the
opentelemetry-exporter-otlp-1.32.0.jar
artifact that addsopentelemetry-exporter-common-1.31.0.jar
(transitive dependency) instead of version 1.32.0.The
OtlpGrpcSpanExporterBuilder
class which is provided by theopentelemetry-exporter-otlp-1.32.0.jar
jar invokes thesetMeterProvider()
method and expects a supplier as an argument.The 1.32.0
GrpcExporterBuilder
class implementation exposes thesetMeterProvider
with the right signature (Supplier provided)But the 1.31.0
GrpcExporterBuilder
class implementation provides a simpleMeterProvider
type instead of a supplier which causes the issueThe text was updated successfully, but these errors were encountered: