diff options
author | Ivan Topolnak <itopolnak@despegar.com> | 2014-01-13 17:56:51 -0300 |
---|---|---|
committer | Ivan Topolnak <itopolnak@despegar.com> | 2014-01-13 17:56:51 -0300 |
commit | 111ea55690351d0903e9902c525c781ef2d743a8 (patch) | |
tree | 003b0e1cf95f1d3cba55927422ff063c049a5cf9 /kamon-playground/src/main | |
parent | 571e96665bb3cb3f20fb59209be63dabbb3148f4 (diff) | |
parent | 7a10c0ef2a6566229e8571f6d385ca2ff794cc20 (diff) | |
download | Kamon-111ea55690351d0903e9902c525c781ef2d743a8.tar.gz Kamon-111ea55690351d0903e9902c525c781ef2d743a8.tar.bz2 Kamon-111ea55690351d0903e9902c525c781ef2d743a8.zip |
Merge branch 'wip/trace-and-metrics-integration'
Conflicts:
kamon-newrelic/src/main/scala/kamon/newrelic/NewRelicErrorLogger.scala
Diffstat (limited to 'kamon-playground/src/main')
3 files changed, 24 insertions, 5 deletions
diff --git a/kamon-playground/src/main/resources/application.conf b/kamon-playground/src/main/resources/application.conf index 88fe8e8d..88a77566 100644 --- a/kamon-playground/src/main/resources/application.conf +++ b/kamon-playground/src/main/resources/application.conf @@ -1,9 +1,21 @@ akka { loggers = [ "akka.event.slf4j.Slf4jLogger" ] - loglevel = DEBUG + loglevel = INFO actor { debug { unhandled = on } } +} + + +kamon { + metrics { + actors { + tracked = [ + "user/simple-service-actor", + "other" + ] + } + } }
\ No newline at end of file diff --git a/kamon-playground/src/main/resources/logback.xml b/kamon-playground/src/main/resources/logback.xml index 2ae1e3bd..e948eaf5 100644 --- a/kamon-playground/src/main/resources/logback.xml +++ b/kamon-playground/src/main/resources/logback.xml @@ -1,7 +1,8 @@ <configuration scan="true"> + <conversionRule conversionWord="uow" converterClass="kamon.trace.logging.LogbackUowConverter" /> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> - <pattern>%date{HH:mm:ss.SSS} %-5level [%X{uow}][%X{requestId}] [%thread] %logger{55} - %msg%n</pattern> + <pattern>%date{HH:mm:ss.SSS} %-5level [%uow][%X{akkaSource}] [%thread] %logger{55} - %msg%n</pattern> </encoder> </appender> diff --git a/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala b/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala index 333f5031..868a1921 100644 --- a/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala +++ b/kamon-playground/src/main/scala/test/SimpleRequestProcessor.scala @@ -24,6 +24,7 @@ import kamon.spray.UowDirectives import kamon.trace.Trace import kamon.Kamon import scala.util.Random +import akka.routing.RoundRobinRouter object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuilding with UowDirectives { import scala.concurrent.duration._ @@ -34,7 +35,6 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil import system.dispatcher val act = system.actorOf(Props(new Actor { - println("Initializing from: " + (new Throwable).getStackTraceString) def receive: Actor.Receive = { case any ⇒ sender ! any } }), "com") @@ -43,7 +43,7 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil implicit val timeout = Timeout(30 seconds) val pipeline = sendReceive - val replier = system.actorOf(Props[Replier]) + val replier = system.actorOf(Props[Replier].withRouter(RoundRobinRouter(nrOfInstances = 2)), "replier") val random = new Random() startServer(interface = "localhost", port = 9090) { get { @@ -83,6 +83,12 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil complete(Future { "OK" }) } } ~ + path("kill") { + dynamic { + replier ! PoisonPill + complete(Future { "OK" }) + } + } ~ path("error") { complete { throw new NullPointerException @@ -121,7 +127,7 @@ class Replier extends Actor with ActorLogging { if (Trace.context.isEmpty) log.warning("PROCESSING A MESSAGE WITHOUT CONTEXT") - log.info("Processing at the Replier") + log.info("Processing at the Replier, and self is: {}", self) sender ! anything } } |