Last active
May 11, 2017 06:44
-
-
Save mrister/8c1a7809084fa02dfa72744bbec587bb to your computer and use it in GitHub Desktop.
New Relic example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
error_collector.enabled
istrue
by default