diff options
author | Ivan Topolnak <ivantopo@gmail.com> | 2013-10-04 16:12:29 -0300 |
---|---|---|
committer | Ivan Topolnak <ivantopo@gmail.com> | 2013-10-04 16:12:29 -0300 |
commit | 20f9920d4704e28ee8aa066d151b522c0d14e166 (patch) | |
tree | 09ba43ff7ad46223b0ecac8a2e3c6a7f525cfa2a /kamon-core/src/main/scala/test/SimpleRequestProcessor.scala | |
parent | edbdd04d67893b4ebbcee1b1b08bc531219f04a9 (diff) | |
download | Kamon-20f9920d4704e28ee8aa066d151b522c0d14e166.tar.gz Kamon-20f9920d4704e28ee8aa066d151b522c0d14e166.tar.bz2 Kamon-20f9920d4704e28ee8aa066d151b522c0d14e166.zip |
Simplify logging instrumentation and integrate it with kamon-core, kamon-ouw is gone.
Diffstat (limited to 'kamon-core/src/main/scala/test/SimpleRequestProcessor.scala')
-rw-r--r-- | kamon-core/src/main/scala/test/SimpleRequestProcessor.scala | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/kamon-core/src/main/scala/test/SimpleRequestProcessor.scala b/kamon-core/src/main/scala/test/SimpleRequestProcessor.scala index 5b216b39..7d4cec52 100644 --- a/kamon-core/src/main/scala/test/SimpleRequestProcessor.scala +++ b/kamon-core/src/main/scala/test/SimpleRequestProcessor.scala @@ -6,8 +6,9 @@ import spray.routing.SimpleRoutingApp import akka.util.Timeout import spray.httpx.RequestBuilding import scala.concurrent.{Await, Future} +import kamon.trace.UowDirectives -object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuilding { +object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuilding with UowDirectives { import scala.concurrent.duration._ import spray.client.pipelining._ import akka.pattern.ask @@ -28,11 +29,13 @@ object SimpleRequestProcessor extends App with SimpleRoutingApp with RequestBuil } } ~ path("reply" / Segment) { reqID => - complete { - if (Tracer.context().isEmpty) - println("ROUTE NO CONTEXT") + uow { + complete { + if (Tracer.context().isEmpty) + println("ROUTE NO CONTEXT") - (replier ? reqID).mapTo[String] + (replier ? reqID).mapTo[String] + } } } ~ path("ok") { @@ -78,6 +81,7 @@ class Replier extends Actor with ActorLogging { if(Tracer.context.isEmpty) log.warning("PROCESSING A MESSAGE WITHOUT CONTEXT") + log.info("Processing at the Replier") sender ! anything } } |