Package io.sentry.spring.jakarta.tracing
Class SentryTracingFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
io.sentry.spring.jakarta.tracing.SentryTracingFilter
- All Implemented Interfaces:
javax.servlet.Filter
,Aware
,BeanNameAware
,DisposableBean
,InitializingBean
,EnvironmentAware
,EnvironmentCapable
,ServletContextAware
Creates
ITransaction
around HTTP request executions if performance is enabled. Otherwise
just reads tracing information from incoming request.-
Field Summary
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
-
Constructor Summary
ConstructorDescriptionCreates filter that resolves transaction name usingSpringMvcTransactionNameProvider
.SentryTracingFilter
(@NotNull IHub hub) SentryTracingFilter
(@NotNull IHub hub, @NotNull TransactionNameProvider transactionNameProvider) Creates filter that resolves transaction name using transaction name provider given by parameter. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doFilterInternal
(@NotNull jakarta.servlet.http.HttpServletRequest httpRequest, @NotNull jakarta.servlet.http.HttpServletResponse httpResponse, @NotNull jakarta.servlet.FilterChain filterChain) Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterInternal, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, 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
-
SentryTracingFilter
public SentryTracingFilter()Creates filter that resolves transaction name usingSpringMvcTransactionNameProvider
.Only requests that have
HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE
request attribute set are turned into transactions. This attribute is set inRequestMappingInfoHandlerMapping
on request that have not been dropped with anyFilter
. -
SentryTracingFilter
public SentryTracingFilter(@NotNull @NotNull IHub hub, @NotNull @NotNull TransactionNameProvider transactionNameProvider) Creates filter that resolves transaction name using transaction name provider given by parameter.- Parameters:
hub
- - the hubtransactionNameProvider
- - transaction name provider.
-
SentryTracingFilter
-
-
Method Details
-
doFilterInternal
protected void doFilterInternal(@NotNull @NotNull jakarta.servlet.http.HttpServletRequest httpRequest, @NotNull @NotNull jakarta.servlet.http.HttpServletResponse httpResponse, @NotNull @NotNull jakarta.servlet.FilterChain filterChain) throws jakarta.servlet.ServletException, IOException - Throws:
jakarta.servlet.ServletException
IOException
-