Package io.micrometer.jersey2.server
Class JerseyTags
java.lang.Object
io.micrometer.jersey2.server.JerseyTags
public final class JerseyTags
extends java.lang.Object
Factory methods for
Tags
associated with a request-response exchange that
is handled by Jersey 2.- Since:
- 1.1.0
-
Method Summary
Modifier and Type Method Description static io.micrometer.core.instrument.Tag
exception(org.glassfish.jersey.server.monitoring.RequestEvent event)
Creates aexception
tag based on thesimple name
of the class of the givenexception
.static io.micrometer.core.instrument.Tag
method(org.glassfish.jersey.server.ContainerRequest request)
Creates amethod
tag based on themethod
of the givenrequest
.static io.micrometer.core.instrument.Tag
outcome(org.glassfish.jersey.server.ContainerResponse response)
Creates anoutcome
tag based on the status of the givenresponse
.static io.micrometer.core.instrument.Tag
status(org.glassfish.jersey.server.ContainerResponse response)
Creates astatus
tag based on the status of the givenresponse
.static io.micrometer.core.instrument.Tag
uri(org.glassfish.jersey.server.monitoring.RequestEvent event)
Creates auri
tag based on the URI of the givenevent
.
-
Method Details
-
method
public static io.micrometer.core.instrument.Tag method(org.glassfish.jersey.server.ContainerRequest request)Creates amethod
tag based on themethod
of the givenrequest
.- Parameters:
request
- the container request- Returns:
- the method tag whose value is a capitalized method (e.g. GET).
-
status
public static io.micrometer.core.instrument.Tag status(org.glassfish.jersey.server.ContainerResponse response)Creates astatus
tag based on the status of the givenresponse
.- Parameters:
response
- the container response- Returns:
- the status tag derived from the status of the response
-
uri
public static io.micrometer.core.instrument.Tag uri(org.glassfish.jersey.server.monitoring.RequestEvent event)Creates auri
tag based on the URI of the givenevent
. Uses theExtendedUriInfo.getMatchedTemplates()
if available.REDIRECTION
for 3xx responses,NOT_FOUND
for 404 responses.- Parameters:
event
- the request event- Returns:
- the uri tag derived from the request event
-
exception
public static io.micrometer.core.instrument.Tag exception(org.glassfish.jersey.server.monitoring.RequestEvent event)Creates aexception
tag based on thesimple name
of the class of the givenexception
.- Parameters:
event
- the request event- Returns:
- the exception tag derived from the exception
-
outcome
public static io.micrometer.core.instrument.Tag outcome(org.glassfish.jersey.server.ContainerResponse response)Creates anoutcome
tag based on the status of the givenresponse
.- Parameters:
response
- the container response- Returns:
- the outcome tag derived from the status of the response
-