0
votes

So I have New Relic set up on my Rails app, which I run both locally for development and which I deploy to Heroku.

However, the New Relic dashboard shows data from my local setup and not from Heroku. I know because the data I can see corresponds to what's happening on the local environment, and on the new relic dashboard the listed servers includes the hostname of my local machine.

How do I make sure New Relic monitors the heroku environment instead?

New Relic is setup in my app this way:

  • 'newrelic_rpm" gem is included in the Gemfile
  • config/newrelic.yml exist and has been downloaded from the New Relic setup page
  • The license key in config/newrelic.yml is the one generated on the New Relic setup page
  • The heroku environment variables NEW_RELIC_APP_NAME and NEW_RELIC_LICENSE_KEY. The first one is the same name as the Heroku app. The second one contains the same key as the config/newrelic.yml file.
  • The heroku newrelic:stark addon is added to the heroku app
1
In your newrelic.yml file, make sure development, monitor mode is set to false and production is set to true.miler350
I changee development monitor_mode to false, and left it true for production. I can still only see one application in new relic called "<app name> (Development)", but that application doesn't seem to be showing any data anymore.bfw
You only set keys on heroku correct, not in an application.yml file locally?miler350
I don't have an application.yml file, I have a config/newrelic.yml file though. The license key is present in the newrelic.yml file and is also set in the NEW_RELIC_LICENSE_KEY environment variable. The license key (in the file and env variable) is present both in the local development environment, and also in the Heroku environment.bfw
I think you only need a reference to: NEW_RELIC_LICENSE_KEY in all places. That constant should have nothing to read locally, and only read the heroku configs in production. So, if the key is set on your local app, it could cause the key to be read locally. So remove the actual key from the app: replace with license_key: '<%= ENV["NEW_RELIC_LICENSE_KEY"] %>'miler350

1 Answers

3
votes

As per comments, check to make sure you config/newrelic.yml file is monitoring a production application.

Set all newrelic keys only on heroku, not on local app. You only need a reference to: NEW_RELIC_LICENSE_KEY in all places. That constant should have nothing to read locally, and only read the heroku configs in production.

Replace any local license keys with license_key: '<%= ENV["NEW_RELIC_LICENSE_KEY"] %>' and turn development monitor_mode to false and production monitor_mode to true.

All: read comments above for further details if this is unclear.