diff options
Diffstat (limited to 'kamon-play/src/main/scala/kamon/play/instrumentation/RequestInstrumentation.scala')
-rw-r--r-- | kamon-play/src/main/scala/kamon/play/instrumentation/RequestInstrumentation.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kamon-play/src/main/scala/kamon/play/instrumentation/RequestInstrumentation.scala b/kamon-play/src/main/scala/kamon/play/instrumentation/RequestInstrumentation.scala index e671d097..3a84f741 100644 --- a/kamon-play/src/main/scala/kamon/play/instrumentation/RequestInstrumentation.scala +++ b/kamon-play/src/main/scala/kamon/play/instrumentation/RequestInstrumentation.scala @@ -16,7 +16,6 @@ package kamon.play.instrumentation -import scala.concurrent.ExecutionContext.Implicits.global import kamon.trace.{ TraceRecorder, TraceContextAware } import kamon.Kamon import kamon.play.Play @@ -26,6 +25,7 @@ import akka.actor.ActorSystem import org.aspectj.lang.ProceedingJoinPoint import org.aspectj.lang.annotation._ import scala.Some +import kamon.util.Contexts @Aspect class RequestInstrumentation { @@ -63,9 +63,11 @@ class RequestInstrumentation { } private[this] val kamonRequestFilter = Filter { (nextFilter, requestHeader) ⇒ + processRequest(requestHeader) val incomingContext = TraceRecorder.currentContext + val executor = Kamon(Play)(Akka.system()).defaultDispatcher nextFilter(requestHeader).map { result ⇒ @@ -80,7 +82,7 @@ class RequestInstrumentation { } else result } simpleResult - } + }(executor) } private[this] def processRequest(requestHeader: RequestHeader): Unit = { |