diff options
author | Ivan Topolnak <ivantopo@gmail.com> | 2013-05-30 18:32:41 -0300 |
---|---|---|
committer | Ivan Topolnak <ivantopo@gmail.com> | 2013-05-30 18:32:41 -0300 |
commit | 148827486f116c4196888022f04ad053f4fb6e99 (patch) | |
tree | e0cdf5982e778b2e49790bda1572a861884d83f2 /src/main/scala/akka | |
parent | 38316a2b0b3a58b81cf7458b0a719980136bbb97 (diff) | |
download | Kamon-148827486f116c4196888022f04ad053f4fb6e99.tar.gz Kamon-148827486f116c4196888022f04ad053f4fb6e99.tar.bz2 Kamon-148827486f116c4196888022f04ad053f4fb6e99.zip |
WIP - first functional implementation of TraceContext
Diffstat (limited to 'src/main/scala/akka')
-rw-r--r-- | src/main/scala/akka/instrumentation/ActorRefTellInstrumentation.scala | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/scala/akka/instrumentation/ActorRefTellInstrumentation.scala b/src/main/scala/akka/instrumentation/ActorRefTellInstrumentation.scala index 9e816d11..00e4e066 100644 --- a/src/main/scala/akka/instrumentation/ActorRefTellInstrumentation.scala +++ b/src/main/scala/akka/instrumentation/ActorRefTellInstrumentation.scala @@ -3,10 +3,12 @@ package akka.instrumentation import org.aspectj.lang.annotation.{Around, Pointcut, Aspect} import org.aspectj.lang.ProceedingJoinPoint import akka.actor.{ActorRef} -import kamon.TraceContext -import kamon.actor.TraceableMessage +import kamon.{Kamon, TraceContext} import akka.dispatch.Envelope +case class TraceableMessage(traceContext: TraceContext, message: Any) + + @Aspect class ActorRefTellInstrumentation { println("Created ActorAspect") @@ -18,9 +20,9 @@ class ActorRefTellInstrumentation { def around(pjp: ProceedingJoinPoint, message: Any, sender: ActorRef): Unit = { import pjp._ - TraceContext.current match { + Kamon.context match { case Some(ctx) => { - val traceableMessage = TraceableMessage(ctx.fork, message) + val traceableMessage = TraceableMessage(ctx, message) proceed(getArgs.updated(0, traceableMessage)) } case None => proceed @@ -42,12 +44,12 @@ class ActorCellInvokeInstrumentation { envelope match { case Envelope(TraceableMessage(ctx, msg), sender) => { - TraceContext.set(ctx) + Kamon.set(ctx) val originalEnvelope = envelope.copy(message = msg) proceed(getArgs.updated(0, originalEnvelope)) - TraceContext.clear + Kamon.clear } case _ => proceed } |