Use the same operationName for all play requests

This commit is contained in:
Andrew Kent 2018-04-11 13:14:49 -07:00
parent d594d6e8db
commit 2d92ed2bed
4 changed files with 7 additions and 7 deletions

View File

@ -0,0 +1 @@
logs/

View File

@ -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"

View File

@ -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);
}

View File

@ -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"