newrelic 9.4.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,21 @@
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
+
11
+ ### v9.5.0 (2022-10-26)
12
+
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).
14
+
15
+ * Updated CI process to include collection of code coverage statistics.
16
+
17
+ * Added a [document](./documentation/feature-flags.md) for our current feature flags.
18
+
1
19
  ### v9.4.0 (2022-10-24)
2
20
 
3
21
  * Removed legacy agent async context propagation. The default behavior is now what was behind the `feature_flag.new_promise_tracking`. You can read more about the difference [here](https://docs.newrelic.com/docs/release-notes/agent-release-notes/nodejs-release-notes/node-agent-7-3-0#new-features).
package/README.md CHANGED
@@ -1,8 +1,7 @@
1
- [![Community Plus header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus)
1
+ [![Community Plus header](https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus)
2
2
 
3
- # New Relic's Node.js agent [![Server Smoke Tests][3]][4] [![Node Agent CI][5]][6]
4
-
5
- [![npm status badge][1]][2]
3
+ # New Relic's Node.js agent
4
+ [![npm status badge][1]][2] [![Server Smoke Tests][3]][4] [![Node Agent CI][5]][6] [![codecov][7]][8]
6
5
 
7
6
  This package instruments your application for performance monitoring with [New Relic](https://newrelic.com).
8
7
 
@@ -263,9 +262,12 @@ The Node.js agent is licensed under the [Apache 2.0](http://apache.org/licenses/
263
262
  The Node.js agent also uses source code from third-party libraries. You can find full details on which libraries are used and the terms under which they are licensed in [the third-party notices document](https://github.com/newrelic/node-newrelic/blob/main/THIRD_PARTY_NOTICES.md).
264
263
 
265
264
 
266
- [1]: https://nodei.co/npm/newrelic.png
267
- [2]: https://nodei.co/npm/newrelic
265
+ [1]: https://img.shields.io/npm/v/newrelic.svg
266
+ [2]: https://www.npmjs.com/package/newrelic
268
267
  [3]: https://github.com/newrelic/node-newrelic/workflows/Server%20Smoke%20Tests/badge.svg
269
268
  [4]: https://github.com/newrelic/node-newrelic/actions?query=workflow%3A%22Server+Smoke+Tests%22
270
269
  [5]: https://github.com/newrelic/node-newrelic/workflows/Node%20Agent%20CI/badge.svg
271
270
  [6]: https://github.com/newrelic/node-newrelic/actions?query=workflow%3A%22Node+Agent+CI%22
271
+ [7]: https://codecov.io/gh/newrelic/node-newrelic/branch/main/graph/badge.svg
272
+ [8]: https://codecov.io/gh/newrelic/node-newrelic
273
+
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