aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/main/scala/kamon/instrumentation
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2013-10-02 09:03:42 -0300
committerIvan Topolnjak <ivantopo@gmail.com>2013-10-02 09:03:42 -0300
commite2a9aa15b6ecda441fd81960b31b0b836af6d64a (patch)
tree3cee425fdf5fe7a1ffb4b85212e0bc8d3e75ffd0 /kamon-core/src/main/scala/kamon/instrumentation
parent65428c248502dadb2bdefa58cbc034ced6af9354 (diff)
downloadKamon-e2a9aa15b6ecda441fd81960b31b0b836af6d64a.tar.gz
Kamon-e2a9aa15b6ecda441fd81960b31b0b836af6d64a.tar.bz2
Kamon-e2a9aa15b6ecda441fd81960b31b0b836af6d64a.zip
wip
Diffstat (limited to 'kamon-core/src/main/scala/kamon/instrumentation')
-rw-r--r--kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala4
-rw-r--r--kamon-core/src/main/scala/kamon/instrumentation/SprayServerInstrumentation.scala22
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")
}