newrelic 8.0.0 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NEWS.md +5023 -4922
- package/THIRD_PARTY_NOTICES.md +618 -209
- package/api.js +156 -219
- package/bin/test-naming-rules.js +57 -51
- package/bin/tracetractor +0 -1
- package/index.js +7 -14
- package/lib/agent.js +111 -114
- package/lib/aggregators/base-aggregator.js +1 -1
- package/lib/aggregators/event-aggregator.js +6 -6
- package/lib/attributes.js +13 -14
- package/lib/collector/api.js +44 -54
- package/lib/collector/facts.js +68 -66
- package/lib/collector/http-agents.js +36 -32
- package/lib/collector/key-parser.js +1 -1
- package/lib/collector/parse-response.js +1 -2
- package/lib/collector/remote-method.js +69 -61
- package/lib/collector/serverless.js +13 -18
- package/lib/collector/ssl/certificates.js +1056 -1056
- package/lib/config/attribute-filter.js +109 -101
- package/lib/config/default.js +35 -21
- package/lib/config/env.js +17 -12
- package/lib/config/harvest-config-validator.js +1 -1
- package/lib/config/hsm.js +1 -1
- package/lib/config/index.js +240 -234
- package/lib/config/lasp.js +3 -3
- package/lib/config/merge-server-config.js +8 -6
- package/lib/custom-events/custom-event-aggregator.js +1 -1
- package/lib/db/parse-sql.js +13 -16
- package/lib/db/parsed-statement.js +13 -19
- package/lib/db/query-parsers/sql.js +12 -15
- package/lib/db/query-sample.js +16 -12
- package/lib/db/query-trace-aggregator.js +16 -16
- package/lib/db/statement-matcher.js +5 -5
- package/lib/db/utils.js +2 -2
- package/lib/environment.js +210 -175
- package/lib/errors/error-collector.js +20 -33
- package/lib/errors/error-event-aggregator.js +1 -1
- package/lib/errors/error-trace-aggregator.js +3 -4
- package/lib/errors/helper.js +23 -32
- package/lib/errors/index.js +31 -43
- package/lib/feature_flags.js +3 -4
- package/lib/grpc/connection/states.js +6 -6
- package/lib/grpc/connection.js +35 -46
- package/lib/header-attributes.js +55 -59
- package/lib/header-processing.js +1 -1
- package/lib/instrumentation/amqplib.js +34 -43
- package/lib/instrumentation/bluebird.js +63 -22
- package/lib/instrumentation/cassandra-driver.js +8 -4
- package/lib/instrumentation/connect.js +7 -6
- package/lib/instrumentation/core/async_hooks.js +16 -9
- package/lib/instrumentation/core/child_process.js +20 -28
- package/lib/instrumentation/core/crypto.js +1 -7
- package/lib/instrumentation/core/dns.js +3 -7
- package/lib/instrumentation/core/domain.js +4 -10
- package/lib/instrumentation/core/fs.js +22 -37
- package/lib/instrumentation/core/globals.js +4 -8
- package/lib/instrumentation/core/http-outbound.js +20 -114
- package/lib/instrumentation/core/http.js +61 -128
- package/lib/instrumentation/core/inspector.js +7 -11
- package/lib/instrumentation/core/net.js +3 -1
- package/lib/instrumentation/core/timers.js +21 -28
- package/lib/instrumentation/core/zlib.js +3 -11
- package/lib/instrumentation/director.js +4 -4
- package/lib/instrumentation/express.js +12 -10
- package/lib/instrumentation/fastify/spec-builders.js +5 -0
- package/lib/instrumentation/fastify.js +37 -10
- package/lib/instrumentation/generic-pool.js +1 -1
- package/lib/instrumentation/hapi/hapi-17.js +20 -21
- package/lib/instrumentation/hapi/shared.js +1 -1
- package/lib/instrumentation/hapi.js +37 -37
- package/lib/instrumentation/ioredis.js +8 -9
- package/lib/instrumentation/memcached.js +41 -45
- package/lib/instrumentation/mongodb/common.js +221 -0
- package/lib/instrumentation/mongodb/constants.js +87 -0
- package/lib/instrumentation/mongodb/v2-mongo.js +110 -0
- package/lib/instrumentation/mongodb/v3-mongo.js +80 -0
- package/lib/instrumentation/mongodb/v4-mongo.js +90 -0
- package/lib/instrumentation/mongodb.js +20 -312
- package/lib/instrumentation/mysql.js +51 -44
- package/lib/instrumentation/oracle.js +24 -28
- package/lib/instrumentation/pg.js +34 -25
- package/lib/instrumentation/promise.js +65 -62
- package/lib/instrumentation/q.js +2 -2
- package/lib/instrumentation/redis.js +38 -38
- package/lib/instrumentation/restify.js +1 -1
- package/lib/instrumentation/vision.js +4 -4
- package/lib/instrumentation/when.js +12 -4
- package/lib/instrumentations.js +25 -25
- package/lib/logger.js +6 -6
- package/lib/metrics/index.js +50 -30
- package/lib/metrics/mapper.js +15 -15
- package/lib/metrics/metric-aggregator.js +5 -10
- package/lib/metrics/names.js +8 -7
- package/lib/metrics/normalizer/rule.js +14 -15
- package/lib/metrics/normalizer/tx_segment.js +33 -29
- package/lib/metrics/normalizer.js +51 -54
- package/lib/metrics/recorders/custom.js +8 -6
- package/lib/metrics/recorders/distributed-trace.js +3 -18
- package/lib/metrics/recorders/generic.js +6 -5
- package/lib/metrics/recorders/http.js +11 -13
- package/lib/metrics/recorders/http_external.js +8 -10
- package/lib/metrics/recorders/message-transaction.js +7 -18
- package/lib/metrics/recorders/other.js +7 -17
- package/lib/parse-proc-cpuinfo.js +26 -31
- package/lib/parse-proc-meminfo.js +5 -3
- package/lib/prioritized-attributes.js +14 -19
- package/lib/priority-queue.js +11 -11
- package/lib/proxy/grpc.js +1 -1
- package/lib/reservoir.js +12 -6
- package/lib/sampler.js +33 -34
- package/lib/serverless/api-gateway.js +3 -3
- package/lib/serverless/aws-lambda.js +28 -37
- package/lib/shim/conglomerate-shim.js +4 -4
- package/lib/shim/datastore-shim.js +61 -67
- package/lib/shim/index.js +10 -11
- package/lib/shim/message-shim.js +149 -151
- package/lib/shim/promise-shim.js +19 -14
- package/lib/shim/shim.js +131 -125
- package/lib/shim/specs/index.js +21 -22
- package/lib/shim/transaction-shim.js +52 -210
- package/lib/shim/webframework-shim.js +75 -85
- package/lib/shimmer.js +184 -166
- package/lib/spans/create-span-event-aggregator.js +11 -8
- package/lib/spans/span-context.js +4 -10
- package/lib/spans/span-event-aggregator.js +68 -13
- package/lib/spans/span-event.js +6 -8
- package/lib/spans/span-streamer.js +10 -18
- package/lib/spans/streaming-span-attributes.js +1 -1
- package/lib/spans/streaming-span-event-aggregator.js +1 -1
- package/lib/spans/streaming-span-event.js +4 -4
- package/lib/stats/apdex.js +7 -13
- package/lib/stats/index.js +14 -19
- package/lib/system-info.js +29 -25
- package/lib/timer.js +35 -21
- package/lib/transaction/dt-payload.js +1 -1
- package/lib/transaction/handle.js +19 -19
- package/lib/transaction/index.js +133 -151
- package/lib/transaction/name-state.js +18 -19
- package/lib/transaction/trace/aggregator.js +78 -73
- package/lib/transaction/trace/exclusive-time-calculator.js +9 -13
- package/lib/transaction/trace/index.js +37 -35
- package/lib/transaction/trace/segment.js +56 -73
- package/lib/transaction/tracecontext.js +38 -46
- package/lib/transaction/tracer/index.js +130 -91
- package/lib/transaction/transaction-event-aggregator.js +29 -31
- package/lib/uninstrumented.js +11 -12
- package/lib/util/arity.js +2 -2
- package/lib/util/attribute-types.js +1 -5
- package/lib/util/byte-limit.js +4 -5
- package/lib/util/cat.js +270 -33
- package/lib/util/codec.js +10 -6
- package/lib/util/copy.js +2 -2
- package/lib/util/deep-equal.js +51 -21
- package/lib/util/flatten.js +9 -6
- package/lib/util/hashes.js +16 -16
- package/lib/util/label-parser.js +22 -28
- package/lib/util/logger.js +53 -35
- package/lib/util/process-version.js +3 -3
- package/lib/util/properties.js +5 -5
- package/lib/util/sql/obfuscate.js +21 -31
- package/lib/util/stream-sink.js +5 -6
- package/lib/util/unwrapped-core.js +2 -2
- package/lib/util/urltils.js +26 -30
- package/lib/utilization/aws-info.js +8 -9
- package/lib/utilization/azure-info.js +37 -35
- package/lib/utilization/common.js +17 -16
- package/lib/utilization/docker-info.js +14 -16
- package/lib/utilization/gcp-info.js +38 -37
- package/lib/utilization/index.js +5 -5
- package/lib/utilization/kubernetes-info.js +2 -2
- package/lib/utilization/pcf-info.js +12 -12
- package/package.json +23 -6
- package/stub_api.js +16 -14
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
'use strict'
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const NO_MATCH = -Infinity
|
|
9
|
+
const EXACT_MATCH = Infinity
|
|
10
|
+
const DESTINATIONS = {
|
|
11
11
|
NONE: 0x00,
|
|
12
12
|
TRANS_EVENT: 0x01,
|
|
13
13
|
TRANS_TRACE: 0x02,
|
|
@@ -25,22 +25,20 @@ DESTINATIONS.TRANS_SCOPE =
|
|
|
25
25
|
DESTINATIONS.SEGMENT_SCOPE = DESTINATIONS.SPAN_EVENT | DESTINATIONS.TRANS_SEGMENT
|
|
26
26
|
|
|
27
27
|
DESTINATIONS.TRANS_COMMON =
|
|
28
|
-
DESTINATIONS.TRANS_EVENT |
|
|
29
|
-
DESTINATIONS.TRANS_TRACE |
|
|
30
|
-
DESTINATIONS.ERROR_EVENT
|
|
28
|
+
DESTINATIONS.TRANS_EVENT | DESTINATIONS.TRANS_TRACE | DESTINATIONS.ERROR_EVENT
|
|
31
29
|
|
|
32
30
|
DESTINATIONS.LIMITED = DESTINATIONS.TRANS_TRACE | DESTINATIONS.ERROR_EVENT
|
|
33
31
|
|
|
34
32
|
const TRANS_SCOPE_DETAILS = [
|
|
35
|
-
{id: DESTINATIONS.TRANS_EVENT, key: 'TRANS_EVENT', name: 'transaction_events'},
|
|
36
|
-
{id: DESTINATIONS.TRANS_TRACE, key: 'TRANS_TRACE', name: 'transaction_tracer'},
|
|
37
|
-
{id: DESTINATIONS.ERROR_EVENT, key: 'ERROR_EVENT', name: 'error_collector'},
|
|
38
|
-
{id: DESTINATIONS.BROWSER_EVENT, key: 'BROWSER_EVENT', name: 'browser_monitoring'}
|
|
33
|
+
{ id: DESTINATIONS.TRANS_EVENT, key: 'TRANS_EVENT', name: 'transaction_events' },
|
|
34
|
+
{ id: DESTINATIONS.TRANS_TRACE, key: 'TRANS_TRACE', name: 'transaction_tracer' },
|
|
35
|
+
{ id: DESTINATIONS.ERROR_EVENT, key: 'ERROR_EVENT', name: 'error_collector' },
|
|
36
|
+
{ id: DESTINATIONS.BROWSER_EVENT, key: 'BROWSER_EVENT', name: 'browser_monitoring' }
|
|
39
37
|
]
|
|
40
38
|
|
|
41
39
|
const SEGMENT_SCOPE_DETAILS = [
|
|
42
|
-
{id: DESTINATIONS.SPAN_EVENT, key: 'SPAN_EVENT', name: 'span_events'},
|
|
43
|
-
{id: DESTINATIONS.TRANS_SEGMENT, key: 'TRANS_SEGMENT', name: 'transaction_segments'}
|
|
40
|
+
{ id: DESTINATIONS.SPAN_EVENT, key: 'SPAN_EVENT', name: 'span_events' },
|
|
41
|
+
{ id: DESTINATIONS.TRANS_SEGMENT, key: 'TRANS_SEGMENT', name: 'transaction_segments' }
|
|
44
42
|
]
|
|
45
43
|
|
|
46
44
|
const DESTINATION_DETAILS = [...TRANS_SCOPE_DETAILS, ...SEGMENT_SCOPE_DETAILS]
|
|
@@ -64,7 +62,7 @@ function AttributeFilter(config) {
|
|
|
64
62
|
this._cachedCount = 0
|
|
65
63
|
this._enabledDestinations = DESTINATIONS.NONE
|
|
66
64
|
|
|
67
|
-
|
|
65
|
+
const updater = this.update.bind(this)
|
|
68
66
|
|
|
69
67
|
// Add the global rules.
|
|
70
68
|
config.on('attributes.enabled', updater)
|
|
@@ -142,21 +140,21 @@ AttributeFilter.prototype._filter = function _filter(scope, destinations, key) {
|
|
|
142
140
|
}
|
|
143
141
|
|
|
144
142
|
// These are lazy computed to avoid calculating them for cached results.
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
let globalInclude = null
|
|
144
|
+
let globalExclude = null
|
|
147
145
|
|
|
148
146
|
// Iterate over each destination and see if the rules apply.
|
|
149
|
-
for (
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
for (let i = 0; i < scope.length; ++i) {
|
|
148
|
+
const dest = scope[i]
|
|
149
|
+
const destId = dest.id
|
|
150
|
+
const destName = dest.name
|
|
153
151
|
if (!(this._enabledDestinations & destId)) {
|
|
154
152
|
destinations &= ~destId // Remove this destination.
|
|
155
153
|
continue
|
|
156
154
|
}
|
|
157
155
|
|
|
158
156
|
// Check for a cached result for this key.
|
|
159
|
-
|
|
157
|
+
let result = this._cache[destName][key]
|
|
160
158
|
if (result === undefined) {
|
|
161
159
|
if (globalInclude === null) {
|
|
162
160
|
globalInclude = _matchRules(this._rules.global.include, key)
|
|
@@ -164,7 +162,7 @@ AttributeFilter.prototype._filter = function _filter(scope, destinations, key) {
|
|
|
164
162
|
}
|
|
165
163
|
|
|
166
164
|
// Freshly calculate this attribute.
|
|
167
|
-
|
|
165
|
+
result = _doTest(globalInclude, globalExclude, this._rules[destName], key)
|
|
168
166
|
if (this._cachedCount < this.config.attributes.filter_cache_limit) {
|
|
169
167
|
this._cache[destName][key] = result
|
|
170
168
|
++this._cachedCount
|
|
@@ -197,7 +195,7 @@ AttributeFilter.prototype.update = function update() {
|
|
|
197
195
|
|
|
198
196
|
// And all the destination rules.
|
|
199
197
|
DESTINATION_DETAILS.forEach(function forEachDestination(dest) {
|
|
200
|
-
|
|
198
|
+
const name = dest.name
|
|
201
199
|
if (!this.config[name].attributes.enabled) {
|
|
202
200
|
return
|
|
203
201
|
}
|
|
@@ -224,7 +222,7 @@ function _doTest(globalInclude, globalExclude, destConfig, key) {
|
|
|
224
222
|
if (globalExclude === EXACT_MATCH) {
|
|
225
223
|
return false
|
|
226
224
|
}
|
|
227
|
-
|
|
225
|
+
const destExclude = _matchRules(destConfig.exclude, key)
|
|
228
226
|
if (destExclude === EXACT_MATCH) {
|
|
229
227
|
return false
|
|
230
228
|
}
|
|
@@ -233,7 +231,7 @@ function _doTest(globalInclude, globalExclude, destConfig, key) {
|
|
|
233
231
|
if (globalInclude === EXACT_MATCH) {
|
|
234
232
|
return true
|
|
235
233
|
}
|
|
236
|
-
|
|
234
|
+
const destInclude = _matchRules(destConfig.include, key)
|
|
237
235
|
if (destInclude === EXACT_MATCH) {
|
|
238
236
|
return true
|
|
239
237
|
}
|
|
@@ -253,7 +251,6 @@ function _doTest(globalInclude, globalExclude, destConfig, key) {
|
|
|
253
251
|
return (
|
|
254
252
|
// If destination include is a better match than either exclude, it's in!
|
|
255
253
|
(destInclude > destExclude && destInclude >= globalExclude) ||
|
|
256
|
-
|
|
257
254
|
// If global include is a better match than either exclude, it's in!
|
|
258
255
|
(globalInclude > destExclude && globalInclude > globalExclude)
|
|
259
256
|
)
|
|
@@ -279,7 +276,7 @@ function _matchRules(rules, key) {
|
|
|
279
276
|
return EXACT_MATCH
|
|
280
277
|
}
|
|
281
278
|
|
|
282
|
-
|
|
279
|
+
const wildcard = rules.wildcard
|
|
283
280
|
if (!wildcard) {
|
|
284
281
|
return NO_MATCH
|
|
285
282
|
}
|
|
@@ -299,12 +296,12 @@ function _matchRules(rules, key) {
|
|
|
299
296
|
* `RegExp` instances for testing keys.
|
|
300
297
|
*/
|
|
301
298
|
function _importRules(rules) {
|
|
302
|
-
|
|
299
|
+
const out = {
|
|
303
300
|
exact: null,
|
|
304
301
|
wildcard: null
|
|
305
302
|
}
|
|
306
|
-
|
|
307
|
-
|
|
303
|
+
const exactRules = []
|
|
304
|
+
const wildcardRules = []
|
|
308
305
|
rules.forEach(function separateRules(rule) {
|
|
309
306
|
if (rule[rule.length - 1] === '*') {
|
|
310
307
|
wildcardRules.push(rule)
|
|
@@ -336,77 +333,88 @@ function _importRules(rules) {
|
|
|
336
333
|
* @return {string} The rules composed into a single regular expression string.
|
|
337
334
|
*/
|
|
338
335
|
function _convertRulesToRegex(rules) {
|
|
339
|
-
return
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
// 'foo.bar' => ['foo', 'bar']
|
|
358
|
-
// 'foo.bang*' => ['foo', 'bang\\*']
|
|
359
|
-
// 'fizz.bang' => ['fizz', 'bang']
|
|
360
|
-
// '*' => ['\\*']
|
|
361
|
-
return rule.replace(/([.*+?|\\^$()\[\]])/g, function cleaner(m) {
|
|
362
|
-
return '\\' + m
|
|
363
|
-
}).split('.')
|
|
364
|
-
}).reduce(function ruleTransformer(collection, ruleParts) {
|
|
365
|
-
// Step 3) Merge the split rules into a single nested array, deduplicating
|
|
366
|
-
// rule sections as we go.
|
|
367
|
-
|
|
368
|
-
// ['foo', 'bar'] => [['foo\\.', ['bar']]]
|
|
369
|
-
// ['foo', 'bang\\*'] => [['foo\\.', ['bar'], ['bang']]]
|
|
370
|
-
// ['fizz', 'bang'] => [['foo\\.', ['bar'], ['bang']], ['fizz\\.', ['bang']]]
|
|
371
|
-
// ['\\*'] => [['foo\\.', ['bar'], ['bang']], ['fizz\\.', ['bang']], ['']]
|
|
372
|
-
add(collection, ruleParts, 0)
|
|
373
|
-
return collection
|
|
374
|
-
function add(c, r, i) {
|
|
375
|
-
var v = r[i]
|
|
376
|
-
if (i !== r.length - 1) {
|
|
377
|
-
v += '.'
|
|
378
|
-
} else if (/\\\*$/.test(v)) {
|
|
379
|
-
v = v.substr(0, v.length - 2)
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
var idx = c.findIndex(function findV(a) {
|
|
383
|
-
return a[0] === v
|
|
336
|
+
return (
|
|
337
|
+
'(?:' +
|
|
338
|
+
rules
|
|
339
|
+
.sort(function ruleSorter(a, b) {
|
|
340
|
+
// Step 1) Sort the rules according to match-ability. This way the regex
|
|
341
|
+
// will test the rules with the highest possible strength before weaker rules.
|
|
342
|
+
|
|
343
|
+
if (a[a.length - 1] !== '*') {
|
|
344
|
+
// If `a` is an exact rule, it should be moved up.
|
|
345
|
+
return -1
|
|
346
|
+
} else if (b[b.length - 1] !== '*') {
|
|
347
|
+
// If `b` is an exact rule and `a` is not, `b` should be moved up.
|
|
348
|
+
return 1
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Both `a` and `b` are wildcard rules, so the rule with greater length
|
|
352
|
+
// should be moved up.
|
|
353
|
+
return b.length - a.length
|
|
384
354
|
})
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
355
|
+
.map(function ruleSplitter(rule) {
|
|
356
|
+
// Step 2) Escape regex special characters and split the rules into arrays.
|
|
357
|
+
|
|
358
|
+
// 'foo.bar' => ['foo', 'bar']
|
|
359
|
+
// 'foo.bang*' => ['foo', 'bang\\*']
|
|
360
|
+
// 'fizz.bang' => ['fizz', 'bang']
|
|
361
|
+
// '*' => ['\\*']
|
|
362
|
+
return rule
|
|
363
|
+
.replace(/([.*+?|\\^$()\[\]])/g, function cleaner(m) {
|
|
364
|
+
return '\\' + m
|
|
365
|
+
})
|
|
366
|
+
.split('.')
|
|
367
|
+
})
|
|
368
|
+
.reduce(function ruleTransformer(collection, ruleParts) {
|
|
369
|
+
// Step 3) Merge the split rules into a single nested array, deduplicating
|
|
370
|
+
// rule sections as we go.
|
|
371
|
+
|
|
372
|
+
// ['foo', 'bar'] => [['foo\\.', ['bar']]]
|
|
373
|
+
// ['foo', 'bang\\*'] => [['foo\\.', ['bar'], ['bang']]]
|
|
374
|
+
// ['fizz', 'bang'] => [['foo\\.', ['bar'], ['bang']], ['fizz\\.', ['bang']]]
|
|
375
|
+
// ['\\*'] => [['foo\\.', ['bar'], ['bang']], ['fizz\\.', ['bang']], ['']]
|
|
376
|
+
add(collection, ruleParts, 0)
|
|
377
|
+
return collection
|
|
378
|
+
function add(c, r, i) {
|
|
379
|
+
let v = r[i]
|
|
380
|
+
if (i !== r.length - 1) {
|
|
381
|
+
v += '.'
|
|
382
|
+
} else if (/\\\*$/.test(v)) {
|
|
383
|
+
v = v.substr(0, v.length - 2)
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
const idx = c.findIndex(function findV(a) {
|
|
387
|
+
return a[0] === v
|
|
388
|
+
})
|
|
389
|
+
let part = c[idx]
|
|
390
|
+
|
|
391
|
+
if (idx === -1) {
|
|
392
|
+
part = [v]
|
|
393
|
+
c.push(part)
|
|
394
|
+
}
|
|
395
|
+
if (i !== r.length - 1) {
|
|
396
|
+
add(part, r, i + 1)
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}, [])
|
|
400
|
+
.map(function rulesToRegex(part) {
|
|
401
|
+
// Step 4) Merge each of the transformed rules into a regex.
|
|
402
|
+
|
|
403
|
+
// ['foo\\.', ['bar', 'bang']] => 'foo\\.(?:bar|bang)'
|
|
404
|
+
// ['fizz\\.', ['bang']] => 'fizz\\.(?:bang)'
|
|
405
|
+
// [''] => ''
|
|
406
|
+
return mapper(part)
|
|
407
|
+
function mapper(p) {
|
|
408
|
+
if (typeof p === 'string') {
|
|
409
|
+
return p
|
|
410
|
+
} else if (p.length === 1) {
|
|
411
|
+
return mapper(p[0])
|
|
412
|
+
}
|
|
413
|
+
const first = mapper(p.shift()) // shift === pop_front
|
|
414
|
+
return first + '(?:' + p.map(mapper).join('|') + ')'
|
|
415
|
+
}
|
|
416
|
+
})
|
|
417
|
+
.join('|') +
|
|
418
|
+
')'
|
|
419
|
+
) // Step 5) Merge all the regex strings into one.
|
|
412
420
|
}
|
package/lib/config/default.js
CHANGED
|
@@ -128,7 +128,7 @@ exports.config = () => ({
|
|
|
128
128
|
*
|
|
129
129
|
* @see https://docs.newrelic.com/docs/apm/new-relic-apm/apdex/changing-your-apdex-settings
|
|
130
130
|
*/
|
|
131
|
-
apdex_t: 0.
|
|
131
|
+
apdex_t: 0.1,
|
|
132
132
|
|
|
133
133
|
/**
|
|
134
134
|
* When true, all request headers except for those listed in attributes.exclude
|
|
@@ -220,7 +220,6 @@ exports.config = () => ({
|
|
|
220
220
|
},
|
|
221
221
|
|
|
222
222
|
audit_log: {
|
|
223
|
-
|
|
224
223
|
/**
|
|
225
224
|
* Enables logging of out bound traffic from the Agent to the Collector.
|
|
226
225
|
* This field is ignored if trace level logging is enabled.
|
|
@@ -302,14 +301,17 @@ exports.config = () => ({
|
|
|
302
301
|
* Relic servers. The memory concerns are something you should consider for
|
|
303
302
|
* your own server's sake. The payload of events is compressed, but if it
|
|
304
303
|
* grows too large the New Relic servers may reject it.
|
|
304
|
+
*
|
|
305
|
+
* @env NEW_RELIC_ERROR_COLLECTOR_MAX_EVENT_SAMPLES_STORED
|
|
306
|
+
*
|
|
305
307
|
*/
|
|
306
308
|
max_event_samples_stored: 100,
|
|
307
309
|
|
|
308
310
|
expected_classes: [],
|
|
309
311
|
expected_messages: {},
|
|
310
312
|
expected_status_codes: [],
|
|
311
|
-
ignore_classes:[],
|
|
312
|
-
ignore_messages:{}
|
|
313
|
+
ignore_classes: [],
|
|
314
|
+
ignore_messages: {}
|
|
313
315
|
},
|
|
314
316
|
/**
|
|
315
317
|
* Error message redaction
|
|
@@ -503,9 +505,7 @@ exports.config = () => ({
|
|
|
503
505
|
*
|
|
504
506
|
* @env NEW_RELIC_IGNORING_RULES
|
|
505
507
|
*/
|
|
506
|
-
ignore: [
|
|
507
|
-
'^\/socket\.io\/.*\/xhr-polling/'
|
|
508
|
-
]
|
|
508
|
+
ignore: ['^/socket.io/.*/xhr-polling/']
|
|
509
509
|
},
|
|
510
510
|
/**
|
|
511
511
|
* By default, any transactions that are not affected by other bits of
|
|
@@ -612,7 +612,7 @@ exports.config = () => ({
|
|
|
612
612
|
*
|
|
613
613
|
* @env NEW_RELIC_API_NOTICE_ERROR
|
|
614
614
|
*/
|
|
615
|
-
notice_error_enabled: true
|
|
615
|
+
notice_error_enabled: true
|
|
616
616
|
},
|
|
617
617
|
/**
|
|
618
618
|
* Transaction Events
|
|
@@ -653,6 +653,8 @@ exports.config = () => ({
|
|
|
653
653
|
/**
|
|
654
654
|
* The agent will collect all events up to this number per minute. If
|
|
655
655
|
* there are more than that, a statistical sampling will be collected.
|
|
656
|
+
*
|
|
657
|
+
* @env NEW_RELIC_TRANSACTION_EVENTS_MAX_SAMPLES_STORED
|
|
656
658
|
*/
|
|
657
659
|
max_samples_stored: 10000
|
|
658
660
|
},
|
|
@@ -683,6 +685,9 @@ exports.config = () => ({
|
|
|
683
685
|
* Relic servers. The memory concerns are something you should consider for
|
|
684
686
|
* your own server's sake. The payload of events is compressed, but if it
|
|
685
687
|
* grows too large the New Relic servers may reject it.
|
|
688
|
+
*
|
|
689
|
+
* @env NEW_RELIC_CUSTOM_INSIGHTS_EVENTS_MAX_SAMPLES_STORED
|
|
690
|
+
*
|
|
686
691
|
*/
|
|
687
692
|
max_samples_stored: 1000
|
|
688
693
|
},
|
|
@@ -754,16 +759,16 @@ exports.config = () => ({
|
|
|
754
759
|
/**
|
|
755
760
|
* Controls behavior of datastore instance metrics.
|
|
756
761
|
*
|
|
757
|
-
* @property {
|
|
762
|
+
* @property {Boolean} [instance_reporting.enabled=true]
|
|
758
763
|
* Enables reporting the host and port/path/id of database servers. Default
|
|
759
764
|
* is `true`.
|
|
760
765
|
*
|
|
761
|
-
* @property {
|
|
766
|
+
* @property {Boolean} [database_name_reporting.enabled=true]
|
|
762
767
|
* Enables reporting of database/schema names. Default is `true`.
|
|
763
768
|
*/
|
|
764
769
|
datastore_tracer: {
|
|
765
|
-
instance_reporting: {enabled: true},
|
|
766
|
-
database_name_reporting: {enabled: true}
|
|
770
|
+
instance_reporting: { enabled: true },
|
|
771
|
+
database_name_reporting: { enabled: true }
|
|
767
772
|
},
|
|
768
773
|
|
|
769
774
|
/**
|
|
@@ -798,7 +803,14 @@ exports.config = () => ({
|
|
|
798
803
|
* @env NEW_RELIC_SPAN_EVENTS_ATTRIBUTES_INCLUDE
|
|
799
804
|
*/
|
|
800
805
|
include: []
|
|
801
|
-
}
|
|
806
|
+
},
|
|
807
|
+
/**
|
|
808
|
+
* The agent will collect all events up to this number per minute. If
|
|
809
|
+
* there are more than that, a statistical sampling will be collected.
|
|
810
|
+
*
|
|
811
|
+
* @env NEW_RELIC_SPAN_EVENTS_MAX_SAMPLES_STORED
|
|
812
|
+
*/
|
|
813
|
+
max_samples_stored: 2000
|
|
802
814
|
},
|
|
803
815
|
|
|
804
816
|
/**
|
|
@@ -835,7 +847,7 @@ exports.config = () => ({
|
|
|
835
847
|
* distributed system. Enabling distributed tracing changes the behavior of some
|
|
836
848
|
* New Relic features, so carefully consult the transition guide before you enable
|
|
837
849
|
* this feature: https://docs.newrelic.com/docs/transition-guide-distributed-tracing
|
|
838
|
-
* Default is
|
|
850
|
+
* Default is true.
|
|
839
851
|
*/
|
|
840
852
|
distributed_tracing: {
|
|
841
853
|
/**
|
|
@@ -843,7 +855,7 @@ exports.config = () => ({
|
|
|
843
855
|
*
|
|
844
856
|
* @env NEW_RELIC_DISTRIBUTED_TRACING_ENABLED
|
|
845
857
|
*/
|
|
846
|
-
enabled:
|
|
858
|
+
enabled: true,
|
|
847
859
|
|
|
848
860
|
/**
|
|
849
861
|
* Excludes New Relic format distributed tracing header (`newrelic`) on
|
|
@@ -859,19 +871,21 @@ exports.config = () => ({
|
|
|
859
871
|
/**
|
|
860
872
|
* Controls the use of cross-application tracing.
|
|
861
873
|
*
|
|
862
|
-
* @property {
|
|
863
|
-
*
|
|
874
|
+
* @property {Boolean} [enabled=false]
|
|
875
|
+
* Enables tracing transactions across multiple applications. Default is `false`.
|
|
876
|
+
* This feature has been deprecated in favor of Distributed Tracing (DT).
|
|
877
|
+
* To fully enable this feature, you must also disable DT in your configuration.
|
|
864
878
|
*/
|
|
865
|
-
cross_application_tracer: {enabled:
|
|
879
|
+
cross_application_tracer: { enabled: false },
|
|
866
880
|
|
|
867
881
|
/**
|
|
868
882
|
* Controls behavior of message broker tracing.
|
|
869
883
|
*
|
|
870
|
-
* @property {
|
|
884
|
+
* @property {Boolean} [segment_parameters.enabled=true]
|
|
871
885
|
* Enables reporting parameters on message broker segments.
|
|
872
886
|
*/
|
|
873
887
|
message_tracer: {
|
|
874
|
-
segment_parameters: {enabled: true}
|
|
888
|
+
segment_parameters: { enabled: true }
|
|
875
889
|
},
|
|
876
890
|
|
|
877
891
|
/**
|
|
@@ -917,6 +931,6 @@ exports.config = () => ({
|
|
|
917
931
|
* Controls usage of the native metrics module which samples VM and event
|
|
918
932
|
* loop data.
|
|
919
933
|
*/
|
|
920
|
-
native_metrics: {enabled: true}
|
|
934
|
+
native_metrics: { enabled: true }
|
|
921
935
|
}
|
|
922
936
|
})
|
package/lib/config/env.js
CHANGED
|
@@ -45,6 +45,7 @@ const ENV_MAPPING = {
|
|
|
45
45
|
ignore_classes: 'NEW_RELIC_ERROR_COLLECTOR_IGNORE_ERRORS',
|
|
46
46
|
expected_status_codes: 'NEW_RELIC_ERROR_COLLECTOR_EXPECTED_ERROR_CODES',
|
|
47
47
|
expected_classes: 'NEW_RELIC_ERROR_COLLECTOR_EXPECTED_ERRORS',
|
|
48
|
+
max_event_samples_stored: 'NEW_RELIC_ERROR_COLLECTOR_MAX_EVENT_SAMPLES_STORED'
|
|
48
49
|
},
|
|
49
50
|
strip_exception_messages: {
|
|
50
51
|
enabled: 'NEW_RELIC_STRIP_EXCEPTION_MESSAGES_ENABLED'
|
|
@@ -54,7 +55,11 @@ const ENV_MAPPING = {
|
|
|
54
55
|
enabled: 'NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_ENABLED',
|
|
55
56
|
exclude: 'NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_EXCLUDE',
|
|
56
57
|
include: 'NEW_RELIC_TRANSACTION_EVENTS_ATTRIBUTES_INCLUDE'
|
|
57
|
-
}
|
|
58
|
+
},
|
|
59
|
+
max_samples_stored: 'NEW_RELIC_TRANSACTION_EVENTS_MAX_SAMPLES_STORED'
|
|
60
|
+
},
|
|
61
|
+
custom_insights_events: {
|
|
62
|
+
max_samples_stored: 'NEW_RELIC_CUSTOM_INSIGHTS_EVENTS_MAX_SAMPLES_STORED'
|
|
58
63
|
},
|
|
59
64
|
transaction_tracer: {
|
|
60
65
|
attributes: {
|
|
@@ -113,7 +118,7 @@ const ENV_MAPPING = {
|
|
|
113
118
|
instance_reporting: {
|
|
114
119
|
enabled: 'NEW_RELIC_DATASTORE_INSTANCE_REPORTING_ENABLED'
|
|
115
120
|
},
|
|
116
|
-
database_name_reporting:{
|
|
121
|
+
database_name_reporting: {
|
|
117
122
|
enabled: 'NEW_RELIC_DATASTORE_DATABASE_NAME_REPORTING_ENABLED'
|
|
118
123
|
}
|
|
119
124
|
},
|
|
@@ -123,7 +128,8 @@ const ENV_MAPPING = {
|
|
|
123
128
|
enabled: 'NEW_RELIC_SPAN_EVENTS_ATTRIBUTES_ENABLED',
|
|
124
129
|
exclude: 'NEW_RELIC_SPAN_EVENTS_ATTRIBUTES_EXCLUDE',
|
|
125
130
|
include: 'NEW_RELIC_SPAN_EVENTS_ATTRIBUTES_INCLUDE'
|
|
126
|
-
}
|
|
131
|
+
},
|
|
132
|
+
max_samples_stored: 'NEW_RELIC_SPAN_EVENTS_MAX_SAMPLES_STORED'
|
|
127
133
|
},
|
|
128
134
|
transaction_segments: {
|
|
129
135
|
attributes: {
|
|
@@ -190,13 +196,11 @@ const LIST_VARS = new Set([
|
|
|
190
196
|
|
|
191
197
|
// Mapping to customize the split delimiter for the LIST_VARS
|
|
192
198
|
const LIST_VARS_CUSTOM_DELIMITERS = {
|
|
193
|
-
|
|
199
|
+
NEW_RELIC_APP_NAME: /;|,/
|
|
194
200
|
}
|
|
195
201
|
|
|
196
202
|
// Values in object lists are comma-delimited object literals
|
|
197
|
-
const OBJECT_LIST_VARS = new Set([
|
|
198
|
-
'NEW_RELIC_NAMING_RULES'
|
|
199
|
-
])
|
|
203
|
+
const OBJECT_LIST_VARS = new Set(['NEW_RELIC_NAMING_RULES'])
|
|
200
204
|
|
|
201
205
|
// Values in boolean variables. Is pretty tolerant about values, but don't get
|
|
202
206
|
// fancy--just use 'true' and 'false', everybody.
|
|
@@ -239,15 +243,16 @@ const BOOLEAN_VARS = new Set([
|
|
|
239
243
|
'NEW_RELIC_NATIVE_METRICS_ENABLED'
|
|
240
244
|
])
|
|
241
245
|
|
|
242
|
-
const FLOAT_VARS = new Set([
|
|
243
|
-
'NEW_RELIC_APDEX_T',
|
|
244
|
-
'NEW_RELIC_TRACER_THRESHOLD'
|
|
245
|
-
])
|
|
246
|
+
const FLOAT_VARS = new Set(['NEW_RELIC_APDEX_T', 'NEW_RELIC_TRACER_THRESHOLD'])
|
|
246
247
|
|
|
247
248
|
const INT_VARS = new Set([
|
|
248
249
|
'NEW_RELIC_EXPLAIN_THRESHOLD',
|
|
249
250
|
'NEW_RELIC_MAX_SQL_SAMPLES',
|
|
250
|
-
'NEW_RELIC_INFINITE_TRACING_SPAN_EVENTS_QUEUE_SIZE'
|
|
251
|
+
'NEW_RELIC_INFINITE_TRACING_SPAN_EVENTS_QUEUE_SIZE',
|
|
252
|
+
'NEW_RELIC_SPAN_EVENTS_MAX_SAMPLES_STORED',
|
|
253
|
+
'NEW_RELIC_CUSTOM_INSIGHTS_EVENTS_MAX_SAMPLES_STORED',
|
|
254
|
+
'NEW_RELIC_TRANSACTION_EVENTS_MAX_SAMPLES_STORED',
|
|
255
|
+
'NEW_RELIC_ERROR_COLLECTOR_MAX_EVENT_SAMPLES_STORED'
|
|
251
256
|
])
|
|
252
257
|
|
|
253
258
|
exports.ENV_MAPPING = ENV_MAPPING
|