Package io.sentry.spring.tracing
Class SpringMvcTransactionNameProvider
java.lang.Object
io.sentry.spring.tracing.SpringMvcTransactionNameProvider
- All Implemented Interfaces:
TransactionNameProvider
@Internal
public final class SpringMvcTransactionNameProvider
extends Object
implements TransactionNameProvider
Resolves transaction name using
HttpServletRequest.getMethod() and templated route that
handled the request. To return correct transaction name, it must be used after request is
processed by RequestMappingInfoHandlerMapping
where HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE is set.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable StringprovideTransactionName(@NotNull javax.servlet.http.HttpServletRequest request) Resolves transaction name fromHttpServletRequest.@NotNull io.sentry.protocol.TransactionNameSourceReturns the source of the transaction name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.sentry.spring.tracing.TransactionNameProvider
provideTransactionNameAndSource
-
Constructor Details
-
SpringMvcTransactionNameProvider
public SpringMvcTransactionNameProvider()
-
-
Method Details
-
provideTransactionName
@Nullable public @Nullable String provideTransactionName(@NotNull @NotNull javax.servlet.http.HttpServletRequest request) Description copied from interface:TransactionNameProviderResolves transaction name fromHttpServletRequest.- Specified by:
provideTransactionNamein interfaceTransactionNameProvider- Parameters:
request- - the http request- Returns:
- transaction name or
nullif not resolved
-
provideTransactionSource
@Internal @NotNull public @NotNull io.sentry.protocol.TransactionNameSource provideTransactionSource()Description copied from interface:TransactionNameProviderReturns the source of the transaction name. Only to be used internally.- Specified by:
provideTransactionSourcein interfaceTransactionNameProvider
-