Skip to content

Commit 3927259

Browse files
committed
add new relic
1 parent 7b7bbe0 commit 3927259

File tree

5 files changed

+292
-11
lines changed

5 files changed

+292
-11
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,6 @@ crashlytics-build.properties
111111
fabric.properties
112112

113113
dist/
114-
.vscode/
114+
.vscode/
115+
116+
*.swp

newrelic.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
'use strict'
2+
/**
3+
* New Relic agent configuration.
4+
*
5+
* See lib/config/default.js in the agent distribution for a more complete
6+
* description of configuration variables and their potential values.
7+
*/
8+
exports.config = {
9+
/**
10+
* Array of application names.
11+
*/
12+
app_name: ['Judge Taskmaster'],
13+
/**
14+
* Your New Relic license key.
15+
*/
16+
license_key: process.env.NEWRELIC_KEY,
17+
logging: {
18+
/**
19+
* Level at which to log. 'trace' is most useful to New Relic when diagnosing
20+
* issues with the agent, 'info' and higher will impose the least overhead on
21+
* production applications.
22+
*/
23+
level: 'info'
24+
},
25+
/**
26+
* When true, all request headers except for those listed in attributes.exclude
27+
* will be captured for all traces, unless otherwise specified in a destination's
28+
* attributes include/exclude lists.
29+
*/
30+
allow_all_headers: true,
31+
attributes: {
32+
/**
33+
* Prefix of attributes to exclude from all destinations. Allows * as wildcard
34+
* at end.
35+
*
36+
* NOTE: If excluding headers, they must be in camelCase form to be filtered.
37+
*
38+
* @env NEW_RELIC_ATTRIBUTES_EXCLUDE
39+
*/
40+
exclude: [
41+
'request.headers.cookie',
42+
'request.headers.authorization',
43+
'request.headers.proxyAuthorization',
44+
'request.headers.setCookie*',
45+
'request.headers.x*',
46+
'response.headers.cookie',
47+
'response.headers.authorization',
48+
'response.headers.proxyAuthorization',
49+
'response.headers.setCookie*',
50+
'response.headers.x*'
51+
]
52+
}
53+
}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"dependencies": {
2222
"amqplib": "^0.5.2",
23+
"newrelic": "^6.5.0",
2324
"shelljs": "^0.8.1"
2425
},
2526
"nyc": {

src/taskmaster.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import nr from 'newrelic';
12
import * as amqp from 'amqplib/callback_api'
23
import {Connection} from 'amqplib/callback_api'
34
import {RunJob, RunResult} from './types/job'
@@ -32,4 +33,4 @@ amqp.connect(`amqp://${config.AMQP.USER}:${config.AMQP.PASS}@${config.AMQP.HOST}
3233

3334

3435
})
35-
})
36+
})

0 commit comments

Comments
 (0)