diff options
author | Ivan Topolnak <ivantopo@gmail.com> | 2013-08-08 15:18:35 -0300 |
---|---|---|
committer | Ivan Topolnak <ivantopo@gmail.com> | 2013-08-08 15:18:35 -0300 |
commit | b2c85b020185c9d5bcc89cfe9d4166405d1b404a (patch) | |
tree | df765816fdd42df80e28f2f31345ff6964957645 | |
parent | cd1a9dd25fb550a515e7a7408b88233773268c38 (diff) | |
download | Kamon-b2c85b020185c9d5bcc89cfe9d4166405d1b404a.tar.gz Kamon-b2c85b020185c9d5bcc89cfe9d4166405d1b404a.tar.bz2 Kamon-b2c85b020185c9d5bcc89cfe9d4166405d1b404a.zip |
wip
4 files changed, 21 insertions, 29 deletions
diff --git a/kamon-core/src/main/resources/application.conf b/kamon-core/src/main/resources/application.conf index 370acae9..fb69ecd4 100644 --- a/kamon-core/src/main/resources/application.conf +++ b/kamon-core/src/main/resources/application.conf @@ -1,4 +1,7 @@ akka { + loglevel = DEBUG + stdout-loglevel = DEBUG + log-dead-letters = on actor { default-dispatcher { fork-join-executor { @@ -19,25 +22,6 @@ akka { } } -# Dispatcher is the name of the event-based dispatcher -#type = Dispatcher - -# What kind of ExecutionService to use -#executor = "kamon.executor.InstrumentedExecutorServiceConfigurator" - -# Min number of threads to cap factor-based parallelism number to -#parallelism-min = 2 - -# Parallelism (threads) ... ceil(available processors * factor) -#parallelism-factor = 2.0 - -# Max number of threads to cap factor-based parallelism number to -#parallelism-max = 10 - -# Throughput defines the maximum number of messages to be -# processed per actor before the thread jumps to the next actor. -# Set to 1 for as fair as possible. -#throughput = 100 diff --git a/kamon-core/src/main/scala/kamon/TraceContextSwap.scala b/kamon-core/src/main/scala/kamon/TraceContextSwap.scala index 68ee808b..24661445 100644 --- a/kamon-core/src/main/scala/kamon/TraceContextSwap.scala +++ b/kamon-core/src/main/scala/kamon/TraceContextSwap.scala @@ -10,9 +10,9 @@ trait TraceContextSwap { def withContext[A](ctx: Option[TraceContext], primary: => A, fallback: => A): A = { ctx match { case Some(context) => { - Kamon.set(context) + Tracer.set(context) val bodyResult = primary - Kamon.clear + Tracer.clear bodyResult } diff --git a/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala b/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala index 82915ce9..c543123c 100644 --- a/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala +++ b/kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala @@ -3,12 +3,11 @@ package kamon.instrumentation import org.aspectj.lang.annotation._ import org.aspectj.lang.ProceedingJoinPoint import akka.actor.{Props, ActorSystem, ActorRef} -import kamon.{Kamon, TraceContext} +import kamon.{Tracer, TraceContext} import akka.dispatch.{MessageDispatcher, Envelope} import com.codahale.metrics.{Timer, ExponentiallyDecayingReservoir, Histogram} import kamon.metric.{MetricDirectory, Metrics} import com.codahale.metrics -import kamon.instrumentation.TraceableMessage import scala.Some case class TraceableMessage(traceContext: Option[TraceContext], message: Any, timer: Timer.Context) @@ -18,7 +17,7 @@ case class TraceableMessage(traceContext: Option[TraceContext], message: Any, ti class ActorRefTellInstrumentation { import ProceedingJoinPointPimp._ - @Pointcut("execution(* akka.actor.ScalaActorRef+.$bang(..)) && target(actor) && args(message, sender)") + @Pointcut("execution(* (akka.actor.ScalaActorRef+ && !akka.event.Logging$StandardOutLogger).$bang(..)) && target(actor) && args(message, sender)") def sendingMessageToActorRef(actor: ActorRef, message: Any, sender: ActorRef) = {} @Around("sendingMessageToActorRef(actor, message, sender)") @@ -27,7 +26,15 @@ class ActorRefTellInstrumentation { val actorName = MetricDirectory.nameForActor(actor) val t = Metrics.registry.timer(actorName + "LATENCY") //println(s"About to proceed with: $actor $message $sender ${Kamon.context}") - pjp.proceedWithTarget(actor, TraceableMessage(Kamon.context, message, t.time()), sender) + if(!actor.toString().contains("StandardOutLogger")) { + println("Skipped the actor") + pjp.proceedWithTarget(actor, TraceableMessage(Tracer.context, message, t.time()), sender) + + } + else { + println("Got the standardLogger!!") + pjp.proceed() + } } } @@ -48,6 +55,7 @@ class ActorCellInvokeInstrumentation { val actorName = MetricDirectory.nameForActor(ref) val histogramName = MetricDirectory.nameForMailbox(system.name, actorName) + println("=====> Created ActorCell for: "+ref.toString()) /** TODO: Find a better way to filter the things we don't want to measure. */ //if(system.name != "kamon" && actorName.startsWith("/user")) { processingTimeTimer = Metrics.registry.timer(histogramName + "/PROCESSINGTIME") @@ -74,10 +82,10 @@ class ActorCellInvokeInstrumentation { val pt = processingTimeTimer.time() ctx match { case Some(c) => { - Kamon.set(c) + Tracer.set(c) println(s"ENVELOPE ORIGINAL: [$c]---------------->"+originalEnvelope) pjp.proceedWith(originalEnvelope) - Kamon.clear + Tracer.clear } case None => pjp.proceedWith(originalEnvelope) } diff --git a/kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala b/kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala index e75a638f..30041321 100644 --- a/kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala +++ b/kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala @@ -1,7 +1,7 @@ package kamon.instrumentation import org.aspectj.lang.annotation._ -import kamon.{Kamon, TraceContext} +import kamon.{Tracer, TraceContext} import org.aspectj.lang.ProceedingJoinPoint import scala.Some @@ -37,7 +37,7 @@ class RunnableInstrumentation { * Aspect members */ - private val traceContext = Kamon.context + private val traceContext = Tracer.context /** |