Package io.micrometer.spring.web.servlet
Class WebMvcTags
- java.lang.Object
-
- io.micrometer.spring.web.servlet.WebMvcTags
-
@NonNullApi public final class WebMvcTags extends java.lang.ObjectFactory methods forTagsassociated with a request-response exchange that is instrumented byWebMvcMetricsFilter.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.micrometer.core.instrument.Tagexception(java.lang.Throwable exception)Creates aexceptiontag based on thesimple nameof the class of the givenexception.static io.micrometer.core.instrument.Tagmethod(javax.servlet.http.HttpServletRequest request)Creates amethodtag based on themethodof the givenrequest.static io.micrometer.core.instrument.Tagoutcome(javax.servlet.http.HttpServletResponse response)Creates anoutcometag based on the status of the givenresponse.static io.micrometer.core.instrument.Tagstatus(javax.servlet.http.HttpServletResponse response)Creates amethodtag based on the status of the givenresponse.static io.micrometer.core.instrument.Taguri(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Creates auritag based on the URI of the givenrequest.
-
-
-
Method Detail
-
method
public static io.micrometer.core.instrument.Tag method(@Nullable javax.servlet.http.HttpServletRequest request)Creates amethodtag based on themethodof the givenrequest.- Parameters:
request- the request- Returns:
- the method tag whose value is a capitalized method (e.g. GET).
-
status
public static io.micrometer.core.instrument.Tag status(@Nullable javax.servlet.http.HttpServletResponse response)Creates amethodtag based on the status of the givenresponse.- Parameters:
response- the HTTP response- Returns:
- the status tag derived from the status of the response
-
uri
public static io.micrometer.core.instrument.Tag uri(@Nullable javax.servlet.http.HttpServletRequest request, @Nullable javax.servlet.http.HttpServletResponse response)Creates auritag based on the URI of the givenrequest. Uses theHandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTEbest matching pattern if available. Falling back toREDIRECTIONfor 3xx responses,NOT_FOUNDfor 404 responses,rootfor requests with no path info, andUNKNOWNfor all other requests.- Parameters:
request- the requestresponse- the response- Returns:
- the uri tag derived from the request
-
exception
public static io.micrometer.core.instrument.Tag exception(@Nullable java.lang.Throwable exception)Creates aexceptiontag based on thesimple nameof the class of the givenexception.- Parameters:
exception- the exception, may benull- Returns:
- the exception tag derived from the exception
-
outcome
public static io.micrometer.core.instrument.Tag outcome(@Nullable javax.servlet.http.HttpServletResponse response)Creates anoutcometag based on the status of the givenresponse.- Parameters:
response- the HTTP response- Returns:
- the outcome tag derived from the status of the response
- Since:
- 1.1.0
-
-