With previous version of the Java Play framework, we could provide a command line argent to load monitoring agents. For example, NewRelic could be loaded as
./path/to/start -javaagent:/path/to/newrelic.jar
With the release of the 2.2, the Play team has significantly changed the start script. From what I can tell, it no longer supports javaagents. Has any else gotten NewRelic running with Java Play 2.2+? Play is great, but its useless tech if you can't monitor it in a production environment...
It seems that you can prefix Java options with -J
(in a manner similar to system properties using -D
):
$ bin/<app> -J-javaagent:lib/newrelic.jar
Discovered this while poking around in the script itself but it is noted in the usage summary:
$ bin/<app> -h
Usage: [options]
...
-J-X pass option -X directly to the java runtime
(-J is stripped)
...
With the new native packager in Play Framework 2.2 you need to set Java options in the JAVA_OPTS
environment variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With