-
Notifications
You must be signed in to change notification settings - Fork 995
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
Add missing metrics for Jersey in cases of client errors #4326
Add missing metrics for Jersey in cases of client errors #4326
Conversation
@adpaste Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@adpaste Thank you for signing the Contributor License Agreement! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reporting the issue and providing a fix along with a test. Could you take a look at the one comment I had and rebase the pull request on 1.9.x
so we can accept it as a bug fix? Also, note that the Jersey instrumentation was added to a jersey-micrometer module in the Jersey repo (see eclipse-ee4j/jersey#5391). We plan to deprecate the code in the Micrometer repo in favor of that (see #4100). So please send a pull request over there too if you have the time and consider migrating to using that over what will be deprecated here.
Thanks again!
...java/io/micrometer/core/instrument/binder/jersey/server/MetricsRequestEventListenerTest.java
Outdated
Show resolved
Hide resolved
20ac7d6
to
c4ed2dd
Compare
Thanks for the feedback. I replied to the comment, and rebased the PR to |
66bffd1
to
5cdf589
Compare
It looks like this broke tests in the |
This applies the changes from gh-4326 that were made to JerseyTags to JerseyKeyValues.
I was able to fix it by applying similar changes to JerseyKeyValues (which is a copy of JerseyTags for Observation-based instrumentation). See 66c1d47 |
Changes ported from micrometer-metrics/micrometer#4326
Changes ported from micrometer-metrics/micrometer#4326
Changes ported from micrometer-metrics: micrometer-metrics/micrometer#4326
Changes ported from micrometer-metrics: micrometer-metrics/micrometer#4326
We are using Jersey integration and we have noticed that some 40x errors (such as
406 Not Acceptable
or415 Unsupported Media Type
) are not reported in the metrics.After some debugging, we found out that the root cause of this issue is that only one kind of client exception (
NotFoundException
) is taken into account during metric collection.This pull request should fix the problem, by taking into account all types of
ClientErrorExceptions
.