Makes requests emit metrics when they get rate limited.
There were 2 issues preventing this:
RateLimiterFilter ran outside the Jersey Servlet, which is before application events get sent
Changing it to run inside the servlet isn't enough. Aborted requests don't emit the RESOURCE_METHOD_START event.
This PR makes the rate limiting filter a Jersey Servlet filter and makes the per-request metric emitter emit count metrics for requests that have a REQUEST_MATCHED But not RESOURCE_METHOD_START event.
Type of change
[X] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
[X] See the test that verifies emitted metrics
Checklist:
Please delete options that are not relevant.
[X] I have performed a self-review of my code
[X] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[X] My changes generate no new warnings
[ ] If adding new functionality, I have discussed my implementation with the community using the linked GitHub issue
Description
Makes requests emit metrics when they get rate limited.
There were 2 issues preventing this:
This PR makes the rate limiting filter a Jersey Servlet filter and makes the per-request metric emitter emit count metrics for requests that have a REQUEST_MATCHED But not RESOURCE_METHOD_START event.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist:
Please delete options that are not relevant.