Skip to content

Commit ea52d2d

Browse files
authored
Make spring-webflux instrumentation compatible with 7.0.0 (#10110)
1 parent 2229c62 commit ea52d2d

File tree

1 file changed

+6
-2
lines changed
  • dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server

1 file changed

+6
-2
lines changed

dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/RouteOnSuccessOrError.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.util.function.Function;
1010
import java.util.regex.Pattern;
1111
import javax.annotation.Nonnull;
12+
import org.springframework.http.HttpMethod;
1213
import org.springframework.web.reactive.function.server.HandlerFunction;
1314
import org.springframework.web.reactive.function.server.RouterFunction;
1415
import org.springframework.web.reactive.function.server.ServerRequest;
@@ -73,8 +74,11 @@ public void accept(HandlerFunction<?> handlerFunction) {
7374
final AgentSpan parentSpan =
7475
(AgentSpan) serverRequest.attributes().get(AdviceUtils.PARENT_SPAN_ATTRIBUTE);
7576
if (parentSpan != null) {
76-
HTTP_RESOURCE_DECORATOR.withRoute(
77-
parentSpan, serverRequest.methodName(), parseRoute(predicateString));
77+
final HttpMethod httpMethod = serverRequest.method();
78+
if (httpMethod != null) {
79+
HTTP_RESOURCE_DECORATOR.withRoute(
80+
parentSpan, httpMethod.name(), parseRoute(predicateString));
81+
}
7882
}
7983
}
8084
}

0 commit comments

Comments
 (0)