Skip to content

Instantly share code, notes, and snippets.

@mrister
Last active May 11, 2017 06:44
Show Gist options
  • Save mrister/8c1a7809084fa02dfa72744bbec587bb to your computer and use it in GitHub Desktop.
Save mrister/8c1a7809084fa02dfa72744bbec587bb to your computer and use it in GitHub Desktop.
New Relic example
/**
* New Relic agent configuration.
*
* See lib/config.defaults.js in the agent distribution for a more complete
* description of configuration variables and their potential values.
*/
exports.config = {
app_name: ['my application'],
license_key: '<licenese key>', // only thing required (or set NEW_RELIC_LICENSE_KEY env variable)
logging: {
level: 'info'
},
agent_enabled: true,
error_collector: {
enabled: true,
ignore_status_codes: [404, 405, 418]
},
process_host: {
display_name: 'West 01' // give your server a name
}
}
// for more options see:
// https://docs.newrelic.com/docs/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#exports_config
Install New Relic and add it to your package.json via:
npm i newrelic --save
In your app.js (your main js file) do:
require("newrelic")
Drop in the "newrelic.js" configuration file to the root of your project and the installed New Relic agent will do the rest.
For more options and use cases you can see the agent's API:
https://docs.newrelic.com/docs/agents/nodejs-agent/supported-features/nodejs-agent-api
@enVolt
Copy link

enVolt commented May 11, 2017

error_collector.enabled is true by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment