I'm having real trouble making new relic work on my grails app in Heroku, This are the things I've tried without success:
- Downloaded the java agent
- Uzip it on the root folder of my app, it creates a folder called new relic
- Added to the JAVA_OPTS "-javaagent:newrelic/newrelic.jar"
- Then heroku can't start, I get "Process exited with status 1" and "State changed from starting to crashed"
- Configured the buildConfig.groovy file, set dependencies to: provided 'com.newrelic.agent.java:newrelic-agent:3.7.0'
- Set the NEWRELIC_HOME = 'newrelic' folder
- Set JAVA_OPTS='-Xmx384m -Xss512k -XX:+UseCompressedOops -javaagent:target/dependency/newrelic-agent.jar' NEW_RELIC_APP_NAME="YOUR APP NAME GOES HERE"
- Heroku can't start either I get: "Unrecognized VM option 'UseCompressedOops -javaagent:target/dependency/newrelic-agent.jar''"
- Tried all this but instead of JAVA_OPTS used GRAILS_OPTS
- Nothing really happened
The one I supposed should had worked is the second one but in the heroku site there is a part for the maven configuration I don't know how to setup that says: "Customize the build section so it always names the newrelic-agent.jar consistently." maybe there's something there that I'm missing but I wouldn't know what.
So, do you know how to make it work?
Thanks
I made it work, the answer was in option one but to change the JAVA_OPTS I needed to use the console.
This sentence worked:
heroku config:add JAVA_OPTS='-Xmx384m -Xss512k -XX:+UseCompressedOops -javaagent:newrelic/newrelic.jar'
Hope it helps!