Class WebMvcMetricsFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter
- All Implemented Interfaces:
Filter
,Aware
,BeanNameAware
,DisposableBean
,InitializingBean
,EnvironmentAware
,EnvironmentCapable
,ServletContextAware
Intercepts incoming HTTP requests handled by Spring MVC handlers and records metrics
about execution time and results.
- Since:
- 2.0.0
- Author:
- Jon Schneider, Phillip Webb, Chanhyeong LEE
-
Field Summary
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
-
Constructor Summary
ConstructorDescriptionWebMvcMetricsFilter
(io.micrometer.core.instrument.MeterRegistry registry, WebMvcTagsProvider tagsProvider, String metricName, AutoTimer autoTimer) Create a newWebMvcMetricsFilter
instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doFilterInternal
(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) protected boolean
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterErrorDispatch
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
WebMvcMetricsFilter
public WebMvcMetricsFilter(io.micrometer.core.instrument.MeterRegistry registry, WebMvcTagsProvider tagsProvider, String metricName, AutoTimer autoTimer) Create a newWebMvcMetricsFilter
instance.- Parameters:
registry
- the meter registrytagsProvider
- the tags providermetricName
- the metric nameautoTimer
- the auto-timers to apply ornull
to disable auto-timing- Since:
- 2.2.0
-
-
Method Details
-
shouldNotFilterAsyncDispatch
protected boolean shouldNotFilterAsyncDispatch()- Overrides:
shouldNotFilterAsyncDispatch
in classOncePerRequestFilter
-
doFilterInternal
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException - Specified by:
doFilterInternal
in classOncePerRequestFilter
- Throws:
ServletException
IOException
-