Closed pards closed 3 days ago
This issue is caused by using opentelemetry api jars from different versions. When you run mvn dependency:tree
you'll notice that you have io.opentelemetry:opentelemetry-api:jar:1.37.0:compile
and io.opentelemetry:opentelemetry-api-incubator:jar:1.39.0-alpha:runtime
. Try moving importing opentelemety boms before importing spring bom in the dependencyManagement
section. Otherwise the opentelemetry version set in spring bom will override what is set in the opentelemetry boms.
@pards Have you followed these instructions related to the dependency management?
@pards Have you followed these instructions related to the dependency management?
@jeanbisutti see the attached sample app. He has added opentelemetry boms to dependencyManagement
but what the instructions don't mentions is that the ordering of the boms matters. If you have another bom before opentelemetry boms that sets version for otel artifacts then that bom will win.
Re-ordering the imports so that opentelemetry-bom
and opentelemetry-instrumentation-bom-alpha
appear before spring-boot-dependencies
fixed the problem. Thank you
Describe the bug
opentelemetry-spring-boot-starter
throwsClassNotFoundException: io.opentelemetry.api.incubator.metrics.DoubleGauge
when importingspring-boot-dependencies
instead of setting the parent tospring-boot-starter-parent
This is a standard approach outlined in the Spring documentation.
Steps to reproduce
mvn org.springframework.boot:spring-boot-maven-plugin:run
Expected behavior
Program should run
Actual behavior
Javaagent or library instrumentation version
v1.39.0
Environment
JDK: 17 OS: Windows 10, and MacOS 13.6.4
Additional context
The attached project runs smoothly when using the spring boot parent (commented out in the pom.xml)