newrelic 7.5.2 → 8.0.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,39 @@
1
+ ### v8.0.0 (2021-07-26)
2
+
3
+ * Added official parity support for Node 16.
4
+
5
+ * **BREAKING**: Dropped Node v10.x support. For further information on our support policy,
6
+ see: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent.
7
+ * Upgraded `@newrelic/superagent` `@newrelic/aws-sdk` `@newrelic/koa` `@newrelic/native-metrics` and `@newrelic/test-utilities` to the latest major versions.
8
+ * Refactored creation of span event aggregator to prevent crash of gRPC when running on invalid Node.js version.
9
+ * Added check for minimum `node` version >= 12.
10
+ * Set package.json engines `node` field >= 12 and `npm` field to >=6.
11
+ * Removed Node v10 from ci workflow and smoke-test version matrix.
12
+ * Removed comments around replacing `temporarilyOverrideTapUncaughtBehavior` test helper function.
13
+ * Removed non-applicable semver checks for versions the agents no longer supports.
14
+
15
+ * **BREAKING**: The agent no-longer includes the New Relic certificate bundle automatically when using the 'certificates' configuration (commonly with proxies). If you find this breaking your current environment, you may leverage a feature-flag to temporarily restore this functionality. Example configuration: feature_flag: { certificate_bundle: true }. In this case, we recommend getting a certificate bundle for your environment such as the one from Mozilla. The New Relic bundle and feature flag will be fully removed in next major release.
16
+ * Defaulted config.feature_flags.certificate_bundle to false.
17
+
18
+ * **BREAKING**: Removed `serverless_mode` as a feature flag.
19
+
20
+ The standard `serverless_mode` configuration still exists.
21
+
22
+ * Added hapi 19 and 20 to versioned tests for Node.js `>=12` and `<16`
23
+ * Added hapi `^20.1.2` to versioned tests for for Node.js `>=16`
24
+
25
+ * Upgraded tap to v15.
26
+
27
+ * Upgraded https-proxy-agent to v5.0.0.
28
+
29
+ * Updated linting to always use latest LTS Node version.
30
+
31
+ * Updated CI and Smoke Test scripts to use setup-node@v2.
32
+
33
+ * Added `no-const-assign` to eslint ruleset.
34
+
35
+ * Pinned mongodb versioned tests to <4.0.0.
36
+
1
37
  ### v7.5.2 (2021-07-07)
2
38
 
3
39
  * Fixed bug where promise-based cursor methods would not properly measure the duration of execution.
@@ -495,7 +495,7 @@ This product includes source derived from [@grpc/proto-loader](https://github.co
495
495
 
496
496
  ### @newrelic/aws-sdk
497
497
 
498
- This product includes source derived from [@newrelic/aws-sdk](https://github.com/newrelic/node-newrelic-aws-sdk) ([v3.1.0](https://github.com/newrelic/node-newrelic-aws-sdk/tree/v3.1.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-newrelic-aws-sdk/blob/v3.1.0/LICENSE):
498
+ This product includes source derived from [@newrelic/aws-sdk](https://github.com/newrelic/node-newrelic-aws-sdk) ([v4.0.1](https://github.com/newrelic/node-newrelic-aws-sdk/tree/v4.0.1)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-newrelic-aws-sdk/blob/v4.0.1/LICENSE):
499
499
 
500
500
  ```
501
501
  Apache License
@@ -703,7 +703,7 @@ This product includes source derived from [@newrelic/aws-sdk](https://github.com
703
703
 
704
704
  ### @newrelic/koa
705
705
 
706
- This product includes source derived from [@newrelic/koa](https://github.com/newrelic/node-newrelic-koa) ([v5.0.0](https://github.com/newrelic/node-newrelic-koa/tree/v5.0.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-newrelic-koa/blob/v5.0.0/LICENSE):
706
+ This product includes source derived from [@newrelic/koa](https://github.com/newrelic/node-newrelic-koa) ([v6.0.1](https://github.com/newrelic/node-newrelic-koa/tree/v6.0.1)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-newrelic-koa/blob/v6.0.1/LICENSE):
707
707
 
708
708
  ```
709
709
  Apache License
@@ -912,7 +912,7 @@ Apache License
912
912
 
913
913
  ### @newrelic/superagent
914
914
 
915
- This product includes source derived from [@newrelic/superagent](https://github.com/newrelic/node-newrelic-superagent) ([v4.0.0](https://github.com/newrelic/node-newrelic-superagent/tree/v4.0.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-newrelic-superagent/blob/v4.0.0/LICENSE):
915
+ This product includes source derived from [@newrelic/superagent](https://github.com/newrelic/node-newrelic-superagent) ([v5.0.1](https://github.com/newrelic/node-newrelic-superagent/tree/v5.0.1)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-newrelic-superagent/blob/v5.0.1/LICENSE):
916
916
 
917
917
  ```
918
918
  Apache License
@@ -1208,7 +1208,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1208
1208
 
1209
1209
  ### https-proxy-agent
1210
1210
 
1211
- This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) ([v4.0.0](https://github.com/TooTallNate/node-https-proxy-agent/tree/v4.0.0)), distributed under the [MIT License](https://github.com/TooTallNate/node-https-proxy-agent/blob/v4.0.0/README.md):
1211
+ This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) ([v5.0.0](https://github.com/TooTallNate/node-https-proxy-agent/tree/v5.0.0)), distributed under the [MIT License](https://github.com/TooTallNate/node-https-proxy-agent/blob/v5.0.0/README.md):
1212
1212
 
1213
1213
  ```
1214
1214
  MIT License
@@ -1553,7 +1553,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
1553
1553
 
1554
1554
  ### @newrelic/test-utilities
1555
1555
 
1556
- This product includes source derived from [@newrelic/test-utilities](https://github.com/newrelic/node-test-utilities) ([v5.0.0](https://github.com/newrelic/node-test-utilities/tree/v5.0.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-test-utilities/blob/v5.0.0/LICENSE):
1556
+ This product includes source derived from [@newrelic/test-utilities](https://github.com/newrelic/node-test-utilities) ([v6.0.0](https://github.com/newrelic/node-test-utilities/tree/v6.0.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-test-utilities/blob/v6.0.0/LICENSE):
1557
1557
 
1558
1558
  ```
1559
1559
  Apache License
@@ -2066,7 +2066,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
2066
2066
 
2067
2067
  ### glob
2068
2068
 
2069
- This product includes source derived from [glob](https://github.com/isaacs/node-glob) ([v7.1.6](https://github.com/isaacs/node-glob/tree/v7.1.6)), distributed under the [ISC License](https://github.com/isaacs/node-glob/blob/v7.1.6/LICENSE):
2069
+ This product includes source derived from [glob](https://github.com/isaacs/node-glob) ([v7.1.7](https://github.com/isaacs/node-glob/tree/v7.1.7)), distributed under the [ISC License](https://github.com/isaacs/node-glob/blob/v7.1.7/LICENSE):
2070
2070
 
2071
2071
  ```
2072
2072
  The ISC License
@@ -3003,7 +3003,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3003
3003
 
3004
3004
  ### tap
3005
3005
 
3006
- This product includes source derived from [tap](https://github.com/tapjs/node-tap) ([v14.10.8](https://github.com/tapjs/node-tap/tree/v14.10.8)), distributed under the [ISC License](https://github.com/tapjs/node-tap/blob/v14.10.8/LICENSE):
3006
+ This product includes source derived from [tap](https://github.com/tapjs/node-tap) ([v15.0.9](https://github.com/tapjs/node-tap/tree/v15.0.9)), distributed under the [ISC License](https://github.com/tapjs/node-tap/blob/v15.0.9/LICENSE):
3007
3007
 
3008
3008
  ```
3009
3009
  The ISC License
package/index.js CHANGED
@@ -48,16 +48,17 @@ function initialize() {
48
48
  preAgentTime
49
49
  )
50
50
 
51
- // TODO: Update this check when Node v10 is deprecated.
52
- if (psemver.satisfies('<10.0.0')) {
51
+ if (!psemver.satisfies(pkgJSON.engines.node)) {
52
+ // TODO: Update this message when Node v12 is deprecated.
53
53
  message = 'New Relic for Node.js requires a version of Node equal to or\n' +
54
- 'greater than 10.0.0. Not starting!'
54
+ 'greater than 12.0.0. Not starting!'
55
55
 
56
56
  logger.error(message)
57
57
  throw new Error(message)
58
+ }
58
59
 
59
- // TODO: Update this check when Node v16 support is added
60
- } else if (!psemver.satisfies(pkgJSON.engines.node) || psemver.satisfies('>=15.0.0')) {
60
+ // TODO: Update this check when Node v18 support is added
61
+ if (psemver.satisfies('>=17.0.0')) {
61
62
  logger.warn(
62
63
  'New Relic for Node.js %s has not been tested on Node.js %s. Please ' +
63
64
  'update the agent or downgrade your version of Node.js',
@@ -17,7 +17,6 @@ const hashes = require('../util/hashes')
17
17
  const os = require('os')
18
18
  const parseKey = require('../collector/key-parser').parseKey
19
19
  const path = require('path')
20
- const psemver = require('../util/process-version')
21
20
  const stringify = require('json-stringify-safe')
22
21
  const util = require('util')
23
22
  const MergeServerConfig = require('./merge-server-config')
@@ -94,7 +93,7 @@ function fromObjectList(setting) {
94
93
 
95
94
  function _findConfigFile() {
96
95
  const configFileCandidates = getConfigFileLocations().reduce((files, configPath) => {
97
- const configFiles = getConfigFileNames().map(filename =>
96
+ const configFiles = getConfigFileNames().map(filename =>
98
97
  path.join(path.resolve(configPath), filename)
99
98
  )
100
99
 
@@ -885,10 +884,7 @@ Config.prototype.logUnknown = function logUnknown(json, key) {
885
884
  * Return the availability of async_hook for use by the agent.
886
885
  */
887
886
  Config.prototype.checkAsyncHookStatus = function checkAsyncHookStatus() {
888
- return (
889
- this.feature_flag.await_support &&
890
- (psemver.satisfies('>=8') || psemver.prerelease())
891
- )
887
+ return this.feature_flag.await_support
892
888
  }
893
889
 
894
890
  /**
@@ -1326,9 +1322,6 @@ Config.prototype._canonicalize = function _canonicalize() {
1326
1322
  )
1327
1323
  }
1328
1324
 
1329
- this.serverless_mode.enabled = this.serverless_mode.enabled
1330
- && this.feature_flag.serverless_mode
1331
-
1332
1325
  if (this.license_key) {
1333
1326
  this.license_key = this.license_key.trim()
1334
1327
  }
@@ -9,13 +9,10 @@
9
9
  exports.prerelease = {
10
10
  express5: false,
11
11
  await_support: true,
12
- serverless_mode: true, // TODO: Move to released & remove code checks next Major.
13
12
  promise_segments: false,
14
13
  reverse_naming_rules: false,
15
14
  fastify_instrumentation: false,
16
- // Starts by defaulting true as introducing for deprecation/removal purposes.
17
- // Will eventually set false prior full removal of feature.
18
- certificate_bundle: true,
15
+ certificate_bundle: false,
19
16
  new_promise_tracking: false
20
17
  }
21
18
 
@@ -28,6 +25,7 @@ exports.released = [
28
25
  'express_segments',
29
26
  'native_metrics',
30
27
  'protocol_17',
28
+ 'serverless_mode',
31
29
  'send_request_uri_attribute',
32
30
  'synthetics',
33
31
  'dt_format_w3c'
@@ -5,7 +5,6 @@
5
5
 
6
6
  'use strict'
7
7
 
8
- const psemver = require('../util/process-version')
9
8
  const logger = require('../logger')
10
9
  const SpanEventAggregator = require('./span-event-aggregator')
11
10
  const StreamingSpanEventAggregator = require('./streaming-span-event-aggregator')
@@ -13,22 +12,7 @@ const StreamingSpanEventAggregator = require('./streaming-span-event-aggregator'
13
12
  function createSpanEventAggregator(config, collector, metrics) {
14
13
  const trace_observer = config.infinite_tracing.trace_observer
15
14
 
16
- let shouldCreateStreaming = false
17
15
  if (trace_observer.host) {
18
- // TODO: ideally this validation and configuration clearing would happen
19
- // in the config. Since we don't currently have a way to generate
20
- // support metrics in the config, keeping this related logic together here.
21
- // If logic happened prior, could merely check for existence of trace_observer.host.
22
- shouldCreateStreaming = validateInfiniteTracing()
23
-
24
- if (!shouldCreateStreaming) {
25
- // Explicitly disable for any downstream consumers
26
- trace_observer.host = ''
27
- trace_observer.port = ''
28
- }
29
- }
30
-
31
- if (shouldCreateStreaming) {
32
16
  trace_observer.host = trace_observer.host.trim()
33
17
 
34
18
  if (typeof trace_observer.port !== 'string') {
@@ -36,7 +20,17 @@ function createSpanEventAggregator(config, collector, metrics) {
36
20
  }
37
21
  trace_observer.port = trace_observer.port.trim()
38
22
 
39
- return createStreamingAggregator(config, collector, metrics)
23
+ try {
24
+ return createStreamingAggregator(config, collector, metrics)
25
+ } catch (err) {
26
+ logger.warn(err, 'Failed to create streaming span event aggregator for infinite tracing. ' +
27
+ 'Reverting to standard span event aggregator and disabling infinite tracing')
28
+ config.infinite_tracing.trace_observer = {
29
+ host: '',
30
+ port: ''
31
+ }
32
+ return createStandardAggregator(config, collector, metrics)
33
+ }
40
34
  }
41
35
 
42
36
  return createStandardAggregator(config, collector, metrics)
@@ -44,12 +38,10 @@ function createSpanEventAggregator(config, collector, metrics) {
44
38
 
45
39
  function createStreamingAggregator(config, collector, metrics) {
46
40
  logger.trace('Creating streaming span event aggregator for infinite tracing.')
47
-
48
- // loading the class here to ensure its behind a feature flag
49
- // and won't trigger a grpc load in node 8
50
41
  const GrpcConnection = require('../grpc/connection')
51
- const connection = new GrpcConnection(config.infinite_tracing.trace_observer, metrics)
52
42
  const SpanStreamer = require('./span-streamer')
43
+
44
+ const connection = new GrpcConnection(config.infinite_tracing.trace_observer, metrics)
53
45
  const spanStreamer = new SpanStreamer(
54
46
  config.license_key,
55
47
  connection,
@@ -63,9 +55,7 @@ function createStreamingAggregator(config, collector, metrics) {
63
55
  span_streamer: spanStreamer
64
56
  }
65
57
 
66
- const aggregator = new StreamingSpanEventAggregator(opts, collector, metrics)
67
-
68
- return aggregator
58
+ return new StreamingSpanEventAggregator(opts, collector, metrics)
69
59
  }
70
60
 
71
61
  function createStandardAggregator(config, collector, metrics) {
@@ -76,20 +66,7 @@ function createStandardAggregator(config, collector, metrics) {
76
66
  limit: config.event_harvest_config.harvest_limits.span_event_data
77
67
  }
78
68
 
79
- const aggregator = new SpanEventAggregator(opts, collector, metrics)
80
- return aggregator
81
- }
82
-
83
- function validateInfiniteTracing() {
84
- // TODO: Remove semver check when Node 10 support dropped.
85
- if (!psemver.satisfies('>=10.10.0')) {
86
- logger.warn(
87
- 'Infinite tracing disabled: this version of Node is not supported (must be >=10.10.0)'
88
- )
89
- return false
90
- }
91
-
92
- return true
69
+ return new SpanEventAggregator(opts, collector, metrics)
93
70
  }
94
71
 
95
72
  module.exports = createSpanEventAggregator
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newrelic",
3
- "version": "7.5.2",
3
+ "version": "8.0.0",
4
4
  "author": "New Relic Node.js agent team <nodejs@newrelic.com>",
5
5
  "license": "Apache-2.0",
6
6
  "contributors": [
@@ -111,8 +111,8 @@
111
111
  ],
112
112
  "homepage": "http://github.com/newrelic/node-newrelic",
113
113
  "engines": {
114
- "node": ">=10.0.0",
115
- "npm": ">=3.0.0"
114
+ "node": ">=12.0.0",
115
+ "npm": ">=6.0.0"
116
116
  },
117
117
  "directories": {
118
118
  "lib": "lib"
@@ -122,7 +122,7 @@
122
122
  "ca-gen": "./bin/update-ca-bundle.sh",
123
123
  "docker-env": "./bin/docker-env-vars.sh",
124
124
  "docs": "npm ci && jsdoc -c ./jsdoc-conf.json --private -r .",
125
- "integration": "npm run prepare-test && npm run sub-install && time tap --no-esm test/integration/**/**/*.tap.js --timeout=180 --no-coverage",
125
+ "integration": "npm run prepare-test && npm run sub-install && time tap test/integration/**/**/*.tap.js --timeout=180 --no-coverage --reporter classic",
126
126
  "prepare-test": "npm run ca-gen && npm run ssl && npm run docker-env",
127
127
  "lint": "eslint ./*.js lib test bin",
128
128
  "public-docs": "npm ci && jsdoc -c ./jsdoc-conf.json --tutorials examples/shim api.js lib/shim/ lib/transaction/handle.js && cp examples/shim/*.png out/",
@@ -132,11 +132,13 @@
132
132
  "ssl": "./bin/ssl.sh",
133
133
  "sub-install": "node test/bin/install_sub_deps",
134
134
  "test": "npm run integration && npm run unit",
135
- "unit": "rm -f newrelic_agent.log && time tap --test-regex='(\\/|^test\\/unit\\/.*\\.test\\.js)$' --timeout=180 --no-coverage",
135
+ "unit": "rm -f newrelic_agent.log && time tap --test-regex='(\\/|^test\\/unit\\/.*\\.test\\.js)$' --timeout=180 --no-coverage --reporter classic",
136
136
  "update-cross-agent-tests": "./bin/update-cats.sh",
137
137
  "versioned-tests": "./bin/run-versioned-tests.sh",
138
138
  "update-changelog-version": "node ./bin/update-changelog-version",
139
- "versioned": "npm run prepare-test && time ./bin/run-versioned-tests.sh",
139
+ "versioned": "npm run versioned:npm7",
140
+ "versioned:npm6": "npm run prepare-test && time ./bin/run-versioned-tests.sh",
141
+ "versioned:npm7": "npm run prepare-test && NPM7=1 time ./bin/run-versioned-tests.sh",
140
142
  "prepare": "husky install"
141
143
  },
142
144
  "bin": {
@@ -145,25 +147,24 @@
145
147
  "dependencies": {
146
148
  "@grpc/grpc-js": "^1.2.11",
147
149
  "@grpc/proto-loader": "^0.5.6",
148
- "@newrelic/aws-sdk": "^3.1.0",
149
- "@newrelic/koa": "^5.0.0",
150
- "@newrelic/superagent": "^4.0.0",
150
+ "@newrelic/aws-sdk": "^4.0.1",
151
+ "@newrelic/koa": "^6.0.1",
152
+ "@newrelic/superagent": "^5.0.1",
151
153
  "@tyriar/fibonacci-heap": "^2.0.7",
152
154
  "async": "^3.2.0",
153
155
  "concat-stream": "^2.0.0",
154
- "https-proxy-agent": "^4.0.0",
156
+ "https-proxy-agent": "^5.0.0",
155
157
  "json-stringify-safe": "^5.0.0",
156
158
  "readable-stream": "^3.6.0",
157
159
  "semver": "^5.3.0"
158
160
  },
159
161
  "optionalDependencies": {
160
- "@newrelic/native-metrics": "^6.0.0"
162
+ "@newrelic/native-metrics": "^7.0.1"
161
163
  },
162
164
  "devDependencies": {
163
165
  "@newrelic/proxy": "^2.0.0",
164
- "@newrelic/test-utilities": "^5.1.0",
166
+ "@newrelic/test-utilities": "^6.0.0",
165
167
  "@octokit/rest": "^18.0.15",
166
- "JSV": "~4.0.2",
167
168
  "architect": "*",
168
169
  "benchmark": "^2.1.4",
169
170
  "bluebird": "^3.4.7",
@@ -178,6 +179,7 @@
178
179
  "http-errors": "^1.7.3",
179
180
  "husky": "^6.0.0",
180
181
  "jsdoc": "^3.6.3",
182
+ "JSV": "~4.0.2",
181
183
  "lint-staged": "^11.0.0",
182
184
  "memcached": ">=0.2.8",
183
185
  "minami": "^1.1.1",
@@ -192,7 +194,7 @@
192
194
  "rimraf": "^2.6.3",
193
195
  "should": "*",
194
196
  "sinon": "^4.5.0",
195
- "tap": "^14.10.8",
197
+ "tap": "^15.0.9",
196
198
  "temp": "^0.8.1",
197
199
  "through": "^2.3.6",
198
200
  "when": "*"