sbt Example: Play

Although Lightbend Telemetry currently does not instrument Play applications themselves you may want to set up telemetry in your Play application to instrument any Akka related tasks that happen in the context of the Play application. This section describes how to set up this type of telemetry.


When developing Play applications it is very convenient to use Play’s development run command. However, because of the way the run command is implemented it is not possible to use Lightbend Telemetry in combination with this command. Instead you have to build the Play application as a distribution and run that - more information about this here below.


The following must be installed for these instructions to work:

  • Java
  • sbt
  • Bintray credentials

Bintray credentials

Follow these instructions to set up your Bintray credentials for sbt.


Start off by adding Cinnamon to the project/plugins.sbt file:

addSbtPlugin("" % "sbt-plugin" % "2.6.2")

addSbtPlugin("com.lightbend.cinnamon" % "sbt-cinnamon" % "2.6.2")

credentials += Credentials(Path.userHome / ".lightbend" / "commercial.credentials")

resolvers += Resolver.url("lightbend-commercial",

Make sure that the credentials setting points to where you chose to create the commercial credentials file.

The next step is to amend the build.sbt to contain Cinnamon:

lazy val root = (project in file(".")).enablePlugins(PlayScala, Cinnamon)

libraryDependencies ++= Seq(

Finally you should ensure that you have a configuration file (conf/application.conf) that instructs Cinnamon on how to instrument Akka. The example below sets up using the Console reporter:

cinnamon.application = "hello-play-telemetry"

cinnamon.akka {
  actors {
    "/user/*" {
      report-by = class

cinnamon.chmetrics {
  reporters += console-reporter


When you have configured your Play application in accordance with the instructions here above you can run it. As previously explained you cannot use sbt run with the Cinnamon Agent. We still urge you to use the run command during development of the Play application. This is one of the things that make Play a true development friendly environment. When you want to test your application with telemetry you can do so with this command:

sbt runProd