Frage

I'm trying to set up new relic again (I tried some time ago with no success). I'm using heroku, and a Play 2.x application. I uploaded the newrelic agent, the yml file, everything properly configured. Then I tried to add -javaagent:newrelic/newrelic.jar to JAVA_OPTS variable (as stated in Heroku docs), which did nothing. So I looked at the logs and found out that heroku is actually using JAVA_TOOL_OPTIONS (I think). So I added the javaagent to that variable:

$ heroku config:set JAVA_TOOL_OPTIONS="-Djava.rmi.server.useCodebaseOnly=true -javaagent:newrelic/newrelic.jar"

After restarting the app, it looks like it actually did something because the app wouldn't start, showing this error:

"The java installation you have is not up to date requires at least version 1.6+, you have version 1.7.0_45."

I tried both with Java 6 and 7, with no success.

What am I doing wrong?

War es hilfreich?

Lösung

Instead of using JAVA_OPTS try to set the variable as java_opts. I know it seems strange but this should actually resolve the issue and get Heroku, Play and New Relic to be nice to one another.

You also want to modify your Procfile adding the following:

web: target/universal/stage/bin/YOUR_APP_NAME -Dhttp.port=${PORT} -J-javaagent:/app/newrelic/newrelic.jar -J-Dnewrelic.config.file=conf/newrelic.yml

Cheers Adrienne (TSE at New Relic. Inc)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top