aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Topolnak <ivantopo@gmail.com>2013-08-08 15:18:35 -0300
committerIvan Topolnak <ivantopo@gmail.com>2013-08-08 15:18:35 -0300
commit66957f2632eaccae4e3a354b8787fded8c6369d2 (patch)
treecfc335896aafe8ff9e5cb7969ba4384f09c7b462
parent923b88e8adef2f66b43e551fa4a0a1bbae5af7ff (diff)
downloadKamon-66957f2632eaccae4e3a354b8787fded8c6369d2.tar.gz
Kamon-66957f2632eaccae4e3a354b8787fded8c6369d2.tar.bz2
Kamon-66957f2632eaccae4e3a354b8787fded8c6369d2.zip
wip
-rw-r--r--kamon-core/src/main/resources/application.conf22
-rw-r--r--kamon-core/src/main/scala/kamon/TraceContextSwap.scala4
-rw-r--r--kamon-core/src/main/scala/kamon/instrumentation/ActorRefTellInstrumentation.scala20
-rw-r--r--kamon-core/src/main/scala/kamon/instrumentation/RunnableInstrumentation.scala4
-rw-r--r--project/Settings.scala3
5 files changed, 23 insertions, 30 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
/**
diff --git a/project/Settings.scala b/project/Settings.scala
index 5fadc25d..df120b0a 100644
--- a/project/Settings.scala
+++ b/project/Settings.scala
@@ -22,7 +22,8 @@ object Settings {
"-language:postfixOps",
"-language:implicitConversions",
"-Xlog-reflective-calls"
- )
+ ),
+ publishTo := Some("Nexus" at "http://nexus.despegar.it:8080/nexus/content/repositories/snapshots")
)