diff options
Diffstat (limited to 'kamon-spray/src/main')
-rw-r--r-- | kamon-spray/src/main/resources/META-INF/aop.xml | 2 | ||||
-rw-r--r-- | kamon-spray/src/main/scala/spray/can/client/ClientRequestInstrumentation.scala (renamed from kamon-spray/src/main/scala/spray/can/client/ClientRequestTracing.scala) | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/kamon-spray/src/main/resources/META-INF/aop.xml b/kamon-spray/src/main/resources/META-INF/aop.xml index 2f1db767..6aacbdb3 100644 --- a/kamon-spray/src/main/resources/META-INF/aop.xml +++ b/kamon-spray/src/main/resources/META-INF/aop.xml @@ -6,7 +6,7 @@ <aspect name="spray.can.server.ServerRequestInstrumentation"/> <!-- Spray Client --> - <aspect name="spray.can.client.ClientRequestTracing"/> + <aspect name="spray.can.client.ClientRequestInstrumentation"/> </aspects> <weaver options="-verbose -showWeaveInfo"> diff --git a/kamon-spray/src/main/scala/spray/can/client/ClientRequestTracing.scala b/kamon-spray/src/main/scala/spray/can/client/ClientRequestInstrumentation.scala index c74019dd..868cbaca 100644 --- a/kamon-spray/src/main/scala/spray/can/client/ClientRequestTracing.scala +++ b/kamon-spray/src/main/scala/spray/can/client/ClientRequestInstrumentation.scala @@ -26,7 +26,8 @@ import kamon.Kamon import kamon.spray.Spray @Aspect -class ClientRequestTracing { +class ClientRequestInstrumentation { + import ClientRequestInstrumentation._ @DeclareMixin("spray.can.client.HttpHostConnector.RequestContext") def mixin: SegmentCompletionHandleAware = SegmentCompletionHandleAware.default @@ -48,7 +49,7 @@ class ClientRequestTracing { "method" -> request.method.toString()) val clientRequestName = Kamon(Spray)(traceContext.system).assignHttpClientRequestName(request) - val completionHandle = traceContext.startSegment(HttpClientRequest(clientRequestName), requestAttributes) + val completionHandle = traceContext.startSegment(HttpClientRequest(clientRequestName, SprayTime), requestAttributes) ctx.segmentCompletionHandle = Some(completionHandle) } } @@ -81,5 +82,9 @@ class ClientRequestTracing { case None ⇒ pjp.proceed() } } +} +object ClientRequestInstrumentation { + val SprayTime = "SprayTime" + val UserTime = "UserTime" } |