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 ResponseMetered annotation for Jersey Resource (4.0-development) #1186



Copy link

@dennyac dennyac commented Sep 8, 2017

For Dropwizard services, we currently have metrics for response rates by HTTP status code (1xx, 2xx, 3xx, 4xx, 5xx) captured at Jetty . There have been use cases where it would be helpful to have it on a Jersey Resource method/class level. To achieve that, I've added @ResponseMetered annotation which will add meters for 1xx/2xx/3xx/4xx/5xx responses. I've reused the logic from com.codahale.metrics.jetty9.InstrumentedHandler to capture the metrics.

I hope you find this helpful and I'm open to suggestions/feedback. Thanks!

This is based of #1185 for the 4.0-development branch

public class InstrumentedResource {
    public Response responseMeteredEndpoint() {
        return Response.ok().build();
Copy link
Contributor Author

@dennyac dennyac commented Sep 8, 2017

Hi @arteam @jplock , just created the ResponseMetered annotation for 4.0-development.

@dennyac dennyac changed the title Add ResponseMetered annotation for 4.0-development Add ResponseMetered annotation for Jersey Resource (4.0-development) Sep 8, 2017
@arteam arteam merged commit bfc8a8a into dropwizard:4.0-development Sep 15, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
arteam added a commit that referenced this pull request Sep 15, 2017
Closes #1186
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants