-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnewrelic.js
More file actions
48 lines (42 loc) · 1.74 KB
/
newrelic.js
File metadata and controls
48 lines (42 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
var config = require('./backend/config/config');
var api_key = config.NEW_RELIC.API_KEY;
var appName = config.NEW_RELIC.APP_NAME;
if(!api_key)
throw("config.NEW_RELIC.API_KEY not defined! Please define NEW_RELIC_API_KEY in your Heroku app's config vars or your .env file.");
if(!appName)
throw("config.NEW_RELIC.APP_NAME not defined! Please define RMAPS_MAP_INSTANCE_NAME in your Heroku app's config vars or your local environment (like your .bash_rc, not your .env).");
/*
We use a different RMAPS_MAP_INSTANCE_NAME for each staging/dev instance,
that way we can avoid duplicate apps in the APM manager
of New Relic -- otherwise this would become a maintenance hell.
Developers should limit their staging to 1 Dyno of the smallest size to keep cost down, especially when new relic is
pinging the app (which will keep it from sleeping).
Maintenance:
FYI to delete an app from new relic, you need to have OWNER heroku privileges and the Heroku app must be shut down
it takes a few minutes for New Relic to decide that it is down (GREYED out)
https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/removing-applications-servers#ui-settings
*/
/**
* New Relic agent configuration.
*
* See lib/config.defaults.js in the new relic lib for a more complete
* description of configuration variables and their potential values.
*/
exports.config = {
/**
* Array of application names.
*/
app_name : [appName],
/**
* Your New Relic license key.
*/
license_key : api_key,
logging : {
/**
* Level at which to log. 'trace' is most useful to New Relic when diagnosing
* issues with the agent, 'info' and higher will impose the least overhead on
* production applications.
*/
level : config.NEW_RELIC.LOGLEVEL
}
};