Class MetricsApplicationEventListener
java.lang.Object
org.glassfish.jersey.micrometer.server.MetricsApplicationEventListener
- All Implemented Interfaces:
ApplicationEventListener
The Micrometer
ApplicationEventListener
which registers
RequestEventListener
for instrumenting Jersey server requests.- Since:
- 2.41
- Author:
- Michael Weirauch
-
Constructor Summary
ConstructorsConstructorDescriptionMetricsApplicationEventListener
(io.micrometer.core.instrument.MeterRegistry registry, JerseyTagsProvider tagsProvider, String metricName, boolean autoTimeRequests) MetricsApplicationEventListener
(io.micrometer.core.instrument.MeterRegistry registry, JerseyTagsProvider tagsProvider, String metricName, boolean autoTimeRequests, AnnotationFinder annotationFinder) -
Method Summary
Modifier and TypeMethodDescriptionvoid
onEvent
(ApplicationEvent event) Process the applicationevent
.onRequest
(RequestEvent requestEvent) Process a new request and return arequest event listener
if listening torequest events
is required.
-
Constructor Details
-
MetricsApplicationEventListener
public MetricsApplicationEventListener(io.micrometer.core.instrument.MeterRegistry registry, JerseyTagsProvider tagsProvider, String metricName, boolean autoTimeRequests) -
MetricsApplicationEventListener
public MetricsApplicationEventListener(io.micrometer.core.instrument.MeterRegistry registry, JerseyTagsProvider tagsProvider, String metricName, boolean autoTimeRequests, AnnotationFinder annotationFinder)
-
-
Method Details
-
onEvent
Description copied from interface:ApplicationEventListener
Process the applicationevent
. This method is called when new event occurs.- Specified by:
onEvent
in interfaceApplicationEventListener
- Parameters:
event
- Application event.
-
onRequest
Description copied from interface:ApplicationEventListener
Process a new request and return arequest event listener
if listening torequest events
is required. The method is called once for each new incoming request. If listening to the request is required then request event must be returned from the method. Such a request event listener will receive all request events that one request. If listening to request event for the request is not required thennull
must be returned from the method (do not return empty mock listener in these cases as it will have negative performance impact).- Specified by:
onRequest
in interfaceApplicationEventListener
- Parameters:
requestEvent
- Event of typeRequestEvent.Type.START
.- Returns:
- Request event listener that will monitor the events of the request
connected with
requestEvent
; null otherwise.
-