Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New relic on Heroku, how to get it to work?

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 hereenter image description here

like image 732
Farmor Avatar asked Nov 23 '11 20:11

Farmor


2 Answers

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.

like image 188
samg Avatar answered Nov 09 '22 08:11

samg


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.

like image 3
dantheta Avatar answered Nov 09 '22 10:11

dantheta