aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala
diff options
context:
space:
mode:
authorIvan Topolnak <ivantopo@gmail.com>2013-09-18 18:43:11 -0300
committerIvan Topolnak <ivantopo@gmail.com>2013-09-18 18:43:11 -0300
commit5168621c256d25d388fb990a5bbc080a35e07b46 (patch)
tree5ebdbbf2286072bbd47b8e2e9482add5ccf382ad /kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala
parentd8305b781aaf454cec558bfb86a366682e9f5eab (diff)
downloadKamon-5168621c256d25d388fb990a5bbc080a35e07b46.tar.gz
Kamon-5168621c256d25d388fb990a5bbc080a35e07b46.tar.bz2
Kamon-5168621c256d25d388fb990a5bbc080a35e07b46.zip
basic newrelic reporting
Diffstat (limited to 'kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala')
-rw-r--r--kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala b/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala
index 84498cb8..4f0b8a08 100644
--- a/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala
+++ b/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala
@@ -2,13 +2,14 @@ package kamon.instrumentation
import org.aspectj.lang.annotation._
import org.aspectj.lang.ProceedingJoinPoint
-import akka.actor.{Props, ActorSystem, ActorRef}
+import akka.actor.{ActorCell, Props, ActorSystem, ActorRef}
import kamon.{Kamon, Tracer, TraceContext}
import akka.dispatch.{MessageDispatcher, Envelope}
import com.codahale.metrics.Timer
import kamon.metric.{MetricDirectory, Metrics}
import scala.Some
import kamon.instrumentation.SimpleContextPassingInstrumentation.SimpleTraceMessage
+import org.slf4j.MDC
case class TraceableMessage(traceContext: Option[TraceContext], message: Any, timer: Timer.Context)
@@ -52,11 +53,14 @@ class ActorCellInvokeInstrumentation {
import ProceedingJoinPointPimp._
val (originalEnvelope, ctx) = instrumentation.preReceive(envelope)
+ //println("Test")
ctx match {
case Some(c) => {
+ //MDC.put("uow", c.userContext.get.asInstanceOf[String])
Tracer.set(c)
pjp.proceedWith(originalEnvelope)
Tracer.clear
+ //MDC.remove("uow")
}
case None => pjp.proceedWith(originalEnvelope)
}
@@ -74,9 +78,7 @@ class UnregisteredActorRefInstrumentation {
import ProceedingJoinPointPimp._
println("Handling unregistered actor ref message: "+message)
message match {
- case TraceableMessage(ctx, msg, timer) => {
- timer.stop()
-
+ case SimpleTraceMessage(msg, ctx) => {
ctx match {
case Some(c) => {
Tracer.set(c)