I'm adding kamon
to my standalone akka application and i'm getting this error:
com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'requires-aspectj'
error at Kamon.start()
.
This is the relative content of application.conf.
{
...
modules {
kamon-akka {
auto-start = no
}
kamon-statsd {
auto-start = no
}
kamon-system-metric {
auto-start = no
requires-aspectj = no
extension-id = "kamon.system.SystemMetrics"
}
}
}
application.conf: 36: requires-aspectj has type STRING rather than OBJECT
However, when I include the asked property
{
modules {
requires-aspectj = no
...
}
}
I get this error: application.conf: 36: requires-aspectj has type STRING rather than OBJECT
If i remove Kamon.start()
my application starts as usual
This is an extract of the my build.sbt:
lazy val root = (project in file("."))
.settings(name := "kamon-akka")
.settings(Seq(scalaVersion := "2.11.8"))
.settings(libraryDependencies ++= Seq(
akka.Http,
akka.slf4jApi,
akka.akkaSlf4j,
kamon.Core,
kamon.Akka,
kamon.LogReporter,
kamon.SystemMetrics,
aspectj.aspectjtools,
aspectj.aspectjweaver,
aspectj.aspectjrt
))
.settings(aspectjSettings: _*)
PS:
addSbtPlugin("com.typesafe.sbt" % "sbt-aspectj" % "0.9.4")
any ideas?
First, your application.conf
looks strange in that it doesn't appear to have a kamon
namespace. It should look like the following (take note of the first line):
kamon {
...
modules {
kamon-akka {
...
}
kamon-statsd {
...
}
kamon-system-metrics {
...
}
}
}
Second, since you're using the sbt-aspectj
plugin, add the following to your build.sbt
(source: http://kamon.io/documentation/get-started/):
import com.typesafe.sbt.SbtAspectj._
// Bring the sbt-aspectj settings into this build
aspectjSettings
// Here we are effectively adding the `-javaagent` JVM startup
// option with the location of the AspectJ Weaver provided by
// the sbt-aspectj plugin.
javaOptions in run <++= AspectjKeys.weaverOptions in Aspectj
// We need to ensure that the JVM is forked for the
// AspectJ Weaver to kick in properly and do it's magic.
fork in run := true