Provide an Interceptor API to wrap around execution of Resource method
- Dominant language
- Java
- Stars
- 400
- Forks
- 143
- PR merge metrics
- No merged PRs in 30d
Description
It is desirable to automatically measure certain metrics (e.g resource method execution time) in a JAX-RS container operational environment - It is currently possible to do that for MBRs and MBWs and other providers, but there is no interceptor control point for resource method invocation. It will be good to add this interceptor API to the spec.
Here is some context from the email thread
On Dec 20, 2011, at 10:22 PM, Sastry Malladi wrote:
>
> >> Yes, it would require adding annotations. Without any use of an API, I'm not sure this case belongs to the spec. I think this should better be handled by implementations or other tools (like profilers).
>
> Well, I understand your position that this may not be addressed in the spec. But in reality, any organization that uses JAX-RS to deploy their services/resources, would want to monitor and measure these metrics automatically, especially in the internet world, and would need a way to do that. For example, we are doing this currently by writing a jersey response filter and approximating by subtracting MBR and MBW times and so on. I beg to differ that this is not a profiler/tooling issue
I think it's a valid use case, there's no question about that. IMO the best way to address this is via a monitoring/listener API (which some implementations support). This API could work not just around resource method invocations but also all the providers --I don't see a good reason to only support resource methods.
However, such an API is currently not in scope for JAX-RS 2.0\. If you haven't done so, file it as an issue for tracking purposes.
– Santiago
#### Affected Versions
[1.1]
Contributor guide
Assessment
This issue has not been assessed yet.