diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-10-31 03:05:13 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-10-31 03:05:13 +0100 |
commit | 2c958ea86ded8a047af6450026ca7ec64a28bea1 (patch) | |
tree | e4bc7fe1dcdd7e45b90dd80df1a71ae81f09fb7e /kamon-play/src/main/scala/kamon/play/instrumentation/WSInstrumentation.scala | |
parent | 89d3057f8025add4b94b32c142e220ffb79f6c33 (diff) | |
download | Kamon-2c958ea86ded8a047af6450026ca7ec64a28bea1.tar.gz Kamon-2c958ea86ded8a047af6450026ca7ec64a28bea1.tar.bz2 Kamon-2c958ea86ded8a047af6450026ca7ec64a28bea1.zip |
+ play: external naming for traces and segments, related to #65
Diffstat (limited to 'kamon-play/src/main/scala/kamon/play/instrumentation/WSInstrumentation.scala')
-rw-r--r-- | kamon-play/src/main/scala/kamon/play/instrumentation/WSInstrumentation.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kamon-play/src/main/scala/kamon/play/instrumentation/WSInstrumentation.scala b/kamon-play/src/main/scala/kamon/play/instrumentation/WSInstrumentation.scala index c2eafa2b..125db85e 100644 --- a/kamon-play/src/main/scala/kamon/play/instrumentation/WSInstrumentation.scala +++ b/kamon-play/src/main/scala/kamon/play/instrumentation/WSInstrumentation.scala @@ -34,8 +34,10 @@ class WSInstrumentation { @Around("onExecuteRequest(request)") def aroundExecuteRequest(pjp: ProceedingJoinPoint, request: WSRequest): Any = { TraceRecorder.withTraceContextAndSystem { (ctx, system) ⇒ - val executor = Kamon(Play)(system).defaultDispatcher - val segment = ctx.startSegment(request.url, SegmentMetricIdentityLabel.HttpClient) + val playExtension = Kamon(Play)(system) + val executor = playExtension.defaultDispatcher + val segmentName = playExtension.generateHttpClientSegmentName(request) + val segment = ctx.startSegment(segmentName, SegmentMetricIdentityLabel.HttpClient) val response = pjp.proceed().asInstanceOf[Future[WSResponse]] response.map(result ⇒ segment.finish())(executor) |