From 2d92ed2bed18eec79f17ac2f8a312c93b82b4c34 Mon Sep 17 00:00:00 2001 From: Andrew Kent Date: Wed, 11 Apr 2018 13:14:49 -0700 Subject: [PATCH] Use the same operationName for all play requests --- dd-java-agent/instrumentation/play-2.4/.gitignore | 1 + .../play-2.6-testing/src/test/groovy/Play26Test.groovy | 6 +++--- .../trace/instrumentation/play/PlayInstrumentation.java | 1 - .../play-2.4/src/test/groovy/Play24Test.groovy | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 dd-java-agent/instrumentation/play-2.4/.gitignore diff --git a/dd-java-agent/instrumentation/play-2.4/.gitignore b/dd-java-agent/instrumentation/play-2.4/.gitignore new file mode 100644 index 0000000000..5292519a25 --- /dev/null +++ b/dd-java-agent/instrumentation/play-2.4/.gitignore @@ -0,0 +1 @@ +logs/ \ No newline at end of file diff --git a/dd-java-agent/instrumentation/play-2.4/play-2.6-testing/src/test/groovy/Play26Test.groovy b/dd-java-agent/instrumentation/play-2.4/play-2.6-testing/src/test/groovy/Play26Test.groovy index bc192c886f..049f00e637 100644 --- a/dd-java-agent/instrumentation/play-2.4/play-2.6-testing/src/test/groovy/Play26Test.groovy +++ b/dd-java-agent/instrumentation/play-2.4/play-2.6-testing/src/test/groovy/Play26Test.groovy @@ -58,7 +58,7 @@ class Play26Test extends AgentTestRunner { root.traceId == 123 root.parentId == 456 root.serviceName == "unnamed-java-app" - root.operationName == "/helloplay/:from" + root.operationName == "play.request" root.resourceName == "GET /helloplay/:from" !root.context().getErrorFlag() root.context().tags["http.status_code"] == 200 @@ -85,7 +85,7 @@ class Play26Test extends AgentTestRunner { response.code() == 500 root.serviceName == "unnamed-java-app" - root.operationName == "/make-error" + root.operationName == "play.request" root.resourceName == "GET /make-error" root.context().getErrorFlag() root.context().tags["http.status_code"] == 500 @@ -116,7 +116,7 @@ class Play26Test extends AgentTestRunner { root.context().tags["error.type"] == RuntimeException.getName() root.serviceName == "unnamed-java-app" - root.operationName == "/exception" + root.operationName == "play.request" root.resourceName == "GET /exception" root.context().tags["http.status_code"] == 500 root.context().tags["http.url"] == "/exception" diff --git a/dd-java-agent/instrumentation/play-2.4/src/main/java/datadog/trace/instrumentation/play/PlayInstrumentation.java b/dd-java-agent/instrumentation/play-2.4/src/main/java/datadog/trace/instrumentation/play/PlayInstrumentation.java index 999e297b7e..9e7d96c021 100644 --- a/dd-java-agent/instrumentation/play-2.4/src/main/java/datadog/trace/instrumentation/play/PlayInstrumentation.java +++ b/dd-java-agent/instrumentation/play-2.4/src/main/java/datadog/trace/instrumentation/play/PlayInstrumentation.java @@ -116,7 +116,6 @@ public final class PlayInstrumentation extends Instrumenter.Configurable { if (!pathOption.isEmpty()) { final String path = (String) pathOption.get(); scope.span().setTag(Tags.HTTP_URL.getKey(), path); - scope.span().setOperationName(path); scope.span().setTag(DDTags.RESOURCE_NAME, req.method() + " " + path); } diff --git a/dd-java-agent/instrumentation/play-2.4/src/test/groovy/Play24Test.groovy b/dd-java-agent/instrumentation/play-2.4/src/test/groovy/Play24Test.groovy index bd21e4ddab..d2f6f287b4 100644 --- a/dd-java-agent/instrumentation/play-2.4/src/test/groovy/Play24Test.groovy +++ b/dd-java-agent/instrumentation/play-2.4/src/test/groovy/Play24Test.groovy @@ -58,7 +58,7 @@ class Play24Test extends AgentTestRunner { root.traceId == 123 root.parentId == 456 root.serviceName == "unnamed-java-app" - root.operationName == "/helloplay/:from" + root.operationName == "play.request" root.resourceName == "GET /helloplay/:from" !root.context().getErrorFlag() root.context().tags["http.status_code"] == 200 @@ -85,7 +85,7 @@ class Play24Test extends AgentTestRunner { response.code() == 500 root.serviceName == "unnamed-java-app" - root.operationName == "/make-error" + root.operationName == "play.request" root.resourceName == "GET /make-error" root.context().getErrorFlag() root.context().tags["http.status_code"] == 500 @@ -116,7 +116,7 @@ class Play24Test extends AgentTestRunner { root.context().tags["error.type"] == RuntimeException.getName() root.serviceName == "unnamed-java-app" - root.operationName == "/exception" + root.operationName == "play.request" root.resourceName == "GET /exception" root.context().tags["http.status_code"] == 500 root.context().tags["http.url"] == "/exception"