aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/main/scala/kamon
diff options
context:
space:
mode:
authorIvan Topolnak <ivantopo@gmail.com>2013-09-30 11:21:25 -0300
committerIvan Topolnak <ivantopo@gmail.com>2013-09-30 11:21:25 -0300
commit2bde052cc3a3a6eb97b72d3504cd7a4a40a5c2a8 (patch)
tree7d1b469b1d4bb61120385beae4449dc5ad07fe31 /kamon-core/src/main/scala/kamon
parent96e89d0908c479360d4a915c916e341e148a91c7 (diff)
downloadKamon-2bde052cc3a3a6eb97b72d3504cd7a4a40a5c2a8.tar.gz
Kamon-2bde052cc3a3a6eb97b72d3504cd7a4a40a5c2a8.tar.bz2
Kamon-2bde052cc3a3a6eb97b72d3504cd7a4a40a5c2a8.zip
wip
Diffstat (limited to 'kamon-core/src/main/scala/kamon')
-rw-r--r--kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala14
-rw-r--r--kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala12
-rw-r--r--kamon-core/src/main/scala/kamon/instrumentation/SprayServerInstrumentation.scala8
3 files changed, 24 insertions, 10 deletions
diff --git a/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala b/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala
index d92d7f6c..df124f41 100644
--- a/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala
+++ b/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala
@@ -64,8 +64,11 @@ class ActorCellInvokeInstrumentation {
Tracer.clear
//MDC.remove("uow")
}
- case None => pjp.proceedWith(originalEnvelope)
+ case None =>
+ assert(Tracer.context() == None)
+ pjp.proceedWith(originalEnvelope)
}
+ Tracer.clear
}
}
@@ -79,6 +82,7 @@ class UnregisteredActorRefInstrumentation {
def sprayInvokeAround(pjp: ProceedingJoinPoint, message: Any, sender: ActorRef): Unit = {
import ProceedingJoinPointPimp._
//println("Handling unregistered actor ref message: "+message)
+
message match {
case SimpleTraceMessage(msg, ctx) => {
ctx match {
@@ -87,10 +91,14 @@ class UnregisteredActorRefInstrumentation {
pjp.proceedWith(msg.asInstanceOf[AnyRef]) // TODO: define if we should use Any or AnyRef and unify with the rest of the instrumentation.
Tracer.clear
}
- case None => pjp.proceedWith(msg.asInstanceOf[AnyRef])
+ case None =>
+ assert(Tracer.context() == None)
+ pjp.proceedWith(msg.asInstanceOf[AnyRef])
}
}
- case _ => pjp.proceed
+ case _ =>
+ //assert(Tracer.context() == None)
+ pjp.proceed
}
}
}
diff --git a/kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala b/kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala
index 30041321..393293f1 100644
--- a/kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala
+++ b/kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala
@@ -37,7 +37,7 @@ class RunnableInstrumentation {
* Aspect members
*/
- private val traceContext = Tracer.context
+ private var traceContext = Tracer.context
/**
@@ -47,15 +47,21 @@ class RunnableInstrumentation {
@Before("instrumentedRunnableCreation()")
def beforeCreation = {
- //println((new Throwable).getStackTraceString)
+ traceContext = Tracer.context
+ /* if(traceContext.isEmpty)
+ println("NO TRACE CONTEXT FOR RUNNABLE at: [[[%s]]]", (new Throwable).getStackTraceString)//println((new Throwable).getStackTraceString)
+ else
+ println("SUPER TRACE CONTEXT FOR RUNNABLE at: [[[%s]]]", (new Throwable).getStackTraceString)*/
}
@Around("runnableExecution()")
def around(pjp: ProceedingJoinPoint) = {
import pjp._
-
+ /*if(traceContext.isEmpty)
+ println("OOHHH NOOOOO")*/
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 9422a9f7..4eafcebe 100644
--- a/kamon-core/src/main/scala/kamon/instrumentation/SprayServerInstrumentation.scala
+++ b/kamon-core/src/main/scala/kamon/instrumentation/SprayServerInstrumentation.scala
@@ -32,7 +32,7 @@ class SprayServerInstrumentation {
//def afterInit(): Unit = {
Tracer.start
//openRequest.traceContext
- println("Created the context: " + Tracer.context() + " for the transaction: " + request)
+ //println("Created the context: " + Tracer.context() + " for the transaction: " + request)
Tracer.context().map(_.entries ! Rename(request.uri.path.toString()))
}
@@ -41,13 +41,13 @@ class SprayServerInstrumentation {
@After("openRequestCreation()")
def afterFinishingRequest(): Unit = {
- println("Finishing a request: " + Tracer.context())
+ //println("Finishing a request: " + Tracer.context())
Tracer.context().map(_.entries ! Finish())
-
+/*
if(Tracer.context().isEmpty) {
println("WOOOOOPAAAAAAAAA")
- }
+ }*/
}