Skip to content

Commit c771cbe

Browse files
committed
review changes
1 parent 0d27f8b commit c771cbe

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

sentry-spring-jakarta/src/main/java/io/sentry/spring/jakarta/tracing/CombinedTransactionNameProvider.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@
88
import org.jetbrains.annotations.Nullable;
99

1010
/**
11-
* Resolves transaction name using {@link HttpServletRequest#getMethod()} and templated route that
12-
* handled the request. To return correct transaction name, it must be used after request is
13-
* processed by {@link org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping}
14-
* where {@link org.springframework.web.servlet.HandlerMapping#BEST_MATCHING_PATTERN_ATTRIBUTE} is
15-
* set.
11+
* Resolves transaction name using other transaction name providers by invoking them in order.
12+
* If a provider returns no transaction name, the next one is invoked.
1613
*/
1714
@ApiStatus.Internal
1815
public final class CombinedTransactionNameProvider implements TransactionNameProvider {

sentry-spring/src/main/java/io/sentry/spring/tracing/CombinedTransactionNameProvider.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@
88
import org.jetbrains.annotations.Nullable;
99

1010
/**
11-
* Resolves transaction name using {@link HttpServletRequest#getMethod()} and templated route that
12-
* handled the request. To return correct transaction name, it must be used after request is
13-
* processed by {@link org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping}
14-
* where {@link org.springframework.web.servlet.HandlerMapping#BEST_MATCHING_PATTERN_ATTRIBUTE} is
15-
* set.
11+
* Resolves transaction name using other transaction name providers by invoking them in order.
12+
* If a provider returns no transaction name, the next one is invoked.
1613
*/
1714
@ApiStatus.Internal
1815
public final class CombinedTransactionNameProvider implements TransactionNameProvider {
1916

2017
private final @NotNull List<TransactionNameProvider> providers;
21-
private @Nullable TransactionNameSource source = null;
2218

2319
public CombinedTransactionNameProvider(final @NotNull List<TransactionNameProvider> providers) {
2420
this.providers = providers;
@@ -29,7 +25,6 @@ public CombinedTransactionNameProvider(final @NotNull List<TransactionNameProvid
2925
for (TransactionNameProvider provider : providers) {
3026
String transactionName = provider.provideTransactionName(request);
3127
if (transactionName != null) {
32-
source = provider.provideTransactionSource();
3328
return transactionName;
3429
}
3530
}
@@ -40,8 +35,7 @@ public CombinedTransactionNameProvider(final @NotNull List<TransactionNameProvid
4035
@Override
4136
@ApiStatus.Internal
4237
public @NotNull TransactionNameSource provideTransactionSource() {
43-
final @Nullable TransactionNameSource tmpSource = source;
44-
return tmpSource == null ? TransactionNameSource.CUSTOM : tmpSource;
38+
return TransactionNameSource.CUSTOM;
4539
}
4640

4741
@ApiStatus.Internal

0 commit comments

Comments
 (0)