Skip to content
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

Use ObservationRequestEventListener in order to support traces when using Jersey #39633

Closed
carlos-silva24 opened this issue Feb 20, 2024 · 4 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@carlos-silva24
Copy link

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

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 20, 2024
@mhalbritter mhalbritter changed the title Spring-boot Autoconfiguration should use the new org.glassfish.jersey.micrometer.server.ObservationRequestEventListener in order to support traces instead of only metrics Use ObservationRequestEventListener in order to support traces when using Jersey Feb 20, 2024
@mhalbritter mhalbritter added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 20, 2024
@mhalbritter mhalbritter added this to the 3.3.x milestone Feb 20, 2024
@mhalbritter mhalbritter self-assigned this Feb 20, 2024
@mhalbritter mhalbritter modified the milestones: 3.3.x, 3.3.0-M2 Feb 20, 2024
@carlos-silva24
Copy link
Author

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?

image

And I still don't get any traces exported 😢

thanks

@carlos-silva24
Copy link
Author

carlos-silva24 commented Feb 23, 2024

I've managed to fix it by adding the following depedency: implementation 'org.glassfish.jersey.ext:jersey-micrometer'

is this the expected behavior?

@bclozel
Copy link
Member

bclozel commented Feb 23, 2024

@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.

@mhalbritter
Copy link
Contributor

Yeah, this is covered in the upgrade notes as well.

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

No branches or pull requests

4 participants