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

More accurate metrics for 404 responses from Jersey #2587

Merged
merged 1 commit into from
Oct 14, 2021
Merged

More accurate metrics for 404 responses from Jersey #2587

merged 1 commit into from
Oct 14, 2021

Conversation

bentmann
Copy link
Contributor

I'm aware of the issue of tag explosion that motivates the mapping of 404 responses to a single URI such as "not_found". However, there are two distinct cases where the JAX-RS response can be 404:

  • no REST resource could be matched to the incoming request
  • a REST resource was matched to the request and the application code (via exception mapping or otherwise) created a response with 404 as status

I argue only the first case applies to the tag explosion concern. The second case however is not different than matched resources yielding HTTP 400.

With the proposed change, the HTTP 404 responses emitted by Jersey apps can be more appropriately attributed to the originating resource.

…of the matched resource and only use the "not_found" value if no resource was matched
@pivotal-issuemaster
Copy link

@bentmann Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@bentmann Thank you for signing the Contributor License Agreement!

@shakuzen shakuzen added the enhancement A general enhancement label May 12, 2021
@shakuzen shakuzen added this to the 1.8 backlog milestone May 12, 2021
@shakuzen shakuzen added the module: micrometer-jersey An issue that is related to our jersey module label Oct 14, 2021
@shakuzen shakuzen modified the milestones: 1.8 tentative, 1.8.0-RC1 Oct 14, 2021
Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for bringing this to our attention and the pull request. Looks good to me. I will port this over to the jersey code's new home in micrometer-core post-merge.

@shakuzen shakuzen merged commit 01b23a9 into micrometer-metrics:main Oct 14, 2021
@shakuzen shakuzen changed the title More accurate metrics for 404 responses from Jersey2 More accurate metrics for 404 responses from Jersey Oct 14, 2021
@bentmann bentmann deleted the jersey-404 branch October 14, 2021 16:08
shakuzen added a commit that referenced this pull request Oct 14, 2021
The enhancement was made against the now deprecated micrometer-jersey2 module. This ports the changes and test over to the duplicated code in micrometer-core.

See gh-2587
@shakuzen
Copy link
Member

Ported to micrometer-core in def88d1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A general enhancement module: micrometer-core An issue that is related to our core module module: micrometer-jersey An issue that is related to our jersey module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants