diff options
author | Diego <diegolparra@gmail.com> | 2014-06-28 13:05:52 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2014-06-28 13:05:52 -0300 |
commit | 345b195782adc825cc4f97eb8d1c87ea22d1d0f9 (patch) | |
tree | 6b4b043ef92d4a1661e929520de0e6dd04d50175 /kamon-examples/kamon-play-example/app | |
parent | 0279260cde60505f311aeed08b4706a4dc6fded0 (diff) | |
download | Kamon-345b195782adc825cc4f97eb8d1c87ea22d1d0f9.tar.gz Kamon-345b195782adc825cc4f97eb8d1c87ea22d1d0f9.tar.bz2 Kamon-345b195782adc825cc4f97eb8d1c87ea22d1d0f9.zip |
= kamon-examples: updated play example with the TraceName Action
Diffstat (limited to 'kamon-examples/kamon-play-example/app')
-rw-r--r-- | kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala b/kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala index e5fd78b0..62e36c16 100644 --- a/kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala +++ b/kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala @@ -15,6 +15,7 @@ * ========================================================== */ package controllers +import kamon.play.action.TraceName import play.api.Logger import play.api.libs.concurrent.Execution.Implicits.defaultContext import play.api.mvc.{Action, Controller} @@ -40,10 +41,20 @@ object KamonPlayExample extends Controller { val logger = Logger(this.getClass) - def sayHelloKamon() = Action.async { + def sayHello() = Action.async { Future { logger.info("Say hello to Kamon") Ok("Say hello to Kamon") } } + + //using the Kamon TraceName Action to rename the trace name in metrics + def sayHelloWithTraceName() = TraceName("my-trace-name") { + Action.async { + Future { + logger.info("Say hello to Kamon") + Ok("Say hello to Kamon") + } + } + } } |