unable run kamon with kamon-play-24 and kaon-akka

559 views
Skip to first unread message

andrea...@gmail.com

unread,
Oct 20, 2015, 11:01:47 AM10/20/15
to kamon-user
Hi,

I'm trying to setup my play 2.4 app with kamon to obtain tracing of play requests and actor messages.
My configuration is:


in plugins.sbt:
...
addSbtPlugin("io.kamon" % "aspectj-play-runner" % "0.1.3")
...


in build.sb:
...
scalaVersion := "2.11.7"
...
val kamonVersion = "0.5.2"

libraryDependencies ++= Seq(

"io.kamon" %% "kamon-core" % kamonVersion,

"io.kamon" %% "kamon-play-24" % kamonVersion,

"io.kamon" %% "kamon-akka" % kamonVersion,

"io.kamon" %% "kamon-log-reporter" % kamonVersion

)
...

in application.conf:
...
kamon.metric.filters {
akka-actor {
includes = ["application/user/**" ]
excludes = ["kamon/**" ]
}
}

When I do the aspects-runner:run command in sbt the system give me back the following stack trace:

java.lang.RuntimeException: Kamon has not been started yet. You must either explicitly call Kamon.start(...) or enable automatic startup by adding -Dkamon.auto-start=true to your JVM options.


If I add -Dkamon.auto-start=true to the previous command the system responds:

com.typesafe.config.ConfigException$IO: application.conf: java.io.IOException: resource not found on classpath: application.con

If I remove kamon-akka from build.sbt the system works fine but I don't see any actor tracing.

Can you give me some hints on how to resolve the problem?

Thanks a lot

Andrea

Diego Parra

unread,
Oct 21, 2015, 2:52:06 PM10/21/15
to kamon...@googlegroups.com
Andrea,

sorry for the late response you can try: aspectj-runner:run -Dconfig.resource=whatever.conf

Cheers,

Diego


--
You received this message because you are subscribed to the Google Groups "kamon-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kamon-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

andrea...@gmail.com

unread,
Oct 21, 2015, 3:03:18 PM10/21/15
to kamon-user
Hi Diego

if I use

aspectj-runner:run -Dconfig.resource=application.conf

I obtain the usual

java.lang.RuntimeException: Kamon has not been started yet. You must either explicitly call Kamon.start(...)

if I use

aspectj-runner:run -Dkamon.auto-start=true -Dconfig.resource=application.conf

the response is

com.typesafe.config.ConfigException$IO: application.conf: java.io.IOException: resource not found on classpath: application.con


if I use

aspectj-runner:run -Dkamon.auto-start=true -Dconfig.file=conf/application.conf

the response is

com.typesafe.config.ConfigException$Generic: You set more than one of config.file='conf/application.conf', config.url='null', config.resource='application.conf'; don't know which one to use!

Thanks a lot

Andrea

Andrew Richards

unread,
Dec 1, 2015, 9:25:13 AM12/1/15
to kamon-user, andrea...@gmail.com
Hi,

I had this same problem. It happens when you add kmon-akka a play project (2.4 on 2.11.7 in my case). You can reproduce it from the kamon-play-example-2.4.x just  by adding kamon-akka.

I was able to get it to work using:

[myapp] $ aspectj-runner:run -Dconfig.file=conf/application.conf -Dkamon.auto-start=true

Using -Dconfig.resource didn't work. The classpath must be screwed up when the config is loaded.

*Note* if you run the following during a session (ie with out -Dconfig.file):

aspectj-runner:run -Dkamon.auto-start=true

it will stop working as something (sbt, play or aspectj-play-runner) sets the value for -Dconfig.resource) and you get the following message

com.typesafe.config.ConfigException$Generic: You set more than one of config.file='conf/application.conf', config.url='null', config.resource='application.conf'; don't know which one to use!

then you have to restart sbt for it to work again.

Cheers,

Andrew

Diego Parra

unread,
Dec 1, 2015, 9:53:23 AM12/1/15
to kamon...@googlegroups.com
Hi Andrew,

this issue was fixed in https://github.com/kamon-io/Kamon/issues/248. Kamon 0.6.0 will come out soon we are working on some changes in the akka instrumentation that is more like a huge rewrite once these changes are done we will publish snapshots for people to try it out and make sure it works nice and then publish.
Reply all
Reply to author
Forward
0 new messages