Skip to content

Commit a79325c

Browse files
committed
don't change operation name for not-found
1 parent 0a3cc3b commit a79325c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/main/scala/kamon/http4s/middleware/client/KamonSupport.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,15 @@ object KamonSupport {
5656
for {
5757
requestHandler <- Resource.liftF(F.delay(instrumentation.createHandler(getRequestBuilder(request), ctx)))
5858
response <- underlying.run(requestHandler.request).attempt
59-
trackedResponse <- Resource.liftF(handleResponse(response, requestHandler, instrumentation.settings))
59+
trackedResponse <- Resource.liftF(handleResponse(response, requestHandler))
6060
} yield trackedResponse
6161

6262
def handleResponse[F[_]](
6363
response: Either[Throwable, Response[F]],
6464
requestHandler: HttpClientInstrumentation.RequestHandler[Request[F]],
65-
settings: HttpClientInstrumentation.Settings
6665
)(implicit F:Sync[F]): F[Response[F]] =
6766
response match {
6867
case Right(res) =>
69-
if(res.status.code == 404) requestHandler.span.name(settings.defaultOperationName)
7068
requestHandler.processResponse(getResponseBuilder(res))
7169
F.delay(res)
7270
case Left(error) =>

src/test/scala/kamon/http4s/ClientInstrumentationSpec.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ class ClientInstrumentationSpec extends WordSpec
104104

105105
eventually(timeout(2 seconds)) {
106106
val span = testSpanReporter().nextSpan().value
107-
//TODO what should be client not found oper name, settings provide no default for clients
108-
span.operationName shouldBe "http.client.request"
107+
span.operationName shouldBe "/tracing/not-found"
109108
span.kind shouldBe Span.Kind.Client
110109
span.metricTags.get(plain("component")) shouldBe "http4s.client"
111110
span.metricTags.get(plain("http.method")) shouldBe "GET"

0 commit comments

Comments
 (0)