Skip to content

Commit 971a0fc

Browse files
committed
Experimental change to prevent JAX-RS instrumentation from overriding play framework span resource names.
1 parent 8e7b515 commit 971a0fc

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecorator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ public AgentSpan onResponseStatus(final AgentSpan span, final int status) {
358358
}
359359

360360
if (SHOULD_SET_404_RESOURCE_NAME && status == 404) {
361+
// TODO
361362
span.setResourceName(NOT_FOUND_RESOURCE_NAME, ResourceNamePriorities.HTTP_404);
362363
}
363364
return span;

dd-java-agent/instrumentation/jax-rs-annotations-1/src/main/java/datadog/trace/instrumentation/jaxrs1/JaxRsAnnotationsDecorator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void onJaxRsSpan(
5757
// This check ensures that we only use the route from the first JAX-RS annotated method that
5858
// is executed
5959
if (parent.getLocalRootSpan().getResourceNamePriority()
60-
< ResourceNamePriorities.HTTP_FRAMEWORK_ROUTE) {
60+
< ResourceNamePriorities.HTTP_FRAMEWORK_ROUTE) { // TODO
6161
HTTP_RESOURCE_DECORATOR.withRoute(
6262
parent.getLocalRootSpan(), httpMethodAndRoute.getLeft(), httpMethodAndRoute.getRight());
6363
parent.getLocalRootSpan().setTag(Tags.COMPONENT, "jax-rs");

dd-java-agent/instrumentation/play-2.6/src/main/java/datadog/trace/instrumentation/play26/PlayAdvice.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static void stopTraceOnResponse(
8181
// set the resource name on the upstream akka/netty span if there is one
8282
if (rootSpan != null && playControllerSpan.getResourceName() != null) {
8383
rootSpan.setResourceName(
84-
playControllerSpan.getResourceName(), ResourceNamePriorities.HTTP_PATH_NORMALIZER);
84+
playControllerSpan.getResourceName(), ResourceNamePriorities.HTTP_FRAMEWORK_ROUTE);
8585
}
8686
}
8787
}

dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
191191

192192
String expectedResourceName(ServerEndpoint endpoint, String method, URI address) {
193193
if (endpoint.status == 404 && (changesAll404s() || endpoint.path == "/not-found")) {
194-
return "404"
194+
return "404" // TODO
195195
} else if (endpoint.hasPathParam) {
196196
return "$method ${testPathParam()}"
197197
}

0 commit comments

Comments
 (0)