newrelic 7.5.2 → 8.3.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 +4989 -4886
- package/THIRD_PARTY_NOTICES.md +625 -216
- package/api.js +105 -174
- package/bin/test-naming-rules.js +38 -32
- package/bin/tracetractor +0 -1
- package/index.js +12 -18
- package/lib/agent.js +108 -111
- package/lib/aggregators/base-aggregator.js +1 -1
- package/lib/aggregators/event-aggregator.js +6 -6
- package/lib/attributes.js +12 -13
- package/lib/collector/api.js +32 -42
- package/lib/collector/facts.js +67 -65
- package/lib/collector/http-agents.js +30 -27
- package/lib/collector/parse-response.js +1 -2
- package/lib/collector/remote-method.js +43 -36
- package/lib/collector/serverless.js +13 -18
- package/lib/collector/ssl/certificates.js +1056 -1056
- package/lib/config/attribute-filter.js +90 -82
- package/lib/config/default.js +30 -18
- package/lib/config/env.js +17 -12
- package/lib/config/harvest-config-validator.js +1 -1
- package/lib/config/index.js +160 -177
- package/lib/config/merge-server-config.js +7 -5
- package/lib/custom-events/custom-event-aggregator.js +1 -1
- package/lib/db/parse-sql.js +6 -9
- package/lib/db/parsed-statement.js +6 -13
- package/lib/db/query-parsers/sql.js +6 -9
- package/lib/db/query-sample.js +7 -3
- package/lib/db/query-trace-aggregator.js +12 -12
- package/lib/db/utils.js +1 -1
- package/lib/environment.js +173 -138
- package/lib/errors/error-collector.js +18 -31
- package/lib/errors/error-event-aggregator.js +1 -1
- package/lib/errors/error-trace-aggregator.js +2 -3
- package/lib/errors/helper.js +21 -30
- package/lib/errors/index.js +16 -28
- package/lib/feature_flags.js +5 -8
- package/lib/grpc/connection/states.js +6 -6
- package/lib/grpc/connection.js +35 -46
- package/lib/header-attributes.js +49 -53
- package/lib/instrumentation/amqplib.js +8 -17
- package/lib/instrumentation/bluebird.js +61 -20
- package/lib/instrumentation/cassandra-driver.js +2 -2
- package/lib/instrumentation/connect.js +4 -3
- package/lib/instrumentation/core/async_hooks.js +11 -4
- 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 +2 -8
- package/lib/instrumentation/core/fs.js +22 -37
- package/lib/instrumentation/core/globals.js +3 -7
- package/lib/instrumentation/core/http-outbound.js +15 -40
- package/lib/instrumentation/core/http.js +29 -63
- package/lib/instrumentation/core/inspector.js +6 -10
- package/lib/instrumentation/core/net.js +3 -1
- package/lib/instrumentation/core/timers.js +17 -24
- package/lib/instrumentation/core/zlib.js +2 -10
- package/lib/instrumentation/express.js +4 -2
- package/lib/instrumentation/fastify/spec-builders.js +5 -0
- package/lib/instrumentation/fastify.js +37 -10
- package/lib/instrumentation/hapi/hapi-17.js +9 -10
- package/lib/instrumentation/hapi.js +15 -15
- package/lib/instrumentation/ioredis.js +1 -2
- package/lib/instrumentation/memcached.js +39 -43
- package/lib/instrumentation/mongodb/common.js +218 -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 +33 -26
- package/lib/instrumentation/oracle.js +10 -14
- package/lib/instrumentation/pg.js +30 -21
- package/lib/instrumentation/promise.js +20 -17
- package/lib/instrumentation/redis.js +30 -30
- package/lib/instrumentation/when.js +9 -1
- package/lib/instrumentations.js +24 -24
- package/lib/logger.js +1 -1
- package/lib/metrics/index.js +37 -17
- package/lib/metrics/mapper.js +9 -9
- package/lib/metrics/metric-aggregator.js +5 -10
- package/lib/metrics/names.js +8 -7
- package/lib/metrics/normalizer/rule.js +6 -7
- package/lib/metrics/normalizer/tx_segment.js +17 -13
- package/lib/metrics/normalizer.js +30 -33
- package/lib/metrics/recorders/custom.js +3 -1
- package/lib/metrics/recorders/distributed-trace.js +3 -18
- package/lib/metrics/recorders/generic.js +3 -2
- package/lib/metrics/recorders/http.js +4 -6
- package/lib/metrics/recorders/http_external.js +1 -3
- package/lib/metrics/recorders/message-transaction.js +2 -12
- package/lib/metrics/recorders/other.js +2 -12
- package/lib/parse-proc-cpuinfo.js +11 -16
- package/lib/parse-proc-meminfo.js +5 -3
- package/lib/prioritized-attributes.js +12 -17
- package/lib/priority-queue.js +1 -1
- package/lib/proxy/grpc.js +1 -1
- package/lib/reservoir.js +9 -3
- package/lib/sampler.js +12 -13
- 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 +29 -38
- package/lib/shim/index.js +8 -9
- package/lib/shim/message-shim.js +111 -113
- package/lib/shim/promise-shim.js +18 -13
- package/lib/shim/shim.js +72 -66
- package/lib/shim/specs/index.js +18 -19
- package/lib/shim/transaction-shim.js +26 -36
- package/lib/shim/webframework-shim.js +25 -35
- package/lib/shimmer.js +184 -166
- package/lib/spans/create-span-event-aggregator.js +24 -44
- package/lib/spans/span-context.js +4 -10
- package/lib/spans/span-event-aggregator.js +68 -13
- package/lib/spans/span-event.js +5 -7
- package/lib/spans/span-streamer.js +10 -18
- package/lib/spans/streaming-span-event-aggregator.js +1 -1
- package/lib/spans/streaming-span-event.js +4 -4
- package/lib/stats/apdex.js +5 -11
- package/lib/stats/index.js +12 -17
- package/lib/system-info.js +7 -3
- package/lib/timer.js +30 -16
- package/lib/transaction/dt-payload.js +1 -1
- package/lib/transaction/handle.js +19 -19
- package/lib/transaction/index.js +94 -112
- package/lib/transaction/name-state.js +5 -6
- package/lib/transaction/trace/aggregator.js +78 -73
- package/lib/transaction/trace/exclusive-time-calculator.js +5 -9
- package/lib/transaction/trace/index.js +26 -24
- package/lib/transaction/trace/segment.js +39 -56
- package/lib/transaction/tracecontext.js +37 -45
- package/lib/transaction/tracer/index.js +79 -44
- package/lib/transaction/transaction-event-aggregator.js +29 -31
- package/lib/uninstrumented.js +4 -5
- package/lib/util/attribute-types.js +1 -5
- package/lib/util/byte-limit.js +0 -1
- package/lib/util/cat.js +5 -13
- package/lib/util/codec.js +8 -4
- package/lib/util/deep-equal.js +48 -18
- package/lib/util/flatten.js +5 -2
- package/lib/util/hashes.js +2 -2
- package/lib/util/label-parser.js +7 -13
- package/lib/util/logger.js +31 -13
- package/lib/util/process-version.js +1 -1
- package/lib/util/properties.js +1 -1
- package/lib/util/sql/obfuscate.js +7 -17
- package/lib/util/stream-sink.js +2 -3
- package/lib/util/urltils.js +9 -13
- package/lib/utilization/aws-info.js +2 -3
- package/lib/utilization/azure-info.js +32 -30
- package/lib/utilization/common.js +5 -4
- package/lib/utilization/docker-info.js +4 -6
- package/lib/utilization/gcp-info.js +36 -35
- package/lib/utilization/index.js +1 -1
- package/lib/utilization/kubernetes-info.js +2 -2
- package/lib/utilization/pcf-info.js +4 -4
- package/package.json +32 -18
- package/stub_api.js +8 -6
|
@@ -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]
|
|
@@ -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
|
)
|
|
@@ -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
|
+
var 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
|
+
var idx = c.findIndex(function findV(a) {
|
|
387
|
+
return a[0] === v
|
|
388
|
+
})
|
|
389
|
+
var 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
|
+
var 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.
|
|
@@ -293,7 +292,7 @@ exports.config = () => ({
|
|
|
293
292
|
*/
|
|
294
293
|
capture_events: true,
|
|
295
294
|
/**
|
|
296
|
-
* The agent will collect all error events up to this number
|
|
295
|
+
* The agent will collect all error events up to this number every 5 seconds.
|
|
297
296
|
* If there are more than that, a statistical sampling will be collected.
|
|
298
297
|
* Currently this uses a priority sampling algorithm.
|
|
299
298
|
*
|
|
@@ -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
|
|
@@ -651,8 +651,10 @@ exports.config = () => ({
|
|
|
651
651
|
*/
|
|
652
652
|
enabled: true,
|
|
653
653
|
/**
|
|
654
|
-
* The agent will collect all events up to this number
|
|
654
|
+
* The agent will collect all events up to this number every 5 seconds. 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
|
},
|
|
@@ -674,7 +676,7 @@ exports.config = () => ({
|
|
|
674
676
|
*/
|
|
675
677
|
enabled: true,
|
|
676
678
|
/**
|
|
677
|
-
* The agent will collect all events up to this number
|
|
679
|
+
* The agent will collect all events up to this number every 5 seconds. If there
|
|
678
680
|
* are more than that, a statistical sampling will be collected. Currently
|
|
679
681
|
* this uses a priority sampling algorithm.
|
|
680
682
|
*
|
|
@@ -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
|
},
|
|
@@ -762,8 +767,8 @@ exports.config = () => ({
|
|
|
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
|
/**
|
|
@@ -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
|
|
@@ -862,7 +874,7 @@ exports.config = () => ({
|
|
|
862
874
|
* @property {bool} [enabled=true]
|
|
863
875
|
* Enables tracing transactions across multiple applications. Default is `true`.
|
|
864
876
|
*/
|
|
865
|
-
cross_application_tracer: {enabled: true},
|
|
877
|
+
cross_application_tracer: { enabled: true },
|
|
866
878
|
|
|
867
879
|
/**
|
|
868
880
|
* Controls behavior of message broker tracing.
|
|
@@ -871,7 +883,7 @@ exports.config = () => ({
|
|
|
871
883
|
* Enables reporting parameters on message broker segments.
|
|
872
884
|
*/
|
|
873
885
|
message_tracer: {
|
|
874
|
-
segment_parameters: {enabled: true}
|
|
886
|
+
segment_parameters: { enabled: true }
|
|
875
887
|
},
|
|
876
888
|
|
|
877
889
|
/**
|
|
@@ -917,6 +929,6 @@ exports.config = () => ({
|
|
|
917
929
|
* Controls usage of the native metrics module which samples VM and event
|
|
918
930
|
* loop data.
|
|
919
931
|
*/
|
|
920
|
-
native_metrics: {enabled: true}
|
|
932
|
+
native_metrics: { enabled: true }
|
|
921
933
|
}
|
|
922
934
|
})
|
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
|