-
Notifications
You must be signed in to change notification settings - Fork 40.7k
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
Http server metrics counts twice for Jersey endpoints #29303
Comments
Here's a Java version of the sample: https://github.com/philwebb/scratch-gh-29303 |
@Declow0 What version are you upgrading from? I tried 2.5 and I think I get the same result. Do you need to mix Spring MVC and Jersey in your application? |
I upgraded from 2.3 to 2.6. Yes, I mix REST Controllers and Jersey endpoints (from Camunda project). At 2.3 I don't have Jersey metrics autoconfiguration and all Jersey call has uri tag = |
I'd like to discuss this one with the rest of the team to see if they have any ideas. I wonder if we might be able to tighten |
See also #13064 |
We're going to look at adding a property that will allow |
We should also check what happens if Jersey's configured as a filter and with FILTER_FORWARD_ON_404. There's a chance that this will result in duplicate metrics as the request will have passed through Jersey and MVC's |
Also facing same problem URI tag remain either UNKNOWN or /** instead actual endpoint urls? |
In the meantime, the observability support has been rewritten entirely and Jersey/MVC instrumentations are independent. Jersey apps should not depend on the web starter and as a result, the web layer will not be instrumented twice. Closing with #39294 (comment) |
hi i have exactly same issue but for all count not only http, but database call, webclient calls etc all are counted twice |
@cyril-telr in that case, it's not exactly the same issue. The problem that was tracked by this issue was specific to Jersey and how the web stack was instrumented. If you would like us to spend some time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can then share it with us by opening a new issue and pushing it to a separate repository on GitHub or by zipping it up and attaching it to the new issue. |
After upgrading to Spring Boot 2.6 with Micrometer 1.8.1 metric
"http_server_requests_seconds_count"
counts twice every jersey call with different uri tag:correct uri by
org.springframework.boot.actuate.autoconfigure.metrics.jersey.JerseyServerMetricsAutoConfiguration
UNKNOWN
byorg.springframework.boot.actuate.autoconfigure.metrics.web.servlet.WebMvcMetricsAutoConfiguration
in that order (by filter priority)
Simple project for problem demonstration https://github.com/Declow0/jersey-metrics
Can
WebMvcMetricsFilter
ignore request for counting if Jersey implemetation was already counted?The text was updated successfully, but these errors were encountered: