This sample demonstrates how to add Micrometer-Akka metrics to your application.
Micrometer Metrics compares itself to SLF4J, but for metrics
.
All you need to do is add a dependency on the micrometer-akka jar, add some configuration to your application.conf and to enable aspectjweaver.
The application.conf requires your dynatrace configs (API key and URI).
This sample uses micrometer-registry-dynatrace to have the metrics pushed to Dynatrace. This is setup in Main.scala.
sbt clean run
This sample uses sbt-javaagent to enable aspectjweaver. This plugin basically adds this to the java runtime command.
-javaagent:/path/to/aspectjweaver-1.9.2.jar
If you want to use micrometer-akka with your own application, ensure that you startup script adds something like this:
JAVA_AGENT="-javaagent:$BASE/lib/aspectjweaver-1.9.2.jar"
$JAVA_HOME/bin/java $JAVA_AGENT -cp $CP $JVM_OPTS $CLASS_NAME
To query the hello endpoint, use:
curl http://localhost:12345/hello
The metrics are simple akka metrics and calling the hello endpoint generates some traffic to monitor.