Filter for measuring JAX-RS metrics, together with
JaxRsMetricsServletFilter.
The reason for having two filters (one based on Servlet API, one on JAX-RS API)
is to overcome the limitation of JAX-RS specification in that it does not require
implementations to call a ContainerResponseFilter to finish exchanges that led
to an unmapped exception. That's why we can't use a ContainerResponseFilter to
'finish' the tracking of a REST call and update the corresponding metrics.
For that reason, we have
JaxRsMetricsServletFilter, which is a Servlet Filter,
to hook into the responses in this case.
To get all of this logic working on a target runtime server, it is necessary to register both the
JaxRsMetricsServletFilter and
JaxRsMetricsFilter to handle incoming requests.
JaxRsMetricsServletFilter must run first, but this will probably be the case always.