The problem
On my springboot 3.2.2 version using micrometer tracing and jersey I'm not able to report traces to my open telemetry collector. In order to be able to report traces I need to also add the spring-boot-starter-web dependency, which leads to the traces being reported with URI as unknown. I shouldn't need the spring-boot-starter-web to report traces in the first place I would guess.
To Reproduce
I've created a demo repo here and steps on how to reproduce it: https://github.com/carlos-silva24/springboot-observability
Expected behavior
I was expecting the URI to be defined correctly like it does if I switch to spring-boot-starter-web for my REST API instead of Jersey.
Additional context
- On my demo project it fails for tracing but works fine for prometheus metrics.
- On a discussion related to this (https://github.com/spring-projects/spring-boot/issues/39294#issuecomment-1952957693) it was found that the Spring Boot auto configuration should use the new org.glassfish.jersey.micrometer.server.ObservationRequestEventListener instead of the current instrumentation which only supports metrics
Comment From: carlos-silva24
Hey @mhalbritter I was doing some tests on the version 3.3.0-M2 and on the DEMO repo (https://github.com/carlos-silva24/springboot-observability) if I upgrade the springboot version to 3.3.0-M2 and remove the implementation 'org.springframework.boot:spring-boot-starter-web' dependency I don't even get the prometheus metrics right.
Before, on the 3.2.1 without that dependency prometheus metrics were fine, I just had no traces at all.
What changed? Or am I doing something wrong?
And I still don't get any traces exported 😢
thanks
Comment From: carlos-silva24
I've managed to fix it by adding the following depedency: implementation 'org.glassfish.jersey.ext:jersey-micrometer'
is this the expected behavior?
Comment From: bclozel
@carlos-silva24 yes, that was the purpose of this issue: switching to the new and official observation support in jersey itself. So you will need this dependency for this support to be activated.
Comment From: mhalbritter
Yeah, this is covered in the upgrade notes as well.