Fix play span name
MODIFY
instrumentation/play/play-2.3/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_3/PlayTracer.java
instrumentation/play/play-2.3/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_3/PlayTracer.java
@@ -19,7 +19,7 @@ public class PlayTracer extends BaseTracer {
Option<String> pathOption = request.tags().get("ROUTE_PATTERN");
if (!pathOption.isEmpty()) {
String path = pathOption.get();
- span.updateName(request.method() + " " + path);
+ span.updateName(path);
}
return span;
}

MODIFY
instrumentation/play/play-2.4/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/PlayTracer.java
instrumentation/play/play-2.4/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_4/PlayTracer.java
@@ -20,7 +20,7 @@ public class PlayTracer extends BaseTracer {
Option<String> pathOption = request.tags().get("ROUTE_PATTERN");
if (!pathOption.isEmpty()) {
String path = pathOption.get();
- span.updateName(request.method() + " " + path);
+ span.updateName(path);
}
}
}

MODIFY
instrumentation/play/play-2.6/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_6/PlayTracer.java
instrumentation/play/play-2.6/src/main/java/io/opentelemetry/javaagent/instrumentation/play/v2_6/PlayTracer.java
@@ -56,7 +56,7 @@ public class PlayTracer extends BaseTracer {
}
if (defOption != null && !defOption.isEmpty()) {
String path = defOption.get().path();
- span.updateName(request.method() + " " + path);
+ span.updateName(path);
}
}
}

MODIFY
smoke-tests/src/test/groovy/io/opentelemetry/smoketest/PlaySmokeTest.groovy
smoke-tests/src/test/groovy/io/opentelemetry/smoketest/PlaySmokeTest.groovy
@@ -28,7 +28,7 @@ class PlaySmokeTest extends SmokeTest {
response.body().string() == "Welcome 1."
//Both play and akka-http support produce spans with the same name.
//One internal, one SERVER
- countSpansByName(traces, 'GET /welcome') == 2
+ countSpansByName(traces, '/welcome') == 2
cleanup:
stopTarget()

Fix play span name (#1416)