I want to find a way to make monitoring Play Application as simple as possible. Now I find one tool, named “New Relic” which already supports Play Framework. Here is a summary about how to involve New Relic to your application.
- Step1: you need to login New Relic. (you need to see monitor result on your own account)
- 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.
Advertisements