newrelic 8.3.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.
Files changed (128) hide show
  1. package/NEWS.md +34 -0
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/api.js +74 -68
  4. package/bin/test-naming-rules.js +22 -22
  5. package/lib/agent.js +4 -4
  6. package/lib/attributes.js +2 -2
  7. package/lib/collector/api.js +12 -12
  8. package/lib/collector/facts.js +1 -1
  9. package/lib/collector/http-agents.js +12 -11
  10. package/lib/collector/key-parser.js +1 -1
  11. package/lib/collector/remote-method.js +27 -26
  12. package/lib/config/attribute-filter.js +23 -23
  13. package/lib/config/default.js +12 -10
  14. package/lib/config/hsm.js +1 -1
  15. package/lib/config/index.js +82 -66
  16. package/lib/config/lasp.js +3 -3
  17. package/lib/config/merge-server-config.js +1 -1
  18. package/lib/db/parse-sql.js +8 -8
  19. package/lib/db/parsed-statement.js +9 -8
  20. package/lib/db/query-parsers/sql.js +7 -7
  21. package/lib/db/query-sample.js +9 -9
  22. package/lib/db/query-trace-aggregator.js +4 -4
  23. package/lib/db/statement-matcher.js +5 -5
  24. package/lib/db/utils.js +1 -1
  25. package/lib/environment.js +43 -43
  26. package/lib/errors/error-collector.js +2 -2
  27. package/lib/errors/error-trace-aggregator.js +1 -1
  28. package/lib/errors/helper.js +3 -3
  29. package/lib/errors/index.js +17 -17
  30. package/lib/header-attributes.js +6 -6
  31. package/lib/header-processing.js +1 -1
  32. package/lib/instrumentation/amqplib.js +26 -26
  33. package/lib/instrumentation/bluebird.js +3 -3
  34. package/lib/instrumentation/cassandra-driver.js +7 -3
  35. package/lib/instrumentation/connect.js +4 -4
  36. package/lib/instrumentation/core/async_hooks.js +6 -6
  37. package/lib/instrumentation/core/domain.js +2 -2
  38. package/lib/instrumentation/core/globals.js +1 -1
  39. package/lib/instrumentation/core/http-outbound.js +14 -83
  40. package/lib/instrumentation/core/http.js +34 -67
  41. package/lib/instrumentation/core/inspector.js +2 -2
  42. package/lib/instrumentation/core/timers.js +7 -7
  43. package/lib/instrumentation/core/zlib.js +2 -2
  44. package/lib/instrumentation/director.js +4 -4
  45. package/lib/instrumentation/express.js +8 -8
  46. package/lib/instrumentation/generic-pool.js +1 -1
  47. package/lib/instrumentation/hapi/hapi-17.js +11 -11
  48. package/lib/instrumentation/hapi/shared.js +1 -1
  49. package/lib/instrumentation/hapi.js +22 -22
  50. package/lib/instrumentation/ioredis.js +7 -7
  51. package/lib/instrumentation/memcached.js +7 -7
  52. package/lib/instrumentation/mongodb/common.js +4 -1
  53. package/lib/instrumentation/mysql.js +19 -19
  54. package/lib/instrumentation/oracle.js +15 -15
  55. package/lib/instrumentation/pg.js +4 -4
  56. package/lib/instrumentation/promise.js +46 -46
  57. package/lib/instrumentation/q.js +2 -2
  58. package/lib/instrumentation/redis.js +11 -11
  59. package/lib/instrumentation/restify.js +1 -1
  60. package/lib/instrumentation/vision.js +4 -4
  61. package/lib/instrumentation/when.js +3 -3
  62. package/lib/instrumentations.js +1 -1
  63. package/lib/logger.js +5 -5
  64. package/lib/metrics/index.js +15 -15
  65. package/lib/metrics/mapper.js +7 -7
  66. package/lib/metrics/normalizer/rule.js +9 -9
  67. package/lib/metrics/normalizer/tx_segment.js +17 -17
  68. package/lib/metrics/normalizer.js +22 -22
  69. package/lib/metrics/recorders/custom.js +5 -5
  70. package/lib/metrics/recorders/generic.js +3 -3
  71. package/lib/metrics/recorders/http.js +7 -7
  72. package/lib/metrics/recorders/http_external.js +7 -7
  73. package/lib/metrics/recorders/message-transaction.js +5 -6
  74. package/lib/metrics/recorders/other.js +5 -5
  75. package/lib/parse-proc-cpuinfo.js +18 -18
  76. package/lib/parse-proc-meminfo.js +2 -2
  77. package/lib/prioritized-attributes.js +2 -2
  78. package/lib/priority-queue.js +10 -10
  79. package/lib/reservoir.js +3 -3
  80. package/lib/sampler.js +26 -26
  81. package/lib/shim/datastore-shim.js +35 -32
  82. package/lib/shim/index.js +2 -2
  83. package/lib/shim/message-shim.js +47 -47
  84. package/lib/shim/promise-shim.js +1 -1
  85. package/lib/shim/shim.js +61 -61
  86. package/lib/shim/specs/index.js +3 -3
  87. package/lib/shim/transaction-shim.js +44 -192
  88. package/lib/shim/webframework-shim.js +52 -52
  89. package/lib/spans/span-event.js +1 -1
  90. package/lib/spans/streaming-span-attributes.js +1 -1
  91. package/lib/stats/apdex.js +2 -2
  92. package/lib/stats/index.js +2 -2
  93. package/lib/system-info.js +23 -23
  94. package/lib/timer.js +5 -5
  95. package/lib/transaction/dt-payload.js +1 -1
  96. package/lib/transaction/index.js +40 -40
  97. package/lib/transaction/name-state.js +14 -14
  98. package/lib/transaction/trace/exclusive-time-calculator.js +6 -6
  99. package/lib/transaction/trace/index.js +14 -14
  100. package/lib/transaction/trace/segment.js +18 -18
  101. package/lib/transaction/tracecontext.js +1 -1
  102. package/lib/transaction/tracer/index.js +53 -49
  103. package/lib/uninstrumented.js +7 -7
  104. package/lib/util/arity.js +2 -2
  105. package/lib/util/byte-limit.js +4 -4
  106. package/lib/util/cat.js +269 -24
  107. package/lib/util/codec.js +2 -2
  108. package/lib/util/copy.js +2 -2
  109. package/lib/util/deep-equal.js +10 -10
  110. package/lib/util/flatten.js +4 -4
  111. package/lib/util/hashes.js +14 -14
  112. package/lib/util/label-parser.js +17 -17
  113. package/lib/util/logger.js +24 -24
  114. package/lib/util/process-version.js +2 -2
  115. package/lib/util/properties.js +4 -4
  116. package/lib/util/sql/obfuscate.js +15 -15
  117. package/lib/util/stream-sink.js +3 -3
  118. package/lib/util/unwrapped-core.js +2 -2
  119. package/lib/util/urltils.js +16 -16
  120. package/lib/utilization/aws-info.js +7 -7
  121. package/lib/utilization/azure-info.js +6 -6
  122. package/lib/utilization/common.js +13 -13
  123. package/lib/utilization/docker-info.js +11 -11
  124. package/lib/utilization/gcp-info.js +4 -4
  125. package/lib/utilization/index.js +5 -5
  126. package/lib/utilization/pcf-info.js +9 -9
  127. package/package.json +7 -2
  128. package/stub_api.js +8 -8
@@ -36,7 +36,7 @@ const FAILURE_DISCARD_DATA = new Set([400, 403, 404, 405, 407, 411, 413, 414, 41
36
36
  const AGENT_RUN_BEHAVIOR = CollectorResponse.AGENT_RUN_BEHAVIOR
37
37
 
38
38
  function dumpErrors(errors, name) {
39
- var index = 1
39
+ let index = 1
40
40
 
41
41
  errors.forEach(function forEachError(error) {
42
42
  logger.trace(error, 'Error %s during %s:', index++, name)
@@ -169,7 +169,7 @@ CollectorAPI.prototype.connect = function connect(callback) {
169
169
  )
170
170
  }
171
171
 
172
- let backoff = BACKOFFS[Math.min(attempts, max) - 1]
172
+ const backoff = BACKOFFS[Math.min(attempts, max) - 1]
173
173
  if (backoff.warn) {
174
174
  logger.warn('No connection has been established to New Relic after %d attempts.', attempts)
175
175
  }
@@ -192,9 +192,9 @@ CollectorAPI.prototype.connect = function connect(callback) {
192
192
  }
193
193
 
194
194
  CollectorAPI.prototype._login = function _login(callback) {
195
- var methods = this._methods
196
- var agent = this._agent
197
- var self = this
195
+ const methods = this._methods
196
+ const agent = this._agent
197
+ const self = this
198
198
 
199
199
  const preconnectData = { high_security: agent.config.high_security }
200
200
  if (agent.config.security_policies_token) {
@@ -217,7 +217,7 @@ CollectorAPI.prototype._login = function _login(callback) {
217
217
  agent.config.host
218
218
  )
219
219
  } else {
220
- var parts = res.redirect_host.split(':')
220
+ const parts = res.redirect_host.split(':')
221
221
  if (parts.length > 2) {
222
222
  logger.error(
223
223
  "Requesting collector from %s returned bogus result '%s'; trying default.",
@@ -241,7 +241,7 @@ CollectorAPI.prototype._login = function _login(callback) {
241
241
  }
242
242
  }
243
243
 
244
- var policies = res.security_policies || Object.create(null)
244
+ const policies = res.security_policies || Object.create(null)
245
245
 
246
246
  const laspResponse = agent.config.applyLasp(agent, policies)
247
247
  if (laspResponse.shouldShutdownRun()) {
@@ -253,8 +253,8 @@ CollectorAPI.prototype._login = function _login(callback) {
253
253
  }
254
254
 
255
255
  CollectorAPI.prototype._getFacts = function _getFacts(lasp, callback) {
256
- var agent = this._agent
257
- var self = this
256
+ const agent = this._agent
257
+ const self = this
258
258
 
259
259
  facts(agent, function getEnvDict(environmentDict) {
260
260
  if (lasp) {
@@ -263,7 +263,7 @@ CollectorAPI.prototype._getFacts = function _getFacts(lasp, callback) {
263
263
 
264
264
  // The collector really likes arrays.
265
265
  // In fact, it kind of insists on them.
266
- var environment = [environmentDict]
266
+ const environment = [environmentDict]
267
267
 
268
268
  self._connect(environment, callback)
269
269
  })
@@ -491,7 +491,7 @@ CollectorAPI.prototype.shutdown = function shutdown(callback) {
491
491
 
492
492
  logger.info('Shutting down collector.')
493
493
 
494
- var agent = this._agent
494
+ const agent = this._agent
495
495
  this._methods.shutdown.invoke(null, this._reqHeadersMap, onShutdown)
496
496
 
497
497
  function onShutdown(error, response) {
@@ -511,7 +511,7 @@ CollectorAPI.prototype.restart = function restart(callback) {
511
511
  logger.info('Restarting collector.')
512
512
 
513
513
  this._agent.stopAggregators()
514
- var api = this
514
+ const api = this
515
515
  this.shutdown(function reconnect() {
516
516
  api.connect(function afterConnect() {
517
517
  const shouldImmediatelyHarvest = false
@@ -14,7 +14,7 @@ const parseLabels = require('../util/label-parser')
14
14
  module.exports = facts
15
15
 
16
16
  function facts(agent, callback) {
17
- var startTime = Date.now()
17
+ const startTime = Date.now()
18
18
  a.parallel(
19
19
  {
20
20
  systemInfo: a.apply(fetchSystemInfo, agent),
@@ -5,10 +5,10 @@
5
5
 
6
6
  'use strict'
7
7
 
8
- var parse = require('url').parse
9
- var ProxyAgent = require('https-proxy-agent')
10
- var logger = require('../logger').child({ component: 'http-agent' })
11
- var certificates = require('./ssl/certificates.js')
8
+ const parse = require('url').parse
9
+ const ProxyAgent = require('https-proxy-agent')
10
+ const logger = require('../logger').child({ component: 'http-agent' })
11
+ const certificates = require('./ssl/certificates.js')
12
12
 
13
13
  const https = require('https')
14
14
 
@@ -50,10 +50,10 @@ exports.proxyAgent = function proxyAgent(config) {
50
50
  if (null !== agentProxyWithKeepAlive) {
51
51
  return agentProxyWithKeepAlive
52
52
  }
53
- var opts = proxyOptions(config)
54
- var proxyUrl = opts.proxy_url
53
+ const opts = proxyOptions(config)
54
+ const proxyUrl = opts.proxy_url
55
55
 
56
- var proxyOpts = {
56
+ const proxyOpts = {
57
57
  host: proxyUrl.host,
58
58
  port: proxyUrl.port,
59
59
  protocol: proxyUrl.protocol,
@@ -78,17 +78,18 @@ exports.proxyAgent = function proxyAgent(config) {
78
78
  }
79
79
 
80
80
  function proxyOptions(config) {
81
+ let proxyUrl
81
82
  if (config.proxy) {
82
- var parsedUrl = parse(config.proxy)
83
+ const parsedUrl = parse(config.proxy)
83
84
 
84
- var proxyUrl = {
85
+ proxyUrl = {
85
86
  protocol: parsedUrl.protocol || 'https:',
86
87
  host: parsedUrl.hostname,
87
88
  port: parsedUrl.port || 80,
88
89
  auth: parsedUrl.auth
89
90
  }
90
91
  } else {
91
- var proxyAuth = config.proxy_user
92
+ let proxyAuth = config.proxy_user
92
93
  if (config.proxy_pass !== '') {
93
94
  proxyAuth += ':' + config.proxy_pass
94
95
  }
@@ -102,7 +103,7 @@ function proxyOptions(config) {
102
103
  }
103
104
  }
104
105
 
105
- var opts = {
106
+ const opts = {
106
107
  proxy_url: proxyUrl
107
108
  }
108
109
 
@@ -6,6 +6,6 @@
6
6
  'use strict'
7
7
 
8
8
  module.exports.parseKey = function parseKey(licenseKey) {
9
- var regionMatch = /^(.+?)x/.exec(licenseKey)
9
+ const regionMatch = /^(.+?)x/.exec(licenseKey)
10
10
  return regionMatch && regionMatch[1]
11
11
  }
@@ -5,16 +5,16 @@
5
5
 
6
6
  'use strict'
7
7
 
8
- var util = require('util')
9
- var url = require('url')
10
- var https = require('https')
11
- var zlib = require('zlib')
12
- var logger = require('../logger').child({ component: 'remote_method' })
13
- var parse = require('./parse-response')
14
- var stringify = require('json-stringify-safe')
15
- var Sink = require('../util/stream-sink')
16
- var agents = require('./http-agents')
17
- var certificates = require('./ssl/certificates')
8
+ const util = require('util')
9
+ const url = require('url')
10
+ const https = require('https')
11
+ const zlib = require('zlib')
12
+ const logger = require('../logger').child({ component: 'remote_method' })
13
+ const parse = require('./parse-response')
14
+ const stringify = require('json-stringify-safe')
15
+ const Sink = require('../util/stream-sink')
16
+ const agents = require('./http-agents')
17
+ const certificates = require('./ssl/certificates')
18
18
  const isValidLength = require('../util/byte-limit').isValidLength
19
19
 
20
20
  /*
@@ -50,8 +50,9 @@ RemoteMethod.prototype.updateEndpoint = function updateEndpoint(endpoint) {
50
50
  }
51
51
 
52
52
  RemoteMethod.prototype.serialize = function serialize(payload, callback) {
53
+ let res
53
54
  try {
54
- var res = stringify(payload)
55
+ res = stringify(payload)
55
56
  } catch (error) {
56
57
  logger.error(error, 'Unable to serialize payload for method %s.', this.name)
57
58
  return process.nextTick(function onNextTick() {
@@ -102,8 +103,8 @@ RemoteMethod.prototype.invoke = function invoke(payload, nrHeaders, callback) {
102
103
  * @param {Function} callback What to do next. Gets passed any error.
103
104
  */
104
105
  RemoteMethod.prototype._post = function _post(data, nrHeaders, callback) {
105
- var method = this
106
- var options = {
106
+ const method = this
107
+ const options = {
107
108
  port: this.endpoint.port,
108
109
  host: this.endpoint.host,
109
110
  compressed: this._shouldCompress(data),
@@ -121,8 +122,8 @@ RemoteMethod.prototype._post = function _post(data, nrHeaders, callback) {
121
122
  if (options.compressed) {
122
123
  // NOTE: gzip and deflate throw immediately in Node 14+ with an invalid argument
123
124
  try {
124
- var useGzip = this._config.compressed_content_encoding === 'gzip'
125
- var compressor = useGzip ? zlib.gzip : zlib.deflate
125
+ const useGzip = this._config.compressed_content_encoding === 'gzip'
126
+ const compressor = useGzip ? zlib.gzip : zlib.deflate
126
127
  compressor(data, function onCompress(err, compressed) {
127
128
  if (err) {
128
129
  logger.warn(err, 'Error compressing JSON for delivery. Not sending.')
@@ -197,11 +198,11 @@ RemoteMethod.prototype._safeRequest = function _safeRequest(options) {
197
198
  throw new Error('Must include URL to request!')
198
199
  }
199
200
 
200
- var protocol = 'https'
201
- var logConfig = this._config.logging
202
- var auditLog = this._config.audit_log
201
+ const protocol = 'https'
202
+ const logConfig = this._config.logging
203
+ const auditLog = this._config.audit_log
203
204
  const maxPayloadSize = this._config.max_payload_size_in_bytes
204
- var level = 'trace'
205
+ let level = 'trace'
205
206
 
206
207
  if (!isValidLength(options.body, maxPayloadSize)) {
207
208
  logger.warn(
@@ -252,7 +253,7 @@ RemoteMethod.prototype._safeRequest = function _safeRequest(options) {
252
253
  * ._post).
253
254
  */
254
255
  RemoteMethod.prototype._request = function _request(options) {
255
- var requestOptions = {
256
+ const requestOptions = {
256
257
  method: this._config.put_for_data_send ? 'PUT' : 'POST',
257
258
  setHost: false, // See below
258
259
  host: options.host, // Set explicitly in the headers
@@ -262,9 +263,9 @@ RemoteMethod.prototype._request = function _request(options) {
262
263
  agent: agents.keepAliveAgent(),
263
264
  __NR__connection: true // Who measures the metrics measurer?
264
265
  }
265
- var request
266
+ let request
266
267
 
267
- var isProxy = !!(this._config.proxy || this._config.proxy_port || this._config.proxy_host)
268
+ const isProxy = !!(this._config.proxy || this._config.proxy_port || this._config.proxy_host)
268
269
 
269
270
  if (isProxy) {
270
271
  // proxy
@@ -317,7 +318,7 @@ RemoteMethod.prototype._userAgent = function _userAgent() {
317
318
  * @returns {string} The URL path to be POSTed to.
318
319
  */
319
320
  RemoteMethod.prototype._path = function _path() {
320
- var query = {
321
+ const query = {
321
322
  marshal_format: 'json',
322
323
  protocol_version: this._protocolVersion,
323
324
  license_key: this._config.license_key,
@@ -328,7 +329,7 @@ RemoteMethod.prototype._path = function _path() {
328
329
  query[RUN_ID_NAME] = this._config.run_id
329
330
  }
330
331
 
331
- var formatted = url.format({
332
+ const formatted = url.format({
332
333
  pathname: RAW_METHOD_PATH,
333
334
  query: query
334
335
  })
@@ -343,9 +344,9 @@ RemoteMethod.prototype._path = function _path() {
343
344
  * @param {bool} options.compressed - The compression method used, if any.
344
345
  */
345
346
  RemoteMethod.prototype._headers = function _headers(options) {
346
- var agent = this._userAgent()
347
+ const agent = this._userAgent()
347
348
 
348
- var headers = {
349
+ const headers = {
349
350
  // select the virtual host on the server end
350
351
  'Host': this.endpoint.host,
351
352
  'User-Agent': agent,
@@ -5,9 +5,9 @@
5
5
 
6
6
  'use strict'
7
7
 
8
- var NO_MATCH = -Infinity
9
- var EXACT_MATCH = Infinity
10
- var DESTINATIONS = {
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,
@@ -62,7 +62,7 @@ function AttributeFilter(config) {
62
62
  this._cachedCount = 0
63
63
  this._enabledDestinations = DESTINATIONS.NONE
64
64
 
65
- var updater = this.update.bind(this)
65
+ const updater = this.update.bind(this)
66
66
 
67
67
  // Add the global rules.
68
68
  config.on('attributes.enabled', updater)
@@ -140,21 +140,21 @@ AttributeFilter.prototype._filter = function _filter(scope, destinations, key) {
140
140
  }
141
141
 
142
142
  // These are lazy computed to avoid calculating them for cached results.
143
- var globalInclude = null
144
- var globalExclude = null
143
+ let globalInclude = null
144
+ let globalExclude = null
145
145
 
146
146
  // Iterate over each destination and see if the rules apply.
147
- for (var i = 0; i < scope.length; ++i) {
148
- var dest = scope[i]
149
- var destId = dest.id
150
- var destName = dest.name
147
+ for (let i = 0; i < scope.length; ++i) {
148
+ const dest = scope[i]
149
+ const destId = dest.id
150
+ const destName = dest.name
151
151
  if (!(this._enabledDestinations & destId)) {
152
152
  destinations &= ~destId // Remove this destination.
153
153
  continue
154
154
  }
155
155
 
156
156
  // Check for a cached result for this key.
157
- var result = this._cache[destName][key]
157
+ let result = this._cache[destName][key]
158
158
  if (result === undefined) {
159
159
  if (globalInclude === null) {
160
160
  globalInclude = _matchRules(this._rules.global.include, key)
@@ -162,7 +162,7 @@ AttributeFilter.prototype._filter = function _filter(scope, destinations, key) {
162
162
  }
163
163
 
164
164
  // Freshly calculate this attribute.
165
- var result = _doTest(globalInclude, globalExclude, this._rules[destName], key)
165
+ result = _doTest(globalInclude, globalExclude, this._rules[destName], key)
166
166
  if (this._cachedCount < this.config.attributes.filter_cache_limit) {
167
167
  this._cache[destName][key] = result
168
168
  ++this._cachedCount
@@ -195,7 +195,7 @@ AttributeFilter.prototype.update = function update() {
195
195
 
196
196
  // And all the destination rules.
197
197
  DESTINATION_DETAILS.forEach(function forEachDestination(dest) {
198
- var name = dest.name
198
+ const name = dest.name
199
199
  if (!this.config[name].attributes.enabled) {
200
200
  return
201
201
  }
@@ -222,7 +222,7 @@ function _doTest(globalInclude, globalExclude, destConfig, key) {
222
222
  if (globalExclude === EXACT_MATCH) {
223
223
  return false
224
224
  }
225
- var destExclude = _matchRules(destConfig.exclude, key)
225
+ const destExclude = _matchRules(destConfig.exclude, key)
226
226
  if (destExclude === EXACT_MATCH) {
227
227
  return false
228
228
  }
@@ -231,7 +231,7 @@ function _doTest(globalInclude, globalExclude, destConfig, key) {
231
231
  if (globalInclude === EXACT_MATCH) {
232
232
  return true
233
233
  }
234
- var destInclude = _matchRules(destConfig.include, key)
234
+ const destInclude = _matchRules(destConfig.include, key)
235
235
  if (destInclude === EXACT_MATCH) {
236
236
  return true
237
237
  }
@@ -276,7 +276,7 @@ function _matchRules(rules, key) {
276
276
  return EXACT_MATCH
277
277
  }
278
278
 
279
- var wildcard = rules.wildcard
279
+ const wildcard = rules.wildcard
280
280
  if (!wildcard) {
281
281
  return NO_MATCH
282
282
  }
@@ -296,12 +296,12 @@ function _matchRules(rules, key) {
296
296
  * `RegExp` instances for testing keys.
297
297
  */
298
298
  function _importRules(rules) {
299
- var out = {
299
+ const out = {
300
300
  exact: null,
301
301
  wildcard: null
302
302
  }
303
- var exactRules = []
304
- var wildcardRules = []
303
+ const exactRules = []
304
+ const wildcardRules = []
305
305
  rules.forEach(function separateRules(rule) {
306
306
  if (rule[rule.length - 1] === '*') {
307
307
  wildcardRules.push(rule)
@@ -376,17 +376,17 @@ function _convertRulesToRegex(rules) {
376
376
  add(collection, ruleParts, 0)
377
377
  return collection
378
378
  function add(c, r, i) {
379
- var v = r[i]
379
+ let v = r[i]
380
380
  if (i !== r.length - 1) {
381
381
  v += '.'
382
382
  } else if (/\\\*$/.test(v)) {
383
383
  v = v.substr(0, v.length - 2)
384
384
  }
385
385
 
386
- var idx = c.findIndex(function findV(a) {
386
+ const idx = c.findIndex(function findV(a) {
387
387
  return a[0] === v
388
388
  })
389
- var part = c[idx]
389
+ let part = c[idx]
390
390
 
391
391
  if (idx === -1) {
392
392
  part = [v]
@@ -410,7 +410,7 @@ function _convertRulesToRegex(rules) {
410
410
  } else if (p.length === 1) {
411
411
  return mapper(p[0])
412
412
  }
413
- var first = mapper(p.shift()) // shift === pop_front
413
+ const first = mapper(p.shift()) // shift === pop_front
414
414
  return first + '(?:' + p.map(mapper).join('|') + ')'
415
415
  }
416
416
  })
@@ -292,7 +292,7 @@ exports.config = () => ({
292
292
  */
293
293
  capture_events: true,
294
294
  /**
295
- * The agent will collect all error events up to this number every 5 seconds.
295
+ * The agent will collect all error events up to this number per minute.
296
296
  * If there are more than that, a statistical sampling will be collected.
297
297
  * Currently this uses a priority sampling algorithm.
298
298
  *
@@ -651,7 +651,7 @@ exports.config = () => ({
651
651
  */
652
652
  enabled: true,
653
653
  /**
654
- * The agent will collect all events up to this number every 5 seconds. If
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
656
  *
657
657
  * @env NEW_RELIC_TRANSACTION_EVENTS_MAX_SAMPLES_STORED
@@ -676,7 +676,7 @@ exports.config = () => ({
676
676
  */
677
677
  enabled: true,
678
678
  /**
679
- * The agent will collect all events up to this number every 5 seconds. If there
679
+ * The agent will collect all events up to this number per minute. If there
680
680
  * are more than that, a statistical sampling will be collected. Currently
681
681
  * this uses a priority sampling algorithm.
682
682
  *
@@ -759,11 +759,11 @@ exports.config = () => ({
759
759
  /**
760
760
  * Controls behavior of datastore instance metrics.
761
761
  *
762
- * @property {bool} [instance_reporting.enabled=true]
762
+ * @property {Boolean} [instance_reporting.enabled=true]
763
763
  * Enables reporting the host and port/path/id of database servers. Default
764
764
  * is `true`.
765
765
  *
766
- * @property {bool} [database_name_reporting.enabled=true]
766
+ * @property {Boolean} [database_name_reporting.enabled=true]
767
767
  * Enables reporting of database/schema names. Default is `true`.
768
768
  */
769
769
  datastore_tracer: {
@@ -847,7 +847,7 @@ exports.config = () => ({
847
847
  * distributed system. Enabling distributed tracing changes the behavior of some
848
848
  * New Relic features, so carefully consult the transition guide before you enable
849
849
  * this feature: https://docs.newrelic.com/docs/transition-guide-distributed-tracing
850
- * Default is false.
850
+ * Default is true.
851
851
  */
852
852
  distributed_tracing: {
853
853
  /**
@@ -871,15 +871,17 @@ exports.config = () => ({
871
871
  /**
872
872
  * Controls the use of cross-application tracing.
873
873
  *
874
- * @property {bool} [enabled=true]
875
- * Enables tracing transactions across multiple applications. Default is `true`.
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.
876
878
  */
877
- cross_application_tracer: { enabled: true },
879
+ cross_application_tracer: { enabled: false },
878
880
 
879
881
  /**
880
882
  * Controls behavior of message broker tracing.
881
883
  *
882
- * @property {bool} [segment_parameters.enabled=true]
884
+ * @property {Boolean} [segment_parameters.enabled=true]
883
885
  * Enables reporting parameters on message broker segments.
884
886
  */
885
887
  message_tracer: {
package/lib/config/hsm.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  'use strict'
7
7
 
8
- var flatten = require('../util/flatten')
8
+ const flatten = require('../util/flatten')
9
9
 
10
10
  // Config keys that can't be set by the server if high_security is enabled
11
11
  const HIGH_SECURITY_SETTINGS = {