diff options
author | Ivan Topolnak <itopolnak@despegar.com> | 2013-12-20 18:18:01 -0300 |
---|---|---|
committer | Ivan Topolnak <itopolnak@despegar.com> | 2013-12-20 18:18:01 -0300 |
commit | 441705bc54364a4cb8524a9739ebb709ef42397f (patch) | |
tree | 24161db953abc2b606e5f0d0e16047e8cecb7ba0 /kamon-spray/src/main/scala/spray/can/server/ServerRequestTracing.scala | |
parent | 705f76aa41ebdf9384530e2e0d850a0ef703a5e6 (diff) | |
download | Kamon-441705bc54364a4cb8524a9739ebb709ef42397f.tar.gz Kamon-441705bc54364a4cb8524a9739ebb709ef42397f.tar.bz2 Kamon-441705bc54364a4cb8524a9739ebb709ef42397f.zip |
ensure spray server instrumentation cleans the thread after initiating the trace
Diffstat (limited to 'kamon-spray/src/main/scala/spray/can/server/ServerRequestTracing.scala')
-rw-r--r-- | kamon-spray/src/main/scala/spray/can/server/ServerRequestTracing.scala | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/kamon-spray/src/main/scala/spray/can/server/ServerRequestTracing.scala b/kamon-spray/src/main/scala/spray/can/server/ServerRequestTracing.scala index c43022d9..91dba87b 100644 --- a/kamon-spray/src/main/scala/spray/can/server/ServerRequestTracing.scala +++ b/kamon-spray/src/main/scala/spray/can/server/ServerRequestTracing.scala @@ -15,11 +15,15 @@ * ========================================================== */ package spray.can.server -import org.aspectj.lang.annotation.{ After, Pointcut, DeclareMixin, Aspect } +import org.aspectj.lang.annotation._ import kamon.trace.{ Trace, ContextAware } import spray.http.HttpRequest import akka.actor.ActorSystem import akka.event.Logging.Warning +import org.aspectj.lang.ProceedingJoinPoint +import spray.http.HttpRequest +import akka.event.Logging.Warning +import scala.Some @Aspect class ServerRequestTracing { @@ -41,6 +45,14 @@ class ServerRequestTracing { openRequest.traceContext } + @Pointcut("execution(* spray.can.server.ServerFrontend$$anon$2$$anon$1.spray$can$server$ServerFrontend$$anon$$anon$$openNewRequest(..))") + def openNewRequest(): Unit = {} + + @After("openNewRequest()") + def afterOpenNewRequest(): Unit = { + Trace.clear + } + @Pointcut("execution(* spray.can.server.OpenRequestComponent$DefaultOpenRequest.handleResponseEndAndReturnNextOpenRequest(..)) && target(openRequest)") def openRequestCreation(openRequest: ContextAware): Unit = {} |