我将kamon添加到独立的akka应用程序中,并得到以下错误:
com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'requires-aspectj'错误在Kamon.start()。
这是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
但是,当我包括所请求的属性时
{
modules {
requires-aspectj = no
...
}
}我得到了一个错误:application.conf: 36: requires-aspectj has type STRING rather than OBJECT
如果我删除了Kamon.start(),我的应用程序就像往常一样启动
这是我的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")有什么想法吗?
发布于 2017-11-13 14:27:13
首先,您的application.conf看起来很奇怪,因为它似乎没有kamon名称空间。它应该如下所示(请注意第一行):
kamon {
...
modules {
kamon-akka {
...
}
kamon-statsd {
...
}
kamon-system-metrics {
...
}
}
}其次,由于您使用的是sbt-aspectj插件,所以将以下内容添加到您的build.sbt中(源代码: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 := truehttps://stackoverflow.com/questions/47242705
复制相似问题