Newrelic on Heroku with Scala and SBT
- Add newrelic to SBT dependencies:
libraryDependencies ++= Seq("com.newrelic.agent.java" % "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/com.newrelic.agent.java/newrelic-agent/jars/newrelic-agent-3.1.1.jar"
Written by Jordi Pradel
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Scala
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#