Use the same operationName for all play requests
ADD
dd-java-agent/instrumentation/play-2.4/.gitignore
+logs/
\ No newline at end of file

MODIFY
dd-java-agent/instrumentation/play-2.4/play-2.6-testing/src/test/groovy/Play26Test.groovy
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"

MODIFY
dd-java-agent/instrumentation/play-2.4/src/main/java/datadog/trace/instrumentation/play/PlayInstrumentation.java
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);
}

MODIFY
dd-java-agent/instrumentation/play-2.4/src/test/groovy/Play24Test.groovy
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"

Use the same operationName for all play requests