New relic on Heroku, how to get it to work?
Asked Answered
L

4

5

I have deployed a Scala, play framework, application on Heroku. And I have added the new relic add-on to my app.

I have followed the Java guide as Scala runs on the Java VM.

$ heroku addons:add newrelic:standard
-----> Adding newrelic:standard to ... done, v7 (free)

Unziped newrelic to newrelic in the application

$ git add newrelic
$ git commit -m 'add newrelic'
$ heroku config:add JAVA_OPTS='-Xmx384m -Xss512k -XX:+UseCompressedOops -javaagent:newrelic/newrelic.jar'
$ git push heroku master

Now to the problems. First when I accessed the add on I had to create a new account on new relic with new password and it wanted my credentials? Is this correct? Shouldn't my Heroku account suffice, I later think it started to work.? Strange process so now I believe I have two accounts. In Herokus page my account is standard hourly and in new relics it's standard lite.

I don't understand how to see my performance stats. I actually think that the new relic isn't set up correctly?

One absurd thing is the new relics homepage which says not sufficient permissions on everything except "tell a friend and earn bucks" not even support works WTF.

I have attached two screenshot with my credentials masked. can anyone comment if they look like they should or if the new relic has set up itself incorrectly?

enter image description here enter image description here

Locker answered 23/11, 2011 at 20:36 Comment(2)
Did you access the New Relic site from the Heroku add-on page on api.heroku.com/myapps ?Claybourne
Yes at least in the first picture. That is the result of the add-on drop down -> New RelicLocker
T
3

You should be able to use New Relic through the heroku interface without creating a separate account.

Once you're app is deployed with the agent, and has gotten a few requests you should start seeing data in the interface.

The agent does create a log (I believe you can get output via heroku logs) so that might also help you troubleshoot it.

I'd suggest opening a support ticket on http://support.newrelic.com.

Towardly answered 23/11, 2011 at 21:20 Comment(1)
Yeah, you really don't want to create a separate account. You can have terrible performance if you do this, for obscure technical reasons.Digestible
O
3

This could be happening because your hosted application does not have the right credentials (e.g license key) provided by newrelic.

Did you update the default newrelic.yml file obtained from the 'newrelic.jar' extract? You can obtain your app's license key in the account settings menu when accessing newrelic through the heroku interface (your 1st screenshot). Then set the following config vars on heroku;

NEW_RELIC_LICENSE_KEY="your license key"
NEW_RELIC_APP_NAME="your app name"

Don't forget to set the appropriate RACK_ENV config var too e.g RACK_ENV=production

Then update your newrelic.yml file by finding and changing the following lines;

license_key: '<%= license_key %>' to license_key: '<%= ENV["NEW_RELIC_LICENSE_KEY"] %>'

app_name: My Application to app_name: '<%= ENV["NEW_RELIC_APP_NAME"] %>'

app_name: My Application (Development) to app_name: '<%= ENV["NEW_RELIC_APP_NAME"] (Development) %>'

app_name: My Application (Staging) to app_name: '<%= ENV["NEW_RELIC_APP_NAME"] (Staging) %>'

Here is a sample newrelic.yml file with environment vars set.

You should be able to access new relic from heroku interface after you've pushed your changes.

Outfoot answered 20/10, 2012 at 6:51 Comment(0)
J
3

Check whether you find anything in the heroku logs with heroku logs. Also, you can increase the log level of new relic by setting the system properties newrelic.config.log_level and newrelic.debug. Also note that after creation of a new account or after password changes it takes a while until the changed credentials are propagated.

To set a finer log log level:

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

Make sure to not run with that in production. It produces quite a lot of logs.

See our blog post about how to setup New Relic with Play 2.1/Scala on Heroku: http://techblog.nezasa.com/2013/08/performance-monitoring-of-nezasa-with.html

Jola answered 13/8, 2013 at 20:40 Comment(0)
A
0

When I attempted to use New Relic on Heroku I was prompted to enter credit card information

$ heroku addons:add newrelic:standard

but I just exited out and the logging for my Rails application is working*. Note that depending on your New Relic settings you may just be logging locally (default for development mode does not log to the cloud but is accessible locally).

Sorry to pollute this thread with Ruby stuff, but you may find something similar with regards to Heroku and New Relic.

*update: I had the same issue again when deploying another application and realized that to use the Heroku New Relic add-on you have to provide credit card information, but if you just directly instrument your application you do not have to give credit card information. YOu do have to have created an account already, though.

Allain answered 17/5, 2013 at 15:29 Comment(2)
just a note that there isn't a development mode on the Java version of the New Relic agent, Ruby only.Everard
If you add the heroku new relic add on Heroku creates a new New Relic account for you. E.g. a free one if you choose the Wayne package heroku addons:create newrelic:wayne . But you are free to connect directly to New Relic without the add on if you already have a license key for New Relic. Your choice.Army

© 2022 - 2024 — McMap. All rights reserved.