diff options
author | Ivan Topolnak <ivantopo@gmail.com> | 2013-08-12 19:00:49 -0300 |
---|---|---|
committer | Ivan Topolnak <ivantopo@gmail.com> | 2013-08-12 19:00:49 -0300 |
commit | 18656c723881ebfd8ade43a990fe73beba5690d0 (patch) | |
tree | 34b563bc5f8913f054df15dad47a8d8e4b5b0e36 /kamon-uow | |
parent | 66957f2632eaccae4e3a354b8787fded8c6369d2 (diff) | |
download | Kamon-18656c723881ebfd8ade43a990fe73beba5690d0.tar.gz Kamon-18656c723881ebfd8ade43a990fe73beba5690d0.tar.bz2 Kamon-18656c723881ebfd8ade43a990fe73beba5690d0.zip |
fixed the instrumentation to work nicely with spray
Diffstat (limited to 'kamon-uow')
-rw-r--r-- | kamon-uow/src/main/scala/kamon/logging/UowActorLogging.scala | 4 | ||||
-rw-r--r-- | kamon-uow/src/main/scala/kamon/logging/UowDirectives.scala | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/kamon-uow/src/main/scala/kamon/logging/UowActorLogging.scala b/kamon-uow/src/main/scala/kamon/logging/UowActorLogging.scala index e117db1b..2347bbe9 100644 --- a/kamon-uow/src/main/scala/kamon/logging/UowActorLogging.scala +++ b/kamon-uow/src/main/scala/kamon/logging/UowActorLogging.scala @@ -1,13 +1,13 @@ package kamon.logging import akka.actor.Actor -import kamon.Kamon +import kamon.{Tracer, Kamon} trait UowActorLogging { self: Actor => def logWithUOW(text: String) = { - val uow = Kamon.context.map(_.userContext).getOrElse("NA") + val uow = Tracer.context.map(_.userContext).getOrElse("NA") println(s"=======>[$uow] - $text") } diff --git a/kamon-uow/src/main/scala/kamon/logging/UowDirectives.scala b/kamon-uow/src/main/scala/kamon/logging/UowDirectives.scala index e79602ea..58473f13 100644 --- a/kamon-uow/src/main/scala/kamon/logging/UowDirectives.scala +++ b/kamon-uow/src/main/scala/kamon/logging/UowDirectives.scala @@ -5,13 +5,13 @@ import spray.routing.Directive0 import spray.routing.directives.BasicDirectives import java.net.InetAddress import scala.util.Try -import kamon.Kamon +import kamon.{Tracer, Kamon} trait UowDirectives extends BasicDirectives { def uow: Directive0 = mapRequest { request => val generatedUow = Some(UowDirectives.newUow) println("Generated UOW: "+generatedUow) - Kamon.set(Kamon.newTraceContext().copy(userContext = generatedUow)) + Tracer.set(Tracer.newTraceContext().copy(userContext = generatedUow)) request @@ -21,7 +21,7 @@ trait UowDirectives extends BasicDirectives { object UowDirectives { val uowCounter = new AtomicLong - val hostnamePrefix = Try(InetAddress.getLocalHost.getHostName.toString).getOrElse("unknown-localhost") + val hostnamePrefix = Try(InetAddress.getLocalHost.getHostName).getOrElse("unknown-localhost") def newUow = "%s-%s".format(hostnamePrefix, uowCounter.incrementAndGet()) |