我在 Akka 中创建了一个示例服务,用于测试 Kamon + DataDog 监控。
这是我添加的依赖项:
"io.kamon" %% "kamon-core" % "1.1.0",
"io.kamon" %% "kamon-datadog" % "1.0.0",
"io.kamon" %% "kamon-akka-2.5" % "1.0.1"
以下是启用的插件build.sbt
:
.enablePlugins(AshScriptPlugin, DockerPlugin, SbtAspectJRunner)
然后application.conf
:
kamon {
datadog {
time-units = "ms"
memory-units = "b"
}
util {
filters {
"akka.tracked-actor" {
includes = [ "testSystem/user/**" ]
excludes = [ "testSystem/system/**" ]
}
"s3-worker-actors" {
includes = [ "testSystem/user/s3Router/*" ]
}
"fb-worker-actors" {
includes = [ "testSystem/user/fbRouter/*" ]
}
"akka.tracked-router" {
includes = [ "testSystem/user/s3Router", "testSystem/user/fbRouter" ]
}
"akka.tracked-dispatcher" {
includes = [ "**" ]
}
"akka.traced-actor" {
includes = [ "**" ]
}
}
}
akka.actor-groups = [ "s3-worker-actors", "fb-worker-actors" ]
}
最后在Main
我调用的类中:
Kamon.addReporter(new DatadogAgentReporter())
在 EC2 上,我为 docker 安装了 datadog-agent。
当我在 EC2 实例上运行服务容器然后查看 DataDog 界面时,我没有看到任何与 akka 相关的指标,只是一个标准指标列表,例如:datadog.process.agent
、docker.cpu.usage
等system.io.await
如果将 akka 应用程序打包到 docker 并部署在 EC2 上,如何启用 akka 相关指标?