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

Add configurable response code meters #6692

Merged

Conversation

dennyac
Copy link
Contributor

@dennyac dennyac commented Feb 14, 2023

Problem:

Currently we only have top level 1xx/2xx/3xx/4xx/5xx meters at the jetty level. We have many use cases where we care about specific response codes like 401/503 and resort to manually instrumenting responses from every resource. This PR allows users to configure what response code meters to include.

Solution:

With the new release of metrics (since 4.2.16), we can specify what response code meters to include. Exposed the same via AbstractServerFactory. Additionally allowed specifying the metricPrefix to include for jetty metrics

Result:

To maintain backward compatibility the default behavior remains the same with this change. Users will have to explicitly specify the DETAILED/ALL responseMeteredLevel if they want more response code meters.

@dennyac dennyac requested a review from a team as a code owner February 14, 2023 01:57
@gitpod-io
Copy link

gitpod-io bot commented Feb 14, 2023

@dennyac
Copy link
Contributor Author

dennyac commented Feb 14, 2023

FYI - @joschi

Hoping this approach is acceptable and can be included in the upcoming release 🙂

@joschi joschi force-pushed the Add-configurable-response-code-meters branch from fef41ed to 2a72b7c Compare February 22, 2023 22:38
Copy link
Member

@joschi joschi left a comment

Choose a reason for hiding this comment

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

@dennyac Thanks for your contribution in Dropwizard Metrics and here!

@joschi joschi self-assigned this Feb 22, 2023
@joschi joschi added the feature label Feb 22, 2023
@joschi joschi added this to the 2.1.5 milestone Feb 22, 2023
@joschi joschi enabled auto-merge (squash) February 22, 2023 22:41
@joschi joschi disabled auto-merge February 22, 2023 22:51
@joschi joschi merged commit d45aa5d into dropwizard:release/2.1.x Feb 22, 2023
@dennyac
Copy link
Contributor Author

dennyac commented Feb 22, 2023

@joschi - Thanks for the review and accepting the changes. Should we be concerned about this - dropwizard/metrics#3179 (Fix potential NPE in InstrumentedResourceMethodApplicationListener)

@dennyac
Copy link
Contributor Author

dennyac commented Feb 23, 2023

This PR specifically that bumps the metric version to 4.2.16 which contains the bug - #6693

Wanted your thoughts on releasing a new version of the metrics library which should include the fix.

@joschi
Copy link
Member

joschi commented Feb 23, 2023

@dennyac We'll wait with a release of Dropwizard 2.1.5 until Dropwizard Metrics has been bumped to https://github.com/dropwizard/metrics/releases/tag/v4.2.17.

@dennyac
Copy link
Contributor Author

dennyac commented Feb 23, 2023

Sounds good. Thanks. Was just checking.

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

Successfully merging this pull request may close these issues.

None yet

2 participants