Fork me on GitHub

Instrumenting Jersey

The metrics-jersey module provides InstrumentedResourceMethodDispatchAdapter, which allows you to instrument methods on your Jersey resource classes:

public class ExampleResource {
    public String show() {
        return "yay";

The show method in the above example will have a timer attached to it, measuring the time spent in that method.

Use of the @Metered and @ExceptionMetered annotations is also supported.