newrelic 9.5.0 → 9.6.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 CHANGED
@@ -1,3 +1,13 @@
1
+ ### v9.6.0 (2022-11-09)
2
+
3
+ * Dropped support for `vision`, and instead only instrument `@hapi/vision`.
4
+
5
+ * Updated configuration system to automatically create an environment variable mapping for a new config value.
6
+ * It will follow a convention of `NEW_RELIC_PATH_TO_CONFIG_KEY`.
7
+ * For example if there is a new configuration option of `config.nested.object_path.enabled` the env var would be `NEW_RELIC_NESTED_OBJECT_PATH.ENABLED`.
8
+
9
+ * Removed `transaction_tracer.hide_internals` configuration. All of the internal configuration is now handled by Javascript symbols instead of non-enumerable properties, so there is no longer a performance penalty, as symbols are already hidden by default.
10
+
1
11
  ### v9.5.0 (2022-10-26)
2
12
 
3
13
  * Increased the default limit of custom events from 1,000 events per minute to 3,000 events per minute. In the scenario that custom events were being limited, this change will allow more custom events to be sent to New Relic. There is also a new configurable maximum limit of 100,000 events per minute. To change the limits, see the documentation for [custom_insights_events](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration#custom_events_max_samples_stored). To learn more about the change and how to determine if custom events are being dropped, see our Explorers Hub [post](https://discuss.newrelic.com/t/send-more-custom-events-with-the-latest-apm-agents/190497).
package/index.js CHANGED
@@ -14,6 +14,7 @@ require('./lib/util/unwrapped-core')
14
14
 
15
15
  const featureFlags = require('./lib/feature_flags').prerelease
16
16
  const psemver = require('./lib/util/process-version')
17
+ const symbols = require('./lib/symbols')
17
18
  let logger = require('./lib/logger') // Gets re-loaded after initialization.
18
19
 
19
20
  const pkgJSON = require('./package.json')
@@ -23,15 +24,15 @@ logger.info(
23
24
  process.version
24
25
  )
25
26
 
26
- if (require.cache.__NR_cache) {
27
+ if (require.cache[symbols.cache]) {
27
28
  logger.warn(
28
29
  'Attempting to load a second copy of newrelic from %s, using cache instead',
29
30
  __dirname
30
31
  )
31
- if (require.cache.__NR_cache.agent) {
32
- require.cache.__NR_cache.agent.recordSupportability('Agent/DoubleLoad')
32
+ if (require.cache[symbols.cache].agent) {
33
+ require.cache[symbols.cache].agent.recordSupportability('Agent/DoubleLoad')
33
34
  }
34
- module.exports = require.cache.__NR_cache
35
+ module.exports = require.cache[symbols.cache]
35
36
  } else {
36
37
  initialize()
37
38
  }
@@ -98,7 +99,7 @@ function initialize() {
98
99
  API = require('./stub_api')
99
100
  }
100
101
 
101
- require.cache.__NR_cache = module.exports = new API(agent)
102
+ require.cache[symbols.cache] = module.exports = new API(agent)
102
103
 
103
104
  // If we loaded an agent, record a startup time for the agent.
104
105
  // NOTE: Metrics are recorded in seconds, so divide the value by 1000.
@@ -16,6 +16,7 @@ const Sink = require('../util/stream-sink')
16
16
  const agents = require('./http-agents')
17
17
  const isValidLength = require('../util/byte-limit').isValidLength
18
18
  const { DATA_USAGE } = require('../metrics/names')
19
+ const symbols = require('../symbols')
19
20
 
20
21
  function getMetricName(name) {
21
22
  return `${DATA_USAGE.PREFIX}/${name}/${DATA_USAGE.SUFFIX}`
@@ -295,7 +296,7 @@ RemoteMethod.prototype._request = function _request(options) {
295
296
  path: options.path,
296
297
  headers: this._headers(options),
297
298
  agent: agents.keepAliveAgent(),
298
- __NR__connection: true // Who measures the metrics measurer?
299
+ [symbols.offTheRecord]: true // don't let the http instrumentation record this request
299
300
  }
300
301
  let request
301
302