-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Templated requests with Jersey may cause an explosion of URI tag values #12447
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
Comments
This is an age-old problem that I (overly optimistically) hoped would be taken care of by the move to Micrometer. The meter's being registered by |
Thanks, the Bean provided in #5875 (comment) solves the issue, but yeah does not look so nice at all. |
@wilkinsona Note that we have complete Jersey 2 support in Micrometer with the We just need to clean up shunting the |
@mikksoone If your app is wholly Jersey 2 and not a mixture of Jersey and WebMVC, I think a sufficient workaround for now is to disable the webmvc filter with |
@jkschneider disabling |
The referenced PR auto-configures the Jersey2 instrumentation. What @mikksoone was experiencing, that it was not setup for Spring-Boot 2. In addition to that, by attracting For the instrumentation to kick in, it needs to be present on the classpath. ( Likely another issue: I am not familiar with the boot internals regarding such a mixed-web-env setup and also not about |
Can you please open a separate issue for this and, ideally, provide a small sample that reproduces the behaviour you have described?
Unlike Spring MVC and WebFlux, Jersey doesn't log any of its mappings. In 2.0.1 snapshots we've started logging a summary of the web-exposed endpoints irrespective of the web framework that's being used (see #12442). |
@wilkinsona I digged a little further regarding the mixed setup: When webmvc and Jersey both serve root ("/") - as happened here - the actuator endpoints are 404. Does this still qualify as a bug? (Just don't wan't to open new issues for known stuff.) As soon as I move Jerseys application-path, things start working again. Same behaviour with Spring-Boot 1.5. So no behavioral change for this unlucky constellation when |
No, I don't think it does. When you use Jersey and MVC side-by-side our expectation is that they'll be configured to co-exist, either by moving them to separate paths or by using a filter for Jersey and configuring it to allow the request to continue when it 404s. |
Thanks for the answer. Is there a slight chance the associated PR can make it into |
We spent some time discussing this today and came to a few conclusions: The current metrics filter contains a mix of general and MVC-specific logic. We'd like it to focus only on the general logic and then delegate to implementations of a strategy interface for getting information that's specific to a particular web stack (#13064). This change will have to wait for 2.1 and means that we won't accept #12482 in its current form and won't merge it into 2.0.x. We still need to do something in 2.0.x and we'll use this issue to do that. Our current plan is to remove the fallback to using the path info for the URI. |
I fail to see where the OPs issue is being fixed. No offense, but this issue has been downgraded from "missing auto-configured jersey2 instrumentation" to "tone down WebMVC MetricsFilter to fix metrics explosion by having it chunt unknown requests into common tag values". The current fix is a good one, If I may say so. Don't get me wrong. Meanwhile, there's two PRs addressing this issue. Knowingly one needs to take care of the WebMVC MetricsFilter to not interfere. (Either by turning it off or hooking the Jersey-Filter in front of it. At least the latter is what I do testwise in 1.5.) Again, no offense. I understand you have to deal with a plethora of issues and need to find a good path between getting stuff fixed and postponed or rejected. I assume #13064 is where the real work shall be done? Planned for which milestone? |
I should also point out that the OP is the lead of the Micrometer project and has given a 👍 reaction to our proposed course of action. |
I was referring to the "OP content" of referenced issue and the comments here and over which clarified the situation of what is missing (the jersey2 instrumentation setup) and what is causing what was seen (webmvc metrics filter producing metrics for jersey paths). All good! Thanks for your replies! |
See micrometer-metrics/micrometer#486 for a reproducible example.
The text was updated successfully, but these errors were encountered: