3
votes

I have a play! app running in production and I'm trying to add new relic monitoring to it.

According to this blog post (http://blog.newrelic.com/2013/06/05/play-2/), it's as simple as adding a few parameters when starting the play app. Right now I'm running my play app by running the play clean compile stage command and then starting the start script in the /bin folder. When I try to add the new relic parameters, I get a "bad application path newrelic.jar" but the file is present.

Here's the command I'm running to start my play app:

sudo ./myapp -Dconfig.resource=application_deploy.conf -javaagent:newrelic.jar -Dnewrelic.bootstrap_classpath=true

Any ideas? Thanks

2
Did you manage to use NewRelic with play stage or did you have to use play dist?pathikrit

2 Answers

1
votes

I suggest using a fully qualified path to the newrelic.jar as shown in the examples at https://docs.newrelic.com/docs/java/play-installation-for-java

Also, keep an eye out for information from New Relic about an updated version of the Java agent that includes improved support for the Play 2.2+ framework.

Hopefully, this information will help do the trick.

0
votes

Here are the steps to make New Relic to your Play Framework Application. Or you can go to my blog to see it(https://lihaimei.wordpress.com/2015/05/19/play-framework-application-monitor-tool-new-relic/).

Step1: you need to login New Relic. (you need to see monitor result on your own account)

http://www.newrelic.com

Step2: you need to download java agent.

please note: you’d better unzip this agent’s zip to /path/to/appRoot/

Step3: you need to use “activator dist” to re-build your application.

Please note: third command: if you want to make it simple, you just need to add “-J-javaagent” to your command. Others are just configure JVM. If you want to configure New Relic, you just go to newrelic/newrelic.yml to modify your application’s name or others.

activator clean dist && unzip target/universal/*.zip

cd target/universal/YourUnzipFolder/

./bin/YourApplicationName -J-javaagent:../../../newrelic/newrelic.jar -Duser.timezone=GMT -Dhttp.port=9081 -J-Xms4096m -J-Xmx4096m -J-Xmn2048m

Step4: done. you just need to go back to your New Relic Account to see the result.

If you don’t know where to see your result. You can go to /newrelic/logs/newrelic_agent.log to see its log, like “Reporting to: https://rpm.newrelic.com/accounts/956482/applications/8407159″. Of course, different application has different id.