Adding a new relic add-on to the game heroku play 2.2.1 java app

Here is what I want to do. → Deploy the playback platform (2.2.1) the Java web application on Heroku and use newrelic as an add-on.

** Problem / Problem: **

These are the steps that I have taken so far.

1) I can add an addon using the heroku command of the addon "hero addons: add newrelic: stark" I see the hero adding to the resources.

2) Adding the newrelic.yml file. The newrelic.yml file was added as attached and saved in the conf folder in the playback structure (there was an application.conf file). The file I took is https://gist.github.com/anfuerer/6169040 (only updated license and application information)

3) As a replay 2.2.1, I modified the built.sbt file to add dependencies.

"com.newrelic.agent.java" % "newrelic-agent" % "3.4.0",
  "com.newrelic.agent.java" % "newrelic-api" % "3.4.0"

4) My Procfile, necessary for the hero, has the specified JAVA_OPTS, and JAVA_OPTS is set using the command

heroku config: set JAVA_OPTS = "- Xmx384m -Xss512k -XX: + UseCompressedOops -Dfile.encoding = UTF-8 -javaagent: target / staged / newrelic-agent-3.4.0.jar -Dnewrelic.bootstrap_classpath = true - Dnewrelic. .file =. / Conf / newrelic.yml newrelic.config.log_level = finer newrelic.debug = true "

5), obviously, all changes are added to git and are made before clicking on the hero with the command "git heroku push master".

6) some basic sanity test. I see my configuration after the heroku configuration command as -

JAVA_OPTS:             -Xmx384m -Xss512k -XX:+UseCompressedOops -Dfile.encoding=UTF-8 -javaagent:target/staged/newrelic-agent-3.4.0.jar -Dnewrelic.bootstrap_classpath=true -Dnewrelic.config.file=./conf/newrelic.yml newrelic.config.log_level=finer newrelic.debug=true
NEW_RELIC_APP_NAME:   test_application
NEW_RELIC_LICENSE_KEY: 000000000000000000000000000000000  (changed offcourse)
NEW_RELIC_LOG:         stdout
PATH:                  .jdk/bin:.sbt_home/bin:/usr/local/bin:/usr/bin:/bin
REPO:                  /app/.sbt_home/.ivy2/cache
SBT_OPTS:              -Xmx384m -Xss512k -XX:+UseCompressedOops

Also tried to check "heroku run env | grep NEW_RELIC", which gives me the output -

NEW_RELIC_LOG=stdout
NEW_RELIC_LICENSE_KEY=00000000000000000000000000000
NEW_RELIC_APP_NAME=test_application

Now I go to the Heroku application toolbar, click on my application to see the add-ons and click on the new relic, and I come to the screen that asks me to configure my application -

I click on the setting, but it forces me to download the Java agent, and it wants me to install the java agent on the web server.

#################EDIT

Trying to install java newrelic in the Play platform of the application according to the comment by @Jeanie

1) upload the new reic java agent to the download folder.

2) unzip the application folder for the game framework (project folder) (is it necessary to be the folder of the playback frame in which the files are created?), Using

unzip newrelic_agent3.4.0.zip -d /path/to/appserver/

3) change the directory in / appfolder / newrelic /

4) install cans using

java -jar newrelic.jar install

5) This is the message I receive.

Jan 20, 2014 12:48:39 -0700 [6935 1] com.newrelic INFO: Agent is using Logback
***** ( ( o))  New Relic Java Agent Installer
***** Installing version 3.4.0 ...
Could not edit start script because:
 .:. Could not locate a Tomcat, Jetty, JBoss, JBoss7 or Glassfish instance in /home/amit/Applications/play-2.2.1/appfolder/
Try re-running the install command with the -s <AppServerRootDirectory> option or from <AppServerRootDirectory>/newrelic.
If that doesn't work, locate and edit the start script manually.
No need to create New Relic configuration file because:
 .:. A config file already exists: /home/amit/Applications/play-2.2.1/appfolder/newrelic/newrelic.yml
***** Install incomplete
***** Next steps:
For help completing the install, see https://newrelic.com/docs/java/new-relic-for-java

Am I missing something? Please note that this is an application for the Play platform, and I want newrelic addon to work on heroku, and not locally on my machine.

#

Questions:

1) How to install a java agent on a hero? Do I need first?

2) Should I add a hero and a new relic to my application, since I already added api and java agent as an addition as step 3 ??

Any help or guidance appreciated.

+4
source share
2 answers

The problem is resolved. Here are the steps.

1) Get an update on Heroku through

$ heroku addons:add newrelic:stark

2) . . , .

3) , Java, , jar.

4) , jars . , , Heroku.

5) Heroku Procfile, :

web: target/universal/stage/bin/myapp -Dhttp.port=${PORT} ${java_opts} -DapplyEvolutions.default=true -Ddb.default.driver=com.mysql.jdbc.Driver -Ddb.default.url=${CLEARDB_DATABASE_URL} -J-javaagent:newrelic/newrelic.jar -J-Dnewrelic.config.file=newrelic/newrelic.yml 

( , , myapp " target/universal/stage/bin/myapp)

6) build.sbt Build.scala

"com.newrelic.agent.java" % "newrelic-agent" % "3.7.0"

7) , git push heroku master

8) , .

- - , .

+6

All Articles