diff --git a/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerSingletons.java b/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerSingletons.java index 6e67129caa8e..f5f6fb8b9c6f 100644 --- a/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerSingletons.java +++ b/instrumentation/akka/akka-http-10.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/akkahttp/server/AkkaHttpServerSingletons.java @@ -10,6 +10,7 @@ import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpServerMetrics; +import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanNameExtractor; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanStatusExtractor; import io.opentelemetry.instrumentation.api.server.ServerSpanNaming; import io.opentelemetry.javaagent.instrumentation.akkahttp.AkkaHttpUtil; @@ -25,7 +26,7 @@ public class AkkaHttpServerSingletons { Instrumenter.builder( GlobalOpenTelemetry.get(), AkkaHttpUtil.instrumentationName(), - unused -> "akka.request") + HttpSpanNameExtractor.create(httpAttributesExtractor)) .setSpanStatusExtractor(HttpSpanStatusExtractor.create(httpAttributesExtractor)) .addAttributesExtractor(httpAttributesExtractor) .addRequestMetrics(HttpServerMetrics.get()) diff --git a/instrumentation/akka/akka-http-10.0/javaagent/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy b/instrumentation/akka/akka-http-10.0/javaagent/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy index 4b8dd3877df0..e6d8cdd2ea2a 100644 --- a/instrumentation/akka/akka-http-10.0/javaagent/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy +++ b/instrumentation/akka/akka-http-10.0/javaagent/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy @@ -21,13 +21,13 @@ abstract class AkkaHttpServerInstrumentationTest extends HttpServerTest // } @Override - String expectedServerSpanName(ServerEndpoint endpoint) { - return "akka.request" + boolean testCapturedHttpHeaders() { + false } @Override - boolean testCapturedHttpHeaders() { - false + String expectedServerSpanName(ServerEndpoint endpoint) { + return "HTTP GET" } @Override diff --git a/instrumentation/play/play-2.6/javaagent/src/test/groovy/server/PlayServerTest.groovy b/instrumentation/play/play-2.6/javaagent/src/test/groovy/server/PlayServerTest.groovy index 56dfe5cb1e12..b351cfe12a17 100644 --- a/instrumentation/play/play-2.6/javaagent/src/test/groovy/server/PlayServerTest.groovy +++ b/instrumentation/play/play-2.6/javaagent/src/test/groovy/server/PlayServerTest.groovy @@ -107,7 +107,7 @@ class PlayServerTest extends HttpServerTest implements AgentTestTrait { @Override String expectedServerSpanName(ServerEndpoint endpoint) { - return "akka.request" + return "HTTP GET" } }