newrelic 7.5.0 → 8.1.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,70 @@
1
+ ### v8.1.0 (2021-08-05)
2
+
3
+ * Added necessary instrumentation to support v4 of `mongodb`.
4
+ * Explicitly enabled APM for `mongodb` instrumentation(`client.monitorCommands = true`)
5
+
6
+ * Fixed issue where Promise based `pg.Client.query` timings were always in sub-millisecond range.
7
+
8
+ * Fixed bug where `API.shutdown` would not harvest or keep process active effectively after an agent restart.
9
+
10
+ The agent will now correctly update its state to 'started' after a reconnect has completed.
11
+
12
+ * Added an eslint rule to verify every file includes the copyright statement.
13
+
14
+ * Fixed the `homepage` field in package.json to use `https` in the link to the github repo. Thank you @pzrq for the contribution.
15
+
16
+ ### v8.0.0 (2021-07-26)
17
+
18
+ * Added official parity support for Node 16.
19
+
20
+ * **BREAKING**: Dropped Node v10.x support. For further information on our support policy,
21
+ see: https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/compatibility-requirements-nodejs-agent.
22
+ * Upgraded `@newrelic/superagent` `@newrelic/aws-sdk` `@newrelic/koa` `@newrelic/native-metrics` and `@newrelic/test-utilities` to the latest major versions.
23
+ * Refactored creation of span event aggregator to prevent crash of gRPC when running on invalid Node.js version.
24
+ * Added check for minimum `node` version >= 12.
25
+ * Set package.json engines `node` field >= 12 and `npm` field to >=6.
26
+ * Removed Node v10 from ci workflow and smoke-test version matrix.
27
+ * Removed comments around replacing `temporarilyOverrideTapUncaughtBehavior` test helper function.
28
+ * Removed non-applicable semver checks for versions the agents no longer supports.
29
+
30
+ * **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.
31
+ * Defaulted config.feature_flags.certificate_bundle to false.
32
+
33
+ * **BREAKING**: Removed `serverless_mode` as a feature flag.
34
+
35
+ The standard `serverless_mode` configuration still exists.
36
+
37
+ * Added hapi 19 and 20 to versioned tests for Node.js `>=12` and `<16`
38
+ * Added hapi `^20.1.2` to versioned tests for for Node.js `>=16`
39
+
40
+ * Upgraded tap to v15.
41
+
42
+ * Upgraded https-proxy-agent to v5.0.0.
43
+
44
+ * Updated linting to always use latest LTS Node version.
45
+
46
+ * Updated CI and Smoke Test scripts to use setup-node@v2.
47
+
48
+ * Added `no-const-assign` to eslint ruleset.
49
+
50
+ * Pinned mongodb versioned tests to <4.0.0.
51
+
52
+ ### v7.5.2 (2021-07-07)
53
+
54
+ * Fixed bug where promise-based cursor methods would not properly measure the duration of execution.
55
+
56
+ ### v7.5.1 (2021-06-21)
57
+
58
+ * Fixed loading config from the main module's directory. Thank you @alexpls for the contribution.
59
+
60
+ * Moved all integration tests that required secrets to the smoke folder.
61
+
62
+ * Fixed LASP/CSP tests so they don't skip on runs where secrets are available.
63
+
64
+ * Modified self-signed SSL cert to use 'localhost' instead of 'ssl.lvh.me' for SSL testing.
65
+
66
+ * Removed unnecessary trace observer configuration validation for host and port.
67
+
1
68
  ### v7.5.0 (2021-06-01)
2
69
 
3
70
  * Added default support for config files with a 'cjs' extension (`newrelic.cjs`) in addition to `newrelic.js`.
@@ -42,6 +42,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
42
42
  * [bluebird](#bluebird)
43
43
  * [chai](#chai)
44
44
  * [commander](#commander)
45
+ * [eslint-plugin-header](#eslint-plugin-header)
45
46
  * [eslint](#eslint)
46
47
  * [express](#express)
47
48
  * [fastify](#fastify)
@@ -61,7 +62,6 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
61
62
  * [q](#q)
62
63
  * [redis](#redis)
63
64
  * [request](#request)
64
- * [request](#request)
65
65
  * [restify](#restify)
66
66
  * [rimraf](#rimraf)
67
67
  * [rimraf](#rimraf)
@@ -77,7 +77,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
77
77
 
78
78
  ### @grpc/grpc-js
79
79
 
80
- This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.2.11](https://github.com/grpc/grpc-node/tree/%40grpc/grpc-js%401.2.11/packages/grpc-js)), distributed under the [Apache-2.0 License](https://github.com/grpc/grpc-node/blob/%40grpc/grpc-js%401.2.11/packages/grpc-js/LICENSE):
80
+ This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.3.6](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.3.6)), distributed under the [Apache-2.0 License](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.3.6/LICENSE):
81
81
 
82
82
  ```
83
83
  Apache License
@@ -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
@@ -1762,7 +1762,7 @@ This product includes source derived from [@newrelic/test-utilities](https://git
1762
1762
 
1763
1763
  ### @octokit/rest
1764
1764
 
1765
- This product includes source derived from [@octokit/rest](https://github.com/octokit/rest.js) ([v18.0.15](https://github.com/octokit/rest.js/tree/v18.0.15)), distributed under the [MIT License](https://github.com/octokit/rest.js/blob/v18.0.15/LICENSE):
1765
+ This product includes source derived from [@octokit/rest](https://github.com/octokit/rest.js) ([v18.8.0](https://github.com/octokit/rest.js/tree/v18.8.0)), distributed under the [MIT License](https://github.com/octokit/rest.js/blob/v18.8.0/LICENSE):
1766
1766
 
1767
1767
  ```
1768
1768
  The MIT License
@@ -1871,7 +1871,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1871
1871
 
1872
1872
  ### bluebird
1873
1873
 
1874
- This product includes source derived from [bluebird](https://github.com/petkaantonov/bluebird) ([v3.7.1](https://github.com/petkaantonov/bluebird/tree/v3.7.1)), distributed under the [MIT License](https://github.com/petkaantonov/bluebird/blob/v3.7.1/LICENSE):
1874
+ This product includes source derived from [bluebird](https://github.com/petkaantonov/bluebird) ([v3.7.2](https://github.com/petkaantonov/bluebird/tree/v3.7.2)), distributed under the [MIT License](https://github.com/petkaantonov/bluebird/blob/v3.7.2/LICENSE):
1875
1875
 
1876
1876
  ```
1877
1877
  The MIT License (MIT)
@@ -1900,7 +1900,7 @@ THE SOFTWARE.
1900
1900
 
1901
1901
  ### chai
1902
1902
 
1903
- This product includes source derived from [chai](https://github.com/chaijs/chai) ([v4.2.0](https://github.com/chaijs/chai/tree/v4.2.0)), distributed under the [MIT License](https://github.com/chaijs/chai/blob/v4.2.0/LICENSE):
1903
+ This product includes source derived from [chai](https://github.com/chaijs/chai) ([v4.3.4](https://github.com/chaijs/chai/tree/v4.3.4)), distributed under the [MIT License](https://github.com/chaijs/chai/blob/v4.3.4/LICENSE):
1904
1904
 
1905
1905
  ```
1906
1906
  MIT License
@@ -1954,12 +1954,27 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
1954
1954
  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1955
1955
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1956
1956
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1957
+ ```
1958
+
1959
+ ### eslint-plugin-header
1960
+
1961
+ This product includes source derived from [eslint-plugin-header](https://github.com/Stuk/eslint-plugin-header) ([v3.1.1](https://github.com/Stuk/eslint-plugin-header/tree/v3.1.1)), distributed under the [MIT License](https://github.com/Stuk/eslint-plugin-header/blob/v3.1.1/README.md):
1957
1962
 
1963
+ ```
1964
+ MIT License
1965
+
1966
+ Copyright (c) <year> <copyright holders>
1967
+
1968
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1969
+
1970
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1971
+
1972
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1958
1973
  ```
1959
1974
 
1960
1975
  ### eslint
1961
1976
 
1962
- This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v6.8.0](https://github.com/eslint/eslint/tree/v6.8.0)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v6.8.0/LICENSE):
1977
+ This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v7.32.0](https://github.com/eslint/eslint/tree/v7.32.0)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v7.32.0/LICENSE):
1963
1978
 
1964
1979
  ```
1965
1980
  Copyright JS Foundation and other contributors, https://js.foundation
@@ -2050,7 +2065,7 @@ SOFTWARE.
2050
2065
 
2051
2066
  ### generic-pool
2052
2067
 
2053
- This product includes source derived from [generic-pool](https://github.com/coopernurse/node-pool) ([v3.7.1](https://github.com/coopernurse/node-pool/tree/v3.7.1)), distributed under the [MIT License](https://github.com/coopernurse/node-pool/blob/v3.7.1/README.md):
2068
+ This product includes source derived from [generic-pool](https://github.com/coopernurse/node-pool) ([v3.8.2](https://github.com/coopernurse/node-pool/tree/v3.8.2)), distributed under the [MIT License](https://github.com/coopernurse/node-pool/blob/v3.8.2/README.md):
2054
2069
 
2055
2070
  ```
2056
2071
  MIT License
@@ -2066,7 +2081,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
2066
2081
 
2067
2082
  ### glob
2068
2083
 
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):
2084
+ 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
2085
 
2071
2086
  ```
2072
2087
  The ISC License
@@ -2112,7 +2127,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
2112
2127
 
2113
2128
  ### http-errors
2114
2129
 
2115
- This product includes source derived from [http-errors](https://github.com/jshttp/http-errors) ([v1.7.3](https://github.com/jshttp/http-errors/tree/v1.7.3)), distributed under the [MIT License](https://github.com/jshttp/http-errors/blob/v1.7.3/LICENSE):
2130
+ This product includes source derived from [http-errors](https://github.com/jshttp/http-errors) ([v1.8.0](https://github.com/jshttp/http-errors/tree/v1.8.0)), distributed under the [MIT License](https://github.com/jshttp/http-errors/blob/v1.8.0/LICENSE):
2116
2131
 
2117
2132
  ```
2118
2133
 
@@ -2172,7 +2187,7 @@ SOFTWARE.
2172
2187
 
2173
2188
  ### jsdoc
2174
2189
 
2175
- This product includes source derived from [jsdoc](https://github.com/jsdoc/jsdoc) ([v3.6.3](https://github.com/jsdoc/jsdoc/tree/v3.6.3)), distributed under the [Apache-2.0 License](https://github.com/jsdoc/jsdoc/blob/v3.6.3/LICENSE.md):
2190
+ This product includes source derived from [jsdoc](https://github.com/jsdoc/jsdoc) ([v3.6.7](https://github.com/jsdoc/jsdoc/tree/v3.6.7)), distributed under the [Apache-2.0 License](https://github.com/jsdoc/jsdoc/blob/v3.6.7/LICENSE.md):
2176
2191
 
2177
2192
  ```
2178
2193
  # License
@@ -2282,7 +2297,7 @@ https://github.com/jmblog/color-themes-for-google-code-prettify
2282
2297
 
2283
2298
  ### lint-staged
2284
2299
 
2285
- This product includes source derived from [lint-staged](https://github.com/okonet/lint-staged) ([v11.0.0](https://github.com/okonet/lint-staged/tree/v11.0.0)), distributed under the [MIT License](https://github.com/okonet/lint-staged/blob/v11.0.0/LICENSE):
2300
+ This product includes source derived from [lint-staged](https://github.com/okonet/lint-staged) ([v11.1.1](https://github.com/okonet/lint-staged/tree/v11.1.1)), distributed under the [MIT License](https://github.com/okonet/lint-staged/blob/v11.1.1/LICENSE):
2286
2301
 
2287
2302
  ```
2288
2303
  The MIT License (MIT)
@@ -2406,7 +2421,7 @@ https://github.com/jsdoc3/jsdoc
2406
2421
 
2407
2422
  ### mongodb
2408
2423
 
2409
- This product includes source derived from [mongodb](https://github.com/mongodb/node-mongodb-native) ([v3.3.4](https://github.com/mongodb/node-mongodb-native/tree/v3.3.4)), distributed under the [Apache-2.0 License](https://github.com/mongodb/node-mongodb-native/blob/v3.3.4/LICENSE.md):
2424
+ This product includes source derived from [mongodb](https://github.com/mongodb/node-mongodb-native) ([v3.6.10](https://github.com/mongodb/node-mongodb-native/tree/v3.6.10)), distributed under the [Apache-2.0 License](https://github.com/mongodb/node-mongodb-native/blob/v3.6.10/LICENSE.md):
2410
2425
 
2411
2426
  ```
2412
2427
  Apache License
@@ -2614,7 +2629,7 @@ Apache License
2614
2629
 
2615
2630
  ### mysql
2616
2631
 
2617
- This product includes source derived from [mysql](https://github.com/mysqljs/mysql) ([v2.17.1](https://github.com/mysqljs/mysql/tree/v2.17.1)), distributed under the [MIT License](https://github.com/mysqljs/mysql/blob/v2.17.1/License):
2632
+ This product includes source derived from [mysql](https://github.com/mysqljs/mysql) ([v2.18.1](https://github.com/mysqljs/mysql/tree/v2.18.1)), distributed under the [MIT License](https://github.com/mysqljs/mysql/blob/v2.18.1/License):
2618
2633
 
2619
2634
  ```
2620
2635
  Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
@@ -2743,68 +2758,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
2743
2758
 
2744
2759
  ### request
2745
2760
 
2746
- This product includes source derived from [request](https://github.com/request/request) ([v2.88.0](https://github.com/request/request/tree/v2.88.0)), distributed under the [Apache-2.0 License](https://github.com/request/request/blob/v2.88.0/LICENSE):
2747
-
2748
- ```
2749
- Apache License
2750
-
2751
- Version 2.0, January 2004
2752
-
2753
- http://www.apache.org/licenses/
2754
-
2755
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
2756
-
2757
- 1. Definitions.
2758
-
2759
- "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
2760
-
2761
- "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
2762
-
2763
- "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
2764
-
2765
- "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
2766
-
2767
- "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
2768
-
2769
- "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
2770
-
2771
- "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
2772
-
2773
- "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
2774
-
2775
- "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
2776
-
2777
- "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2778
-
2779
- 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
2780
-
2781
- 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
2782
-
2783
- 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
2784
-
2785
- You must give any other recipients of the Work or Derivative Works a copy of this License; and
2786
-
2787
- You must cause any modified files to carry prominent notices stating that You changed the files; and
2788
-
2789
- You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
2790
-
2791
- If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
2792
-
2793
- 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
2794
-
2795
- 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
2796
-
2797
- 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
2798
-
2799
- 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
2800
-
2801
- 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
2802
-
2803
- END OF TERMS AND CONDITIONS
2804
- ```
2805
-
2806
- ### request
2807
-
2808
2761
  This product includes source derived from [request](https://github.com/request/request) ([v2.88.2](https://github.com/request/request/tree/v2.88.2)), distributed under the [Apache-2.0 License](https://github.com/request/request/blob/v2.88.2/LICENSE):
2809
2762
 
2810
2763
  ```
@@ -2867,7 +2820,7 @@ END OF TERMS AND CONDITIONS
2867
2820
 
2868
2821
  ### restify
2869
2822
 
2870
- This product includes source derived from [restify](https://github.com/restify/node-restify) ([v8.4.0](https://github.com/restify/node-restify/tree/v8.4.0)), distributed under the [MIT License](https://github.com/restify/node-restify/blob/v8.4.0/LICENSE):
2823
+ This product includes source derived from [restify](https://github.com/restify/node-restify) ([v8.5.1](https://github.com/restify/node-restify/tree/v8.5.1)), distributed under the [MIT License](https://github.com/restify/node-restify/blob/v8.5.1/LICENSE):
2871
2824
 
2872
2825
  ```
2873
2826
  Copyright (c) 2011 Mark Cavage, All rights reserved.
@@ -3003,7 +2956,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3003
2956
 
3004
2957
  ### tap
3005
2958
 
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):
2959
+ 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
2960
 
3008
2961
  ```
3009
2962
  The ISC License
@@ -1,5 +1,4 @@
1
1
  #! /usr/bin/env node
2
-
3
2
  /*
4
3
  * Copyright 2020 New Relic Corporation. All rights reserved.
5
4
  * SPDX-License-Identifier: Apache-2.0
package/bin/tracetractor CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
-
3
2
  /*
4
3
  * Copyright 2020 New Relic Corporation. All rights reserved.
5
4
  * SPDX-License-Identifier: Apache-2.0
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',
package/lib/agent.js CHANGED
@@ -240,32 +240,12 @@ Agent.prototype.start = function start(callback) {
240
240
  }
241
241
 
242
242
  if (agent.collector.isConnected()) {
243
- agent.onConnect()
244
- agent.setState('started')
245
243
  const config = response.payload
246
244
 
247
- if (agent.config.no_immediate_harvest) {
248
- agent.startAggregators()
245
+ const shouldImmediatelyHarvest = !agent.config.no_immediate_harvest
246
+ agent.onConnect(shouldImmediatelyHarvest, () => {
249
247
  callback(null, config)
250
- } else {
251
- // For data collection that streams immediately, dont delay capture/sending until
252
- // the harvest of everything else has completed.
253
- agent.startStreaming()
254
-
255
- // Harvest immediately for quicker data display, but after at least 1
256
- // second or the collector will throw away the data.
257
- //
258
- // NOTE: this setTimeout is deliberately NOT unref'd due to it being
259
- // the last step in the Agent startup process
260
- setTimeout(function afterTimeout() {
261
- logger.info(`Starting initial ${INITIAL_HARVEST_DELAY_MS}ms harvest.`)
262
-
263
- agent.forceHarvestAll(function afterAllAggregatorsSend() {
264
- agent.startAggregators()
265
- callback(null, config)
266
- })
267
- }, INITIAL_HARVEST_DELAY_MS)
268
- }
248
+ })
269
249
  } else {
270
250
  callback(new Error('Collector did not connect and did not error'))
271
251
  }
@@ -450,18 +430,58 @@ Agent.prototype.startAggregators = function startAggregators() {
450
430
  }
451
431
  }
452
432
 
453
- Agent.prototype.onConnect = function onConnect() {
454
- this.metrics.reconfigure(this.config)
455
- this.errors.reconfigure(this.config)
456
- this.traces.reconfigure(this.config)
457
- this.queries.reconfigure(this.config)
458
- this.spanEventAggregator.reconfigure(this.config)
459
- this.transactionEventAggregator.reconfigure(this.config)
460
- this.customEventAggregator.reconfigure(this.config)
433
+ /**
434
+ * Completes any final setup upon full connection to New Relic
435
+ * servers and sets the agent state to 'started'.
436
+ */
437
+ Agent.prototype.onConnect = function onConnect(shouldImmediatelyHarvest, callback) {
438
+ this._reconfigureAggregators(this.config)
461
439
 
462
440
  if (this.config.certificates && this.config.certificates.length > 0) {
463
441
  this.metrics.getOrCreateMetric(NAMES.FEATURES.CERTIFICATES).incrementCallCount()
464
442
  }
443
+
444
+ this._scheduleHarvests(shouldImmediatelyHarvest, callback)
445
+
446
+ this.setState('started')
447
+ }
448
+
449
+ Agent.prototype._reconfigureAggregators = function _reconfigureAggregators(config) {
450
+ this.metrics.reconfigure(config)
451
+ this.errors.reconfigure(config)
452
+ this.traces.reconfigure(config)
453
+ this.queries.reconfigure(config)
454
+ this.spanEventAggregator.reconfigure(config)
455
+ this.transactionEventAggregator.reconfigure(config)
456
+ this.customEventAggregator.reconfigure(config)
457
+ }
458
+
459
+ Agent.prototype._scheduleHarvests = function _scheduleHarvests(shouldImmediatelyHarvest, callback) {
460
+ if (!shouldImmediatelyHarvest) {
461
+ this.startAggregators()
462
+ setImmediate(callback)
463
+ return
464
+ }
465
+
466
+ const agent = this
467
+
468
+ // For data collection that streams immediately, dont delay capture/sending until
469
+ // the harvest of everything else has completed.
470
+ agent.startStreaming()
471
+
472
+ // Harvest immediately for quicker data display, but after at least 1
473
+ // second or the collector will throw away the data.
474
+ //
475
+ // NOTE: this setTimeout is deliberately NOT unref'd due to it being
476
+ // the last step in the Agent startup process
477
+ setTimeout(function afterTimeout() {
478
+ logger.info(`Starting initial ${INITIAL_HARVEST_DELAY_MS}ms harvest.`)
479
+
480
+ agent.forceHarvestAll(function afterAllAggregatorsSend() {
481
+ agent.startAggregators()
482
+ callback()
483
+ })
484
+ }, INITIAL_HARVEST_DELAY_MS)
465
485
  }
466
486
 
467
487
  /**
@@ -515,9 +515,8 @@ CollectorAPI.prototype.restart = function restart(callback) {
515
515
  var api = this
516
516
  this.shutdown(function reconnect() {
517
517
  api.connect(function afterConnect() {
518
- api._agent.onConnect()
519
- api._agent.startAggregators()
520
- return callback.apply(null, arguments)
518
+ const shouldImmediatelyHarvest = false
519
+ api._agent.onConnect(shouldImmediatelyHarvest, callback)
521
520
  })
522
521
  })
523
522
  }
@@ -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')
@@ -56,14 +55,13 @@ const getConfigFileLocations = () => [
56
55
  process.env.NEW_RELIC_HOME,
57
56
  process.cwd(),
58
57
  process.env.HOME,
59
- path.join(__dirname, '../../../..') // above node_modules
58
+ path.join(__dirname, '../../../..'), // above node_modules
59
+ // the REPL has no main module
60
+ process.mainModule && process.mainModule.filename
61
+ ? path.dirname(process.mainModule.filename)
62
+ : undefined
60
63
  ].filter(Boolean)
61
64
 
62
- // the REPL has no main module
63
- if (process.mainModule && process.mainModule.filename) {
64
- getConfigFileLocations().splice(2, 0, path.dirname(process.mainModule.filename))
65
- }
66
-
67
65
  function isTruthular(setting) {
68
66
  if (setting == null) {
69
67
  return false
@@ -95,7 +93,7 @@ function fromObjectList(setting) {
95
93
 
96
94
  function _findConfigFile() {
97
95
  const configFileCandidates = getConfigFileLocations().reduce((files, configPath) => {
98
- const configFiles = getConfigFileNames().map(filename =>
96
+ const configFiles = getConfigFileNames().map(filename =>
99
97
  path.join(path.resolve(configPath), filename)
100
98
  )
101
99
 
@@ -886,10 +884,7 @@ Config.prototype.logUnknown = function logUnknown(json, key) {
886
884
  * Return the availability of async_hook for use by the agent.
887
885
  */
888
886
  Config.prototype.checkAsyncHookStatus = function checkAsyncHookStatus() {
889
- return (
890
- this.feature_flag.await_support &&
891
- (psemver.satisfies('>=8') || psemver.prerelease())
892
- )
887
+ return this.feature_flag.await_support
893
888
  }
894
889
 
895
890
  /**
@@ -1327,9 +1322,6 @@ Config.prototype._canonicalize = function _canonicalize() {
1327
1322
  )
1328
1323
  }
1329
1324
 
1330
- this.serverless_mode.enabled = this.serverless_mode.enabled
1331
- && this.feature_flag.serverless_mode
1332
-
1333
1325
  if (this.license_key) {
1334
1326
  this.license_key = this.license_key.trim()
1335
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'
@@ -1,3 +1,8 @@
1
+ /*
2
+ * Copyright 2020 New Relic Corporation. All rights reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
1
6
  'use strict'
2
7
 
3
8
  const getRawRequestFromFastifyRequest = (shim, fn, fnName, args) => {
@@ -1,3 +1,8 @@
1
+ /*
2
+ * Copyright 2020 New Relic Corporation. All rights reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
1
6
  'use strict'
2
7
  const semver = require('semver')
3
8
  const {