-
-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathTransactionNameProvider.java
More file actions
38 lines (34 loc) · 1.18 KB
/
TransactionNameProvider.java
File metadata and controls
38 lines (34 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package io.sentry.spring.jakarta.tracing;
import io.sentry.protocol.TransactionNameSource;
import jakarta.servlet.http.HttpServletRequest;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Resolves transaction name from {@link HttpServletRequest}.
*
* <p>With Spring MVC - use {@link SpringMvcTransactionNameProvider}.
*/
public interface TransactionNameProvider {
/**
* Resolves transaction name from {@link HttpServletRequest}.
*
* @param request - the http request
* @return transaction name or {@code null} if not resolved
*/
@Nullable
String provideTransactionName(@NotNull HttpServletRequest request);
/** Returns the source of the transaction name. Only to be used internally. */
@NotNull
@ApiStatus.Internal
default TransactionNameSource provideTransactionSource() {
return TransactionNameSource.CUSTOM;
}
@NotNull
@ApiStatus.Internal
default TransactionNameWithSource provideTransactionNameAndSource(
final @NotNull HttpServletRequest request) {
return new TransactionNameWithSource(
provideTransactionName(request), provideTransactionSource());
}
}