-
Notifications
You must be signed in to change notification settings - Fork 36
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
JAX-RS unmapped exception metric does not work #490
Comments
This depends on the used JAX-RS implementation because the JAX-RS spec does not specify behavior for it. See https://github.com/jakartaee/rest/blob/3.0.0/jaxrs-spec/src/main/asciidoc/chapters/filters_and_interceptors/_exceptions_filters_and_interceptors.adoc :
So if there is no entity, the filter does not have to be called. |
We use Resteasy and from my experience the JAX-RS filters are always called if the resource method is called. Resteasy has 'unhandled' exceptions which would increment this metric, but I couldn't figure out how to trigger it. Maybe some internal Resteasy error. There is no way we can reliably say that exception is unmapped. What we basically want here is if the request returned a 500 status code or not. So just check in the servlet filter the status code and increment this metric if its a 500. Then maybe we need to rename the metric because a mapped exception could return a 500 too. |
The assumption that the
ContainerResponseFilter
is not called if an unmapped exception occurs is simple not true.The text was updated successfully, but these errors were encountered: