Skip to content

Commit

Permalink
Akka http server span names are always akka.request open-telemetry#3478
Browse files Browse the repository at this point in the history
… (open-telemetry#5150)

* Akka http server span names are always akka.request open-telemetry#3478
 - removed hardcoded span name "akka.request"
 - implemented route() in AkkaHttpServerAttributesExtractor to provide a better span name
 - retrofitted AkkaHttpServerInstrumentationTest.groovy

* Akka http server span names are always akka.request open-telemetry#3478
 - removed hardcoded span name "akka.request" and changed to "HTTP {METHOD}"
 - retrofitted AkkaHttpServerInstrumentationTest.groovy

* Akka http server span names are always akka.request open-telemetry#3478
 - removed hardcoded span name "akka.request" and changed to "HTTP {METHOD}"
 - retrofitted AkkaHttpServerInstrumentationTest.groovy

* Akka http server span names are always akka.request open-telemetry#3478
 - removed hardcoded span name "akka.request" and changed to "HTTP {METHOD}"
 - retrofitted AkkaHttpServerInstrumentationTest.groovy and related tests
  • Loading branch information
mcmho authored and RashmiRam committed May 23, 2022
1 parent 1470ac9 commit e6fd516
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -25,7 +26,7 @@ public class AkkaHttpServerSingletons {
Instrumenter.<HttpRequest, HttpResponse>builder(
GlobalOpenTelemetry.get(),
AkkaHttpUtil.instrumentationName(),
unused -> "akka.request")
HttpSpanNameExtractor.create(httpAttributesExtractor))
.setSpanStatusExtractor(HttpSpanStatusExtractor.create(httpAttributesExtractor))
.addAttributesExtractor(httpAttributesExtractor)
.addRequestMetrics(HttpServerMetrics.get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ abstract class AkkaHttpServerInstrumentationTest extends HttpServerTest<Object>
// }

@Override
String expectedServerSpanName(ServerEndpoint endpoint) {
return "akka.request"
boolean testCapturedHttpHeaders() {
false
}

@Override
boolean testCapturedHttpHeaders() {
false
String expectedServerSpanName(ServerEndpoint endpoint) {
return "HTTP GET"
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class PlayServerTest extends HttpServerTest<Server> implements AgentTestTrait {

@Override
String expectedServerSpanName(ServerEndpoint endpoint) {
return "akka.request"
return "HTTP GET"
}

}

0 comments on commit e6fd516

Please sign in to comment.