Skip to content

Commit 799e5fa

Browse files
committed
Experimental change to prevent JAX-RS instrumentation from overriding play framework span resource names.
1 parent 6666f39 commit 799e5fa

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
@@ -317,6 +317,7 @@ public AgentSpan onResponseStatus(final AgentSpan span, final int status) {
317317
}
318318

319319
if (SHOULD_SET_404_RESOURCE_NAME && status == 404) {
320+
// TODO
320321
span.setResourceName(NOT_FOUND_RESOURCE_NAME, ResourceNamePriorities.HTTP_404);
321322
}
322323
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
@@ -82,7 +82,7 @@ public static void stopTraceOnResponse(
8282
// set the resource name on the upstream akka/netty span if there is one
8383
if (rootSpan != null && playControllerSpan.getResourceName() != null) {
8484
rootSpan.setResourceName(
85-
playControllerSpan.getResourceName(), ResourceNamePriorities.HTTP_PATH_NORMALIZER);
85+
playControllerSpan.getResourceName(), ResourceNamePriorities.HTTP_FRAMEWORK_ROUTE);
8686
}
8787
}
8888
}

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
@@ -169,7 +169,7 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
169169

170170
String expectedResourceName(ServerEndpoint endpoint, String method, URI address) {
171171
if (endpoint.status == 404 && (changesAll404s() || endpoint.path == "/not-found")) {
172-
return "404"
172+
return "404" // TODO
173173
} else if (endpoint.hasPathParam) {
174174
return "$method ${testPathParam()}"
175175
}

0 commit comments

Comments
 (0)