Last Updated: February 25, 2016
· agile_jordi

Newrelic on Heroku with Scala and SBT

  • Add newrelic to SBT dependencies:
libraryDependencies ++= Seq("" % "newrelic-agent" % "3.1.1")
  • Add newrelic.yml file to the project root

  • Add JAVA_OPTS to Procfile:

web: target/start Runner $JAVA_OPTS
  • Commit, push, deploy to Heroku

  • Connect to Heroku to see where newrelic-agent lives:

heroku run bash
~ $ cat target/start
  • Add newrelic agent property to JAVA_OPTS:
heroku config:set JAVA_OPTS="-Xmx384m -Xss512k -XX:+UseCompressedOops -javaagent:./.sbt_home/.ivy2/cache/"