Class DefaultWebMvcTagsProvider
java.lang.Object
org.springframework.boot.actuate.metrics.web.servlet.DefaultWebMvcTagsProvider
- All Implemented Interfaces:
WebMvcTagsProvider
Default implementation of
WebMvcTagsProvider
.- Since:
- 2.0.0
- Author:
- Jon Schneider
-
Constructor Summary
ConstructorDescriptionDefaultWebMvcTagsProvider
(boolean ignoreTrailingSlash) DefaultWebMvcTagsProvider
(boolean ignoreTrailingSlash, List<WebMvcTagsContributor> contributors) Creates a newDefaultWebMvcTagsProvider
that will provide tags from the givencontributors
in addition to its own.DefaultWebMvcTagsProvider
(List<WebMvcTagsContributor> contributors) Creates a newDefaultWebMvcTagsProvider
that will provide tags from the givencontributors
in addition to its own. -
Method Summary
Modifier and TypeMethodDescriptionIterable<io.micrometer.core.instrument.Tag>
getLongRequestTags
(HttpServletRequest request, Object handler) Provides tags to be used bylong task timers
.Iterable<io.micrometer.core.instrument.Tag>
getTags
(HttpServletRequest request, HttpServletResponse response, Object handler, Throwable exception) Provides tags to be associated with metrics for the givenrequest
andresponse
exchange.
-
Constructor Details
-
DefaultWebMvcTagsProvider
public DefaultWebMvcTagsProvider() -
DefaultWebMvcTagsProvider
Creates a newDefaultWebMvcTagsProvider
that will provide tags from the givencontributors
in addition to its own.- Parameters:
contributors
- the contributors that will provide additional tags- Since:
- 2.3.0
-
DefaultWebMvcTagsProvider
public DefaultWebMvcTagsProvider(boolean ignoreTrailingSlash) -
DefaultWebMvcTagsProvider
public DefaultWebMvcTagsProvider(boolean ignoreTrailingSlash, List<WebMvcTagsContributor> contributors) Creates a newDefaultWebMvcTagsProvider
that will provide tags from the givencontributors
in addition to its own.- Parameters:
ignoreTrailingSlash
- whether trailing slashes should be ignored when determining theuri
tag.contributors
- the contributors that will provide additional tags- Since:
- 2.3.0
-
-
Method Details
-
getTags
public Iterable<io.micrometer.core.instrument.Tag> getTags(HttpServletRequest request, HttpServletResponse response, Object handler, Throwable exception) Description copied from interface:WebMvcTagsProvider
Provides tags to be associated with metrics for the givenrequest
andresponse
exchange.- Specified by:
getTags
in interfaceWebMvcTagsProvider
- Parameters:
request
- the requestresponse
- the responsehandler
- the handler for the request ornull
if the handler is unknownexception
- the current exception, if any- Returns:
- tags to associate with metrics for the request and response exchange
-
getLongRequestTags
public Iterable<io.micrometer.core.instrument.Tag> getLongRequestTags(HttpServletRequest request, Object handler) Description copied from interface:WebMvcTagsProvider
Provides tags to be used bylong task timers
.- Specified by:
getLongRequestTags
in interfaceWebMvcTagsProvider
- Parameters:
request
- the HTTP requesthandler
- the handler for the request ornull
if the handler is unknown- Returns:
- tags to associate with metrics recorded for the request
-