diff options
author | Ivan Topolnak <itopolnak@despegar.com> | 2014-01-30 18:23:33 -0300 |
---|---|---|
committer | Ivan Topolnak <itopolnak@despegar.com> | 2014-01-30 18:23:33 -0300 |
commit | a15e17d2462105ad8b72054be58dc9e8f9dc64ed (patch) | |
tree | 9e8c3d1fa732918dc600538bab24940bd18b6e79 /kamon-core/src/main/scala/akka/instrumentation/ActorSystemMessagePassingTracing.scala | |
parent | e47ed388f6ae147e550c39aa2a3638791ec65b66 (diff) | |
download | Kamon-a15e17d2462105ad8b72054be58dc9e8f9dc64ed.tar.gz Kamon-a15e17d2462105ad8b72054be58dc9e8f9dc64ed.tar.bz2 Kamon-a15e17d2462105ad8b72054be58dc9e8f9dc64ed.zip |
wip
Diffstat (limited to 'kamon-core/src/main/scala/akka/instrumentation/ActorSystemMessagePassingTracing.scala')
-rw-r--r-- | kamon-core/src/main/scala/akka/instrumentation/ActorSystemMessagePassingTracing.scala | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/kamon-core/src/main/scala/akka/instrumentation/ActorSystemMessagePassingTracing.scala b/kamon-core/src/main/scala/akka/instrumentation/ActorSystemMessagePassingTracing.scala index 7d26016e..d4f8f769 100644 --- a/kamon-core/src/main/scala/akka/instrumentation/ActorSystemMessagePassingTracing.scala +++ b/kamon-core/src/main/scala/akka/instrumentation/ActorSystemMessagePassingTracing.scala @@ -1,21 +1,21 @@ package akka.instrumentation import org.aspectj.lang.annotation._ -import kamon.trace.{ Trace, ContextAware } import akka.dispatch.sysmsg.EarliestFirstSystemMessageList import org.aspectj.lang.ProceedingJoinPoint +import kamon.trace.{TraceRecorder, TraceContextAware} @Aspect class SystemMessageTraceContextMixin { @DeclareMixin("akka.dispatch.sysmsg.SystemMessage+") - def mixin: ContextAware = ContextAware.default + def mixin: TraceContextAware = new TraceContextAware {} @Pointcut("execution(akka.dispatch.sysmsg.SystemMessage+.new(..)) && this(ctx)") - def envelopeCreation(ctx: ContextAware): Unit = {} + def envelopeCreation(ctx: TraceContextAware): Unit = {} @After("envelopeCreation(ctx)") - def afterEnvelopeCreation(ctx: ContextAware): Unit = { + def afterEnvelopeCreation(ctx: TraceContextAware): Unit = { // Necessary to force the initialization of ContextAware at the moment of creation. ctx.traceContext } @@ -25,23 +25,23 @@ class SystemMessageTraceContextMixin { class RepointableActorRefTraceContextMixin { @DeclareMixin("akka.actor.RepointableActorRef") - def mixin: ContextAware = ContextAware.default + def mixin: TraceContextAware = new TraceContextAware {} @Pointcut("execution(akka.actor.RepointableActorRef.new(..)) && this(ctx)") - def envelopeCreation(ctx: ContextAware): Unit = {} + def envelopeCreation(ctx: TraceContextAware): Unit = {} @After("envelopeCreation(ctx)") - def afterEnvelopeCreation(ctx: ContextAware): Unit = { + def afterEnvelopeCreation(ctx: TraceContextAware): Unit = { // Necessary to force the initialization of ContextAware at the moment of creation. ctx.traceContext } @Pointcut("execution(* akka.actor.RepointableActorRef.point(..)) && this(repointableActorRef)") - def repointableActorRefCreation(repointableActorRef: ContextAware): Unit = {} + def repointableActorRefCreation(repointableActorRef: TraceContextAware): Unit = {} @Around("repointableActorRefCreation(repointableActorRef)") - def afterRepointableActorRefCreation(pjp: ProceedingJoinPoint, repointableActorRef: ContextAware): Any = { - Trace.withContext(repointableActorRef.traceContext) { + def afterRepointableActorRefCreation(pjp: ProceedingJoinPoint, repointableActorRef: TraceContextAware): Any = { + TraceRecorder.withContext(repointableActorRef.traceContext) { pjp.proceed() } } @@ -57,8 +57,8 @@ class ActorSystemMessagePassingTracing { @Around("systemMessageProcessing(messages)") def aroundSystemMessageInvoke(pjp: ProceedingJoinPoint, messages: EarliestFirstSystemMessageList): Any = { if (messages.nonEmpty) { - val ctx = messages.head.asInstanceOf[ContextAware].traceContext - Trace.withContext(ctx)(pjp.proceed()) + val ctx = messages.head.asInstanceOf[TraceContextAware].traceContext + TraceRecorder.withContext(ctx)(pjp.proceed()) } else pjp.proceed() } |