aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego <diegolparra@gmail.com>2015-08-16 11:49:58 -0300
committerDiego <diegolparra@gmail.com>2015-08-16 11:49:58 -0300
commit8bd9c3ed83aa7af8199e076243a935644c321902 (patch)
tree0d189baf9b409e45b23546843bd590a6b0dc8551
parentc223b5a334037c5ff3d5db026e6178a92706cdb4 (diff)
downloadKamon-8bd9c3ed83aa7af8199e076243a935644c321902.tar.gz
Kamon-8bd9c3ed83aa7af8199e076243a935644c321902.tar.bz2
Kamon-8bd9c3ed83aa7af8199e076243a935644c321902.zip
! kamon-examples: update play examples before release
-rw-r--r--kamon-examples/kamon-play-example-2.4.x/app/controllers/KamonPlayExample.scala13
-rw-r--r--kamon-examples/kamon-play-example-2.4.x/project/plugins.sbt3
-rw-r--r--kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala15
-rw-r--r--kamon-examples/kamon-play-example/app/filters/TraceLocalFilter.scala4
-rw-r--r--kamon-examples/kamon-play-example/project/Build.scala4
-rw-r--r--kamon-examples/kamon-play-example/project/plugins.sbt2
6 files changed, 12 insertions, 29 deletions
diff --git a/kamon-examples/kamon-play-example-2.4.x/app/controllers/KamonPlayExample.scala b/kamon-examples/kamon-play-example-2.4.x/app/controllers/KamonPlayExample.scala
index 7f3b677d..fd6f08e7 100644
--- a/kamon-examples/kamon-play-example-2.4.x/app/controllers/KamonPlayExample.scala
+++ b/kamon-examples/kamon-play-example-2.4.x/app/controllers/KamonPlayExample.scala
@@ -27,18 +27,11 @@ import javax.inject._
import scala.concurrent._
/**
- * In order to run the example we need set the -javaagent option to the JVM, but Play have some limitations when trying to set 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/bin
- * 3- ./kamon-play-example -J-javaagent:../lib/org.aspectj.aspectjweaver-1.8.6.jar
+ * aspectj-runner:run
*
- * and finally for test:
+ * and finally testing:
*
* curl -i -H 'X-Trace-Token:kamon-test' -H 'MyTraceLocalStorageKey:extra-header' -X GET "http://localhost:9000/helloKamon"
*
@@ -50,8 +43,6 @@ import scala.concurrent._
*
* Say hello to Kamon
**/
-
-
class KamonPlayExample @Inject() (kamon: Kamon) extends Controller {
val logger = Logger(this.getClass)
diff --git a/kamon-examples/kamon-play-example-2.4.x/project/plugins.sbt b/kamon-examples/kamon-play-example-2.4.x/project/plugins.sbt
index f0037325..26bdf8cf 100644
--- a/kamon-examples/kamon-play-example-2.4.x/project/plugins.sbt
+++ b/kamon-examples/kamon-play-example-2.4.x/project/plugins.sbt
@@ -1,9 +1,10 @@
// Comment to get more information during initialization
logLevel := Level.Warn
-// The Typesafe repository
+// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.2")
+addSbtPlugin("io.kamon" % "aspectj-play-24-runner" % "0.1.3")
diff --git a/kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala b/kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala
index 29eb96ed..3f368354 100644
--- a/kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala
+++ b/kamon-examples/kamon-play-example/app/controllers/KamonPlayExample.scala
@@ -27,18 +27,11 @@ import play.libs.Akka
import scala.concurrent._
/**
- * In order to run the example we need set the -javaagent option to the JVM, but Play have some limitations when trying to set 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.6.jar play.core.server.NettyServer
+ * aspectj-runner:run
*
- * and finally for test:
+ * and finally testing:
*
* curl -i -H 'X-Trace-Token:kamon-test' -H 'MyTraceLocalStorageKey:extra-header' -X GET "http://localhost:9000/helloKamon"
*
@@ -49,9 +42,7 @@ import scala.concurrent._
* X-Trace-Token: kamon-test -> default Trace-Token
*
* Say hello to Kamon
- */*/
-
-
+ **/
object KamonPlayExample extends Controller {
val logger = Logger(this.getClass)
diff --git a/kamon-examples/kamon-play-example/app/filters/TraceLocalFilter.scala b/kamon-examples/kamon-play-example/app/filters/TraceLocalFilter.scala
index 1b4e1036..c745e7ff 100644
--- a/kamon-examples/kamon-play-example/app/filters/TraceLocalFilter.scala
+++ b/kamon-examples/kamon-play-example/app/filters/TraceLocalFilter.scala
@@ -25,9 +25,7 @@ import scala.concurrent.Future
case class TraceLocalContainer(traceToken:String, importantHeader:String)
-object TraceLocalKey extends TraceLocal.TraceLocalKey {
- type ValueType = TraceLocalContainer
-}
+object TraceLocalKey extends TraceLocal.TraceLocalKey[TraceLocalContainer]
/*
By default kamon spreads the trace-token-header-name, but sometimes is necessary pass through the application requests with some information like
diff --git a/kamon-examples/kamon-play-example/project/Build.scala b/kamon-examples/kamon-play-example/project/Build.scala
index 3c10e02c..718f765b 100644
--- a/kamon-examples/kamon-play-example/project/Build.scala
+++ b/kamon-examples/kamon-play-example/project/Build.scala
@@ -35,11 +35,11 @@ object ApplicationBuild extends Build {
"-Xlog-reflective-calls"
))
- val kamonVersion = "0.4.0"
+ val kamonVersion = "0.4.1-SNAPSHOT"
val dependencies = Seq(
"io.kamon" %% "kamon-core" % kamonVersion,
- "io.kamon" %% "kamon-play" % kamonVersion,
+ "io.kamon" %% "kamon-play-23" % kamonVersion,
"io.kamon" %% "kamon-statsd" % kamonVersion,
"io.kamon" %% "kamon-log-reporter" % kamonVersion,
"io.kamon" %% "kamon-system-metrics" % kamonVersion,
diff --git a/kamon-examples/kamon-play-example/project/plugins.sbt b/kamon-examples/kamon-play-example/project/plugins.sbt
index aa4d8b4c..bd261721 100644
--- a/kamon-examples/kamon-play-example/project/plugins.sbt
+++ b/kamon-examples/kamon-play-example/project/plugins.sbt
@@ -6,3 +6,5 @@ resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/release
// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")
+
+addSbtPlugin("io.kamon" % "aspectj-play-23-runner" % "0.1.3")