Skip to content

Instantly share code, notes, and snippets.

@harlantwood
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harlantwood/5f6aaaf8636c43de82a8 to your computer and use it in GitHub Desktop.
Save harlantwood/5f6aaaf8636c43de82a8 to your computer and use it in GitHub Desktop.
Adding NewRelic to a Node.js Heroku app
heroku addons:add newrelic
npm install newrelic --save
cp node_modules/newrelic/newrelic.js .

get the New Relic license key:

heroku config:get NEW_RELIC_LICENSE_KEY

edit newrelic.js, editing app name and license key. Optionally change logging level:

level : 'warn'  // level options: fatal, error, warn, info, debug, or trace

require newrelic at the beginning of your app's startup script

require('newrelic');

finally, commit and push:

git add .   # or if you have other changes, just add newrelic changes
git commit -am'add newrelic monitoring'
git push heroku HEAD:master

If you wish to make changes in the New Relic web interface:

heroku addons:open newrelic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment