Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play's application.conf ignored by Kamon when I load the kamon-akka module #343

Closed
gaelrenoux opened this issue Apr 21, 2016 · 4 comments
Closed
Assignees

Comments

@gaelrenoux
Copy link

gaelrenoux commented Apr 21, 2016

I have a Play application (with Scala). In one controller, I inject the actor system and start a few actors to accomplish background tasks.

I have just set up Kamon (0.6.0) with Statsd, Graphite and Graphana as the back-end. With these modules, everything works fine:

  • kamon-core
  • kamon-system-metrics
  • kamon-scala
  • kamon-play-24
  • kamon-statsd

I use the aspectj-play-runner plugin and start my application with aspectj-runner:run. The Kamon.start() is in the Global.onStart(Application) method.

However, as soon as I add kamon-akka in my build.sbt, Kamon seems not to be able to read the configurations values in conf/application.conf any more. I have put a debug point in SimpleMetricKeyGenerator (when it reads "kamon.statsd.simple-metric-key-generator"):

  • without kamon-akka, the values in configSettings are those coming from my configuration ;
  • with kamon-akka, the values in configSettings are the defaut values.

Play still has access to the values in conf/application.conf, though.

@dpsoft
Copy link
Contributor

dpsoft commented Apr 21, 2016

@gaelrenoux the kamon-play-24 module have a guice module for autostarting, if you are starting kamon in your Globa.onStart you need disable the guice module with play.modules.disable += kamon.play.di.KamonModule.
In relation to the configuration issue, sounds like a bug in the aspectj-runner plugin and I need some time to investigate.

you can try with aspectj-runner:run -Dconfig.resource=application.conf

@gaelrenoux
Copy link
Author

gaelrenoux commented Apr 26, 2016

Thanks for the advice, I removed the Kamon.start and Kamon.stop.

I got some time to look a bit more into it, I uploaded a sample application here. It works fine as is. But uncomment kamon-akka in build.sbt, and you have a problem on startup where it doesn't find application.conf.

I tried the following but it didn't help :
aspectj-runner:run -Dconfig.resource=application.conf
aspectj-runner:run -Dconfig.resource=conf/application.conf
aspectj-runner:run -Dconfig.resource=/full/path/to/conf/application.conf

@ozgunatacan
Copy link

This is probably related:
kamon-io/sbt-aspectj-runner#5

@dpsoft
Copy link
Contributor

dpsoft commented Jul 24, 2016

@gaelrenoux sorry for the late response ;(, but If you run the example with aspectj-runner:run -Dconfig.file=conf/application.conf and everything is ok.
I think that the issue is related to kamon and play DEV mode but I need more time to research.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants