Gradle
Akka Insights uses a Java Agent to add specially crafted instrumentation to the Lightbend Platform for efficient telemetry.
You will need to add the agent to your Gradle build and deployment to enable the telemetry.
Commercial credentials
To gain access to Akka Insights you must have a Lightbend subscription and Lightbend account.
Once you have logged in, the Lightbend platform credentials guide contains instructions for configuring your sbt, maven or gradle project to access Lightbend’s commercial dependencies, including Telemetry. If you have previously used a username and password to configure your commercial credentials, the guide will instruct you how to update to using the new scheme.
The URLs generated as part of your Lightbend platform credentials should not be committed to public source control repositories.
If you do not have a Lightbend subscription, please contact us to request an evaluation.
Getting the Agent
To automatically pull down the agent as part of your build, you can add the following.
// Add the agent to a separate configuration so it doesn't add to the normal class path
configurations {
agent
}
dependencies {
agent group: 'com.lightbend.cinnamon', name: 'cinnamon-agent', version: '2.19.4'
}
Adding the Agent
Next, the agent needs to be added as a java command line option. Here is a sample of how to add the agent to the run and test configurations.
run.doFirst {
jvmArgs "-javaagent:${configurations.agent.singleFile}"
}
test.doFirst {
jvmArgs "-javaagent:${configurations.agent.singleFile}"
}
Complete Sample
Here is a complete sample of a Gradle build file configured to use the Cinnamon Agent
, the Coda Hale Metrics plugin, Akka Instrumentation, and Akka HTTP Instrumentation.
apply plugin: 'java'
// Add the agent to a separate configuration so it doesn't add to the normal class path
configurations {
agent
}
dependencies {
agent group: 'com.lightbend.cinnamon', name: 'cinnamon-agent', version: '2.19.4'
}
// Use Coda Hale Metrics
dependencies {
implementation group: 'com.lightbend.cinnamon', name: 'cinnamon-chmetrics', version: '2.19.4'
}
// Use Akka instrumentation
dependencies {
implementation group: 'com.lightbend.cinnamon', name: 'cinnamon-akka_2.13', version: '2.19.4'
}
dependencies {
implementation group: 'com.lightbend.cinnamon', name: 'cinnamon-akka-typed_2.13', version: '2.19.4'
}
dependencies {
implementation group: 'com.lightbend.cinnamon', name: 'cinnamon-akka-persistence_2.13', version: '2.19.4'
}
dependencies {
implementation group: 'com.lightbend.cinnamon', name: 'cinnamon-akka-stream_2.13', version: '2.19.4'
}
dependencies {
implementation group: 'com.lightbend.cinnamon', name: 'cinnamon-akka-projection_2.13', version: '2.19.4'
}
// Use Akka HTTP instrumentation
dependencies {
implementation group: 'com.lightbend.cinnamon', name: 'cinnamon-akka-http_2.13', version: '2.19.4'
}
// Use Akka gRPC instrumentation
dependencies {
implementation group: 'com.lightbend.cinnamon', name: 'cinnamon-akka-grpc_2.13', version: '2.19.4'
}
dependencies {
implementation group: 'com.typesafe.akka', name: 'akka-actor_2.13', version: '2.9.1'
}
run.doFirst {
jvmArgs "-javaagent:${configurations.agent.singleFile}"
}
test.doFirst {
jvmArgs "-javaagent:${configurations.agent.singleFile}"
}