diff options
Diffstat (limited to 'kamon-examples/kamon-play-example')
-rw-r--r-- | kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala | 19 | ||||
-rw-r--r-- | kamon-examples/kamon-play-example/project/Build.scala | 7 |
2 files changed, 21 insertions, 5 deletions
diff --git a/kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala b/kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala index 62e36c16..26b0af7b 100644 --- a/kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala +++ b/kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala @@ -22,7 +22,21 @@ import play.api.mvc.{Action, Controller} import scala.concurrent._ -/* + +/** +In order to run the example we need set the -agent parameter to the JVM but Play have some limitations when trying setear an +java agent in Play dev mode (ie, play run) -> https://github.com/playframework/playframework/issues/1372, so we have others options: + + +The first option is set -javaagent: path-to-aspectj-weaver in your IDE or + +Run the following commands from console: + +1- play stage +2- cd target/universal/stage +3- java -cp ".:lib/*" -javaagent:lib/org.aspectj.aspectjweaver-1.8.1.jar play.core.server.NettyServer + +and finally for test: curl -i -H 'X-Trace-Token:kamon-test' -H 'MyTraceLocalStorageKey:extra-header' -X GET "http://localhost:9000/helloKamon" @@ -35,8 +49,9 @@ X-Trace-Token: kamon-test -> default Trace-Token Content-Length: 18 Say hello to Kamon + **/ **/ + - */ object KamonPlayExample extends Controller { val logger = Logger(this.getClass) diff --git a/kamon-examples/kamon-play-example/project/Build.scala b/kamon-examples/kamon-play-example/project/Build.scala index 9e615314..c348862a 100644 --- a/kamon-examples/kamon-play-example/project/Build.scala +++ b/kamon-examples/kamon-play-example/project/Build.scala @@ -36,9 +36,10 @@ object ApplicationBuild extends Build { )) val dependencies = Seq( - "io.kamon" %% "kamon-core" % "0.3.1", - "io.kamon" %% "kamon-play" % "0.3.1", - "io.kamon" %% "kamon-statsd" % "0.3.1" + "io.kamon" %% "kamon-core" % "0.3.1", + "io.kamon" %% "kamon-play" % "0.3.1", + "io.kamon" %% "kamon-statsd" % "0.3.1", + "org.aspectj" % "aspectjweaver" % "1.8.1" ) val main = Project(appName, file(".")).enablePlugins(play.PlayScala, SbtWeb) |