Class MicrometerCountedInterceptor


  • @Interceptor
    @Priority(1010)
    public class MicrometerCountedInterceptor
    extends Object
    Quarkus declared interceptor responsible for intercepting all methods annotated with the Counted annotation to record a few counter metrics about their execution status.
    See Also:
    Counted
    • Constructor Detail

      • MicrometerCountedInterceptor

        public MicrometerCountedInterceptor​(io.micrometer.core.instrument.MeterRegistry meterRegistry)
    • Method Detail

      • countedMethod

        Object countedMethod​(io.quarkus.arc.ArcInvocationContext context)
                      throws Exception
        Intercept methods annotated with the Counted annotation and expose a few counters about their execution status. By default, record both failed and successful attempts. If the Counted.recordFailuresOnly() is set to true, then record only failed attempts. In case of a failure, tags the counter with the simple name of the thrown exception.

        When the annotated method returns a CompletionStage or any of its subclasses, the counters will be incremented only when the CompletionStage is completed. If completed exceptionally a failure is recorded, otherwise if Counted.recordFailuresOnly() is set to false, a success is recorded.

        Returns:
        Whatever the intercepted method returns.
        Throws:
        Throwable - When the intercepted method throws one.
        Exception