diff options
Diffstat (limited to 'kamon-core/src/main/scala/kamon/instrumentation')
-rw-r--r-- | kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala | 4 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/instrumentation/SprayServerInstrumentation.scala | 22 |
2 files changed, 19 insertions, 7 deletions
diff --git a/kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala b/kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala index 393293f1..bff118d9 100644 --- a/kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala +++ b/kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala @@ -58,8 +58,8 @@ class RunnableInstrumentation { @Around("runnableExecution()") def around(pjp: ProceedingJoinPoint) = { import pjp._ - /*if(traceContext.isEmpty) - println("OOHHH NOOOOO")*/ + if(traceContext.isEmpty) + println("NOMONEY") withContext(traceContext, proceed()) } diff --git a/kamon-core/src/main/scala/kamon/instrumentation/SprayServerInstrumentation.scala b/kamon-core/src/main/scala/kamon/instrumentation/SprayServerInstrumentation.scala index 0299c4c5..06254739 100644 --- a/kamon-core/src/main/scala/kamon/instrumentation/SprayServerInstrumentation.scala +++ b/kamon-core/src/main/scala/kamon/instrumentation/SprayServerInstrumentation.scala @@ -32,20 +32,32 @@ class SprayServerInstrumentation { //@After("openRequestInit()") //def afterInit(): Unit = { Tracer.start + val discard = openRequest.asInstanceOf[ContextAware].traceContext + + //println("Reply: %s - %s ", Tracer.context().get.id, request.uri.path.toString()) + +// if(discard.isEmpty || discard != Tracer.context()) { +// println("MEGA ERROR") +// } //openRequest.traceContext //println("Created the context: " + Tracer.context() + " for the transaction: " + request) Tracer.context().map(_.entries ! Rename(request.uri.path.toString())) } - @Pointcut("execution(* spray.can.server.OpenRequestComponent$DefaultOpenRequest.handleResponseEndAndReturnNextOpenRequest(..))") - def openRequestCreation(): Unit = {} + @Pointcut("execution(* spray.can.server.OpenRequestComponent$DefaultOpenRequest.handleResponseEndAndReturnNextOpenRequest(..)) && target(openRequest)") + def openRequestCreation(openRequest: OpenRequest): Unit = {} - @After("openRequestCreation()") - def afterFinishingRequest(): Unit = { + @After("openRequestCreation(openRequest)") + def afterFinishingRequest(openRequest: OpenRequest): Unit = { // println("Finishing a request: " + Tracer.context()) - + val original = openRequest.asInstanceOf[ContextAware].traceContext + println("The original is: " + original + " - " + openRequest.request.uri.path) Tracer.context().map(_.entries ! Finish()) + if(Tracer.context() != original) { + println(s"OMG DIFFERENT Original: [${original}] - Came in: [${Tracer.context}]") + } + if(Tracer.context().isEmpty) { println("WOOOOOPAAAAAAAAA") } |