newrelic 12.5.0 → 12.5.2
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 +74 -0
- package/THIRD_PARTY_NOTICES.md +14 -44
- package/lib/collector/facts.js +2 -2
- package/lib/collector/parse-response.js +1 -0
- package/lib/instrumentation/amqplib/nr-hooks.js +1 -1
- package/lib/instrumentation/pino/pino.js +9 -1
- package/lib/instrumentation/when/index.js +2 -6
- package/lib/shim/shim.js +8 -22
- package/lib/transaction/tracer/index.js +5 -0
- package/lib/util/label-parser.js +1 -0
- package/package.json +6 -6
package/NEWS.md
CHANGED
|
@@ -1,3 +1,77 @@
|
|
|
1
|
+
### v12.5.2 (2024-10-23)
|
|
2
|
+
|
|
3
|
+
#### Features
|
|
4
|
+
|
|
5
|
+
* Updated shim/when instrumentation to use tracer to run in context ([#2642](https://github.com/newrelic/node-newrelic/pull/2642)) ([1a80ad5](https://github.com/newrelic/node-newrelic/commit/1a80ad56a6d502182a0db368f40443467f7943df))
|
|
6
|
+
|
|
7
|
+
#### Bug fixes
|
|
8
|
+
|
|
9
|
+
* Fixed amqplib instrumentation via ESM ([#2668](https://github.com/newrelic/node-newrelic/pull/2668)) ([a36deba](https://github.com/newrelic/node-newrelic/commit/a36deba7ba7b46c4947fcb83db0a4f97bd4c0bf1))
|
|
10
|
+
|
|
11
|
+
#### Documentation
|
|
12
|
+
|
|
13
|
+
* Remove SECURITY.md ([#2633](https://github.com/newrelic/node-newrelic/pull/2633)) ([41002cd](https://github.com/newrelic/node-newrelic/commit/41002cd1c423c378bfbe024ebe7dae03d02d2949))
|
|
14
|
+
* Updated compatibility report ([#2670](https://github.com/newrelic/node-newrelic/pull/2670)) ([281c0fa](https://github.com/newrelic/node-newrelic/commit/281c0fa3be096a0ef3eef25b0f51df7ae8bf50bf))
|
|
15
|
+
* Updated match custom-assertion jsdoc ([#2636](https://github.com/newrelic/node-newrelic/pull/2636)) ([c37abe5](https://github.com/newrelic/node-newrelic/commit/c37abe5eb4528493bb3950e376bf780d6cd29023))
|
|
16
|
+
|
|
17
|
+
#### Miscellaneous chores
|
|
18
|
+
|
|
19
|
+
* Upgraded `import-in-the-middle` to work around a bug introduced in 1.11.1 ([#2618](https://github.com/newrelic/node-newrelic/pull/2618)) ([9ad476a](https://github.com/newrelic/node-newrelic/commit/9ad476a765eee472f510239b4265d10f0a50c666))
|
|
20
|
+
|
|
21
|
+
#### Tests
|
|
22
|
+
|
|
23
|
+
* Migrated `aws-sdk-v2` and `aws-sdk-v3` tests to `node:test` ([#2620](https://github.com/newrelic/node-newrelic/pull/2620)) ([e0dc015](https://github.com/newrelic/node-newrelic/commit/e0dc01571087c3d53434d2d21d77206592137b66))
|
|
24
|
+
* Migrated `test/unit/shim` to `node:test` ([#2599](https://github.com/newrelic/node-newrelic/pull/2599)) ([8d1acff](https://github.com/newrelic/node-newrelic/commit/8d1acffabf29ba6e0b5e20a675b87a81f893fc0a))
|
|
25
|
+
* Migrated `test/versioned/amqplib` to `node:test` ([#2612](https://github.com/newrelic/node-newrelic/pull/2612)) ([7bdada6](https://github.com/newrelic/node-newrelic/commit/7bdada678c18997c268cf19c56262b870bae5673))
|
|
26
|
+
* Migrated `test/versioned/express` to `node:test` ([#2609](https://github.com/newrelic/node-newrelic/pull/2609)) ([bd2f1a5](https://github.com/newrelic/node-newrelic/commit/bd2f1a53f8e03810e3c0aa5d042b6b256ec7346b))
|
|
27
|
+
* Migrated bluebird versioned tests to `node:test` ([#2635](https://github.com/newrelic/node-newrelic/pull/2635)) ([6e28fad](https://github.com/newrelic/node-newrelic/commit/6e28fad70390ffaf4df7ccbc96c88f79bb5d2fe2))
|
|
28
|
+
* Migrated last group of unit tests to `node:test` ([#2624](https://github.com/newrelic/node-newrelic/pull/2624)) ([386f546](https://github.com/newrelic/node-newrelic/commit/386f54682128d0dda8ad073a57cd45109c927fe1))
|
|
29
|
+
* Migrated unit tests to `node:test` ([#2623](https://github.com/newrelic/node-newrelic/pull/2623)) ([86231b7](https://github.com/newrelic/node-newrelic/commit/86231b7dec5bc5807ae26a88a7b8f2ff1535d9c4))
|
|
30
|
+
* Updated tests that relied on `tspl` by awating the `plan.completed` instead of calling `end` to avoid flaky tests ([#2610](https://github.com/newrelic/node-newrelic/pull/2610)) ([935ac14](https://github.com/newrelic/node-newrelic/commit/935ac14dbff7d11e797d290fb24a0d791ac9a61a))
|
|
31
|
+
* Updated tests that used the context manager directly and instead use the tracer to access the segment context ([#2643](https://github.com/newrelic/node-newrelic/pull/2643)) ([b917b3e](https://github.com/newrelic/node-newrelic/commit/b917b3ea9416eaf64bf365f6f46a0d4eafdfc437))
|
|
32
|
+
* Updated the mininum version of pg-native in pg-esm tests to align with the pg tests ([#2616](https://github.com/newrelic/node-newrelic/pull/2616)) ([16be714](https://github.com/newrelic/node-newrelic/commit/16be71404dcea903f3f7b7d4d238cc0a416d7b79))
|
|
33
|
+
* Migrated `bunyan`, `pino`, and `winston` tests to `node:test` ([#2634](https://github.com/newrelic/node-newrelic/pull/2634)) ([69c1ab8](https://github.com/newrelic/node-newrelic/commit/69c1ab8951f8cd405986e879399dff716f839a78))
|
|
34
|
+
* Migrated `fastify` tests to `node:test` ([#2632](https://github.com/newrelic/node-newrelic/pull/2632)) ([b522477](https://github.com/newrelic/node-newrelic/commit/b522477168c2049b12bcfd39ae485f9e5374f724))
|
|
35
|
+
* Migrated block of unit tests to `node:test` ([#2607](https://github.com/newrelic/node-newrelic/pull/2607)) ([e33807b](https://github.com/newrelic/node-newrelic/commit/e33807b817852bb7cdc93c9b171250df17a3b867))
|
|
36
|
+
* Migrated block of unit tests to `node:test` ([#2604](https://github.com/newrelic/node-newrelic/pull/2604)) ([cd90ce1](https://github.com/newrelic/node-newrelic/commit/cd90ce11908edc4376a704153f44d4f3ddfb6866))
|
|
37
|
+
* Migrated block of unit tests to `node:test` ([#2593](https://github.com/newrelic/node-newrelic/pull/2593)) ([6d4d49e](https://github.com/newrelic/node-newrelic/commit/6d4d49e075d8c4c687d4730b65aa39177e384ce5))
|
|
38
|
+
|
|
39
|
+
#### Continuous integration
|
|
40
|
+
|
|
41
|
+
* Added delay to site extension publishing to wait for NPM ([#2665](https://github.com/newrelic/node-newrelic/pull/2665)) ([e412020](https://github.com/newrelic/node-newrelic/commit/e412020865bab187d8c7d274cdc6973946286a1f))
|
|
42
|
+
|
|
43
|
+
### v12.5.1 (2024-09-23)
|
|
44
|
+
|
|
45
|
+
#### Bug fixes
|
|
46
|
+
|
|
47
|
+
* Fixed handling of Pino merging object ([#2600](https://github.com/newrelic/node-newrelic/pull/2600)) ([de3c266](https://github.com/newrelic/node-newrelic/commit/de3c26683a1fb63da26cfd813599774a5db61097))
|
|
48
|
+
|
|
49
|
+
#### Documentation
|
|
50
|
+
|
|
51
|
+
* Updated compatibility report ([#2589](https://github.com/newrelic/node-newrelic/pull/2589)) ([2f45a4a](https://github.com/newrelic/node-newrelic/commit/2f45a4a535d83ac8fe073ed5082edda4ff1fb720))
|
|
52
|
+
|
|
53
|
+
#### Miscellaneous chores
|
|
54
|
+
|
|
55
|
+
* **deps:** Udpated @newrelic/security-agent to v2.0.0 ([#2594](https://github.com/newrelic/node-newrelic/pull/2594)) ([92e6978](https://github.com/newrelic/node-newrelic/commit/92e6978d74b365085afa719b02c41d07b1ba82ea))
|
|
56
|
+
|
|
57
|
+
#### Tests
|
|
58
|
+
|
|
59
|
+
* Convert transaction* and urltils tests to `node:test` ([#2585](https://github.com/newrelic/node-newrelic/pull/2585)) ([d169546](https://github.com/newrelic/node-newrelic/commit/d169546b7c51d83db0697f941343cd334f675e60))
|
|
60
|
+
* Fixed @koa/router tests. path-to-regex differs between @koa/router and koa-router now ([#2587](https://github.com/newrelic/node-newrelic/pull/2587)) ([608dd98](https://github.com/newrelic/node-newrelic/commit/608dd98924a3b8fd4b3b48d8fc3a0dc54ce493b2))
|
|
61
|
+
* Removed transitive deps from versioned tests as they will auto-install if required as peer deps ([#2580](https://github.com/newrelic/node-newrelic/pull/2580)) ([0db6599](https://github.com/newrelic/node-newrelic/commit/0db6599505ca568c82f36584f3214adcdb68a976))
|
|
62
|
+
* Updated a missing `minSupported` in aws-sdk-v3 versioned tests ([#2582](https://github.com/newrelic/node-newrelic/pull/2582)) ([c997af6](https://github.com/newrelic/node-newrelic/commit/c997af6ab935ff103fa97a21d204c9482e66aa61))
|
|
63
|
+
* Updated fastify versioned tests to work with `fastify@5.0.0` ([#2584](https://github.com/newrelic/node-newrelic/pull/2584)) ([a5a1526](https://github.com/newrelic/node-newrelic/commit/a5a1526c9aa83ca96d5d6e3ac0cc703cf7042efc))
|
|
64
|
+
* Updated how we handle the koa-router nuance of wildcard routes ([#2588](https://github.com/newrelic/node-newrelic/pull/2588)) ([ddeb097](https://github.com/newrelic/node-newrelic/commit/ddeb097a7f29b8fcdd7b4082fa4f8b55e5e386a9))
|
|
65
|
+
* Updated koa-router to tests to handle bug fixes from 13.0.1 ([#2578](https://github.com/newrelic/node-newrelic/pull/2578)) ([a28e2e6](https://github.com/newrelic/node-newrelic/commit/a28e2e66e8bcc71aadd6bbd9a84eadbc4990d490))
|
|
66
|
+
* Migrate block of unit tests to `node:test` ([#2570](https://github.com/newrelic/node-newrelic/pull/2570)) ([5cd1d8a](https://github.com/newrelic/node-newrelic/commit/5cd1d8aa6fa673d090e7b3d5fdc962c75c866706))
|
|
67
|
+
* Migrate second block of unit tests to `node:test` ([#2572](https://github.com/newrelic/node-newrelic/pull/2572)) ([943a83e](https://github.com/newrelic/node-newrelic/commit/943a83eb9f6267d76cd576c5375889cff89557e9))
|
|
68
|
+
* Reduce koa-router version to enable CI ([#2573](https://github.com/newrelic/node-newrelic/pull/2573)) ([f44a99b](https://github.com/newrelic/node-newrelic/commit/f44a99b2ffdd7b35c38708ebf200fb266e740187))
|
|
69
|
+
* Removed noisy test log ([#2583](https://github.com/newrelic/node-newrelic/pull/2583)) ([3766ed6](https://github.com/newrelic/node-newrelic/commit/3766ed634df348898515f95edc3c58389d67b62d))
|
|
70
|
+
|
|
71
|
+
#### Continuous integration
|
|
72
|
+
|
|
73
|
+
* Added workflow run trigger to Azure site extension publish job ([#2575](https://github.com/newrelic/node-newrelic/pull/2575)) ([e8ae942](https://github.com/newrelic/node-newrelic/commit/e8ae94249553c8c648e43adec271e9e2900c574a))
|
|
74
|
+
|
|
1
75
|
### v12.5.0 (2024-09-12)
|
|
2
76
|
|
|
3
77
|
#### Features
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -68,7 +68,6 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
68
68
|
* [lint-staged](#lint-staged)
|
|
69
69
|
* [lockfile-lint](#lockfile-lint)
|
|
70
70
|
* [nock](#nock)
|
|
71
|
-
* [proxy](#proxy)
|
|
72
71
|
* [proxyquire](#proxyquire)
|
|
73
72
|
* [rimraf](#rimraf)
|
|
74
73
|
* [self-cert](#self-cert)
|
|
@@ -93,7 +92,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
93
92
|
|
|
94
93
|
### @grpc/grpc-js
|
|
95
94
|
|
|
96
|
-
This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.
|
|
95
|
+
This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.12.2](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.12.2)), distributed under the [Apache-2.0 License](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.12.2/LICENSE):
|
|
97
96
|
|
|
98
97
|
```
|
|
99
98
|
Apache License
|
|
@@ -511,7 +510,7 @@ This product includes source derived from [@grpc/proto-loader](https://github.co
|
|
|
511
510
|
|
|
512
511
|
### @newrelic/security-agent
|
|
513
512
|
|
|
514
|
-
This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([
|
|
513
|
+
This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v2.0.0](https://github.com/newrelic/csec-node-agent/tree/v2.0.0)), distributed under the [UNKNOWN License](https://github.com/newrelic/csec-node-agent/blob/v2.0.0/LICENSE):
|
|
515
514
|
|
|
516
515
|
```
|
|
517
516
|
## New Relic Software License v1.0
|
|
@@ -646,7 +645,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
646
645
|
|
|
647
646
|
### import-in-the-middle
|
|
648
647
|
|
|
649
|
-
This product includes source derived from [import-in-the-middle](https://github.com/nodejs/import-in-the-middle) ([v1.11.
|
|
648
|
+
This product includes source derived from [import-in-the-middle](https://github.com/nodejs/import-in-the-middle) ([v1.11.2](https://github.com/nodejs/import-in-the-middle/tree/v1.11.2)), distributed under the [Apache-2.0 License](https://github.com/nodejs/import-in-the-middle/blob/v1.11.2/LICENSE):
|
|
650
649
|
|
|
651
650
|
```
|
|
652
651
|
Apache License
|
|
@@ -1043,7 +1042,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
1043
1042
|
|
|
1044
1043
|
### winston-transport
|
|
1045
1044
|
|
|
1046
|
-
This product includes source derived from [winston-transport](https://github.com/winstonjs/winston-transport) ([v4.
|
|
1045
|
+
This product includes source derived from [winston-transport](https://github.com/winstonjs/winston-transport) ([v4.8.0](https://github.com/winstonjs/winston-transport/tree/v4.8.0)), distributed under the [MIT License](https://github.com/winstonjs/winston-transport/blob/v4.8.0/LICENSE):
|
|
1047
1046
|
|
|
1048
1047
|
```
|
|
1049
1048
|
The MIT License (MIT)
|
|
@@ -1076,7 +1075,7 @@ SOFTWARE.
|
|
|
1076
1075
|
|
|
1077
1076
|
### @aws-sdk/client-s3
|
|
1078
1077
|
|
|
1079
|
-
This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.
|
|
1078
|
+
This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.676.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.676.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.676.0/LICENSE):
|
|
1080
1079
|
|
|
1081
1080
|
```
|
|
1082
1081
|
Apache License
|
|
@@ -1285,7 +1284,7 @@ This product includes source derived from [@aws-sdk/client-s3](https://github.co
|
|
|
1285
1284
|
|
|
1286
1285
|
### @aws-sdk/s3-request-presigner
|
|
1287
1286
|
|
|
1288
|
-
This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.
|
|
1287
|
+
This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.676.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.676.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.676.0/LICENSE):
|
|
1289
1288
|
|
|
1290
1289
|
```
|
|
1291
1290
|
Apache License
|
|
@@ -1494,7 +1493,7 @@ This product includes source derived from [@aws-sdk/s3-request-presigner](https:
|
|
|
1494
1493
|
|
|
1495
1494
|
### @koa/router
|
|
1496
1495
|
|
|
1497
|
-
This product includes source derived from [@koa/router](https://github.com/koajs/router) ([v12.0.
|
|
1496
|
+
This product includes source derived from [@koa/router](https://github.com/koajs/router) ([v12.0.2](https://github.com/koajs/router/tree/v12.0.2)), distributed under the [MIT License](https://github.com/koajs/router/blob/v12.0.2/LICENSE):
|
|
1498
1497
|
|
|
1499
1498
|
```
|
|
1500
1499
|
The MIT License (MIT)
|
|
@@ -2208,7 +2207,7 @@ THE SOFTWARE.
|
|
|
2208
2207
|
|
|
2209
2208
|
### @slack/bolt
|
|
2210
2209
|
|
|
2211
|
-
This product includes source derived from [@slack/bolt](https://github.com/slackapi/bolt) ([v3.
|
|
2210
|
+
This product includes source derived from [@slack/bolt](https://github.com/slackapi/bolt) ([v3.22.0](https://github.com/slackapi/bolt/tree/v3.22.0)), distributed under the [MIT License](https://github.com/slackapi/bolt/blob/v3.22.0/LICENSE):
|
|
2212
2211
|
|
|
2213
2212
|
```
|
|
2214
2213
|
The MIT License (MIT)
|
|
@@ -2685,7 +2684,7 @@ SOFTWARE.
|
|
|
2685
2684
|
|
|
2686
2685
|
### async
|
|
2687
2686
|
|
|
2688
|
-
This product includes source derived from [async](https://github.com/caolan/async) ([v3.2.
|
|
2687
|
+
This product includes source derived from [async](https://github.com/caolan/async) ([v3.2.6](https://github.com/caolan/async/tree/v3.2.6)), distributed under the [MIT License](https://github.com/caolan/async/blob/v3.2.6/LICENSE):
|
|
2689
2688
|
|
|
2690
2689
|
```
|
|
2691
2690
|
Copyright (c) 2010-2018 Caolan McMahon
|
|
@@ -2712,7 +2711,7 @@ THE SOFTWARE.
|
|
|
2712
2711
|
|
|
2713
2712
|
### aws-sdk
|
|
2714
2713
|
|
|
2715
|
-
This product includes source derived from [aws-sdk](https://github.com/aws/aws-sdk-js) ([v2.
|
|
2714
|
+
This product includes source derived from [aws-sdk](https://github.com/aws/aws-sdk-js) ([v2.1691.0](https://github.com/aws/aws-sdk-js/tree/v2.1691.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js/blob/v2.1691.0/LICENSE.txt):
|
|
2716
2715
|
|
|
2717
2716
|
```
|
|
2718
2717
|
|
|
@@ -2922,7 +2921,7 @@ This product includes source derived from [aws-sdk](https://github.com/aws/aws-s
|
|
|
2922
2921
|
|
|
2923
2922
|
### borp
|
|
2924
2923
|
|
|
2925
|
-
This product includes source derived from [borp](https://github.com/mcollina/borp) ([v0.
|
|
2924
|
+
This product includes source derived from [borp](https://github.com/mcollina/borp) ([v0.18.0](https://github.com/mcollina/borp/tree/v0.18.0)), distributed under the [MIT License](https://github.com/mcollina/borp/blob/v0.18.0/LICENSE):
|
|
2926
2925
|
|
|
2927
2926
|
```
|
|
2928
2927
|
MIT License
|
|
@@ -3345,7 +3344,7 @@ Library.
|
|
|
3345
3344
|
|
|
3346
3345
|
### eslint
|
|
3347
3346
|
|
|
3348
|
-
This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v8.57.
|
|
3347
|
+
This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v8.57.1](https://github.com/eslint/eslint/tree/v8.57.1)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v8.57.1/LICENSE):
|
|
3349
3348
|
|
|
3350
3349
|
```
|
|
3351
3350
|
Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
|
|
@@ -3372,7 +3371,7 @@ THE SOFTWARE.
|
|
|
3372
3371
|
|
|
3373
3372
|
### express
|
|
3374
3373
|
|
|
3375
|
-
This product includes source derived from [express](https://github.com/expressjs/express) ([v4.
|
|
3374
|
+
This product includes source derived from [express](https://github.com/expressjs/express) ([v4.21.1](https://github.com/expressjs/express/tree/v4.21.1)), distributed under the [MIT License](https://github.com/expressjs/express/blob/v4.21.1/LICENSE):
|
|
3376
3375
|
|
|
3377
3376
|
```
|
|
3378
3377
|
(The MIT License)
|
|
@@ -3508,7 +3507,7 @@ SOFTWARE.
|
|
|
3508
3507
|
|
|
3509
3508
|
### jsdoc
|
|
3510
3509
|
|
|
3511
|
-
This product includes source derived from [jsdoc](https://github.com/jsdoc/jsdoc) ([v4.0.
|
|
3510
|
+
This product includes source derived from [jsdoc](https://github.com/jsdoc/jsdoc) ([v4.0.4](https://github.com/jsdoc/jsdoc/tree/v4.0.4)), distributed under the [Apache-2.0 License](https://github.com/jsdoc/jsdoc/blob/v4.0.4/LICENSE.md):
|
|
3512
3511
|
|
|
3513
3512
|
```
|
|
3514
3513
|
# License
|
|
@@ -3947,35 +3946,6 @@ SOFTWARE.
|
|
|
3947
3946
|
|
|
3948
3947
|
```
|
|
3949
3948
|
|
|
3950
|
-
### proxy
|
|
3951
|
-
|
|
3952
|
-
This product includes source derived from [proxy](https://github.com/TooTallNate/proxy-agents) ([v2.2.0](https://github.com/TooTallNate/proxy-agents/tree/v2.2.0)), distributed under the [MIT License](https://github.com/TooTallNate/proxy-agents/blob/v2.2.0/LICENSE):
|
|
3953
|
-
|
|
3954
|
-
```
|
|
3955
|
-
(The MIT License)
|
|
3956
|
-
|
|
3957
|
-
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
|
|
3958
|
-
|
|
3959
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
3960
|
-
a copy of this software and associated documentation files (the
|
|
3961
|
-
'Software'), to deal in the Software without restriction, including
|
|
3962
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
3963
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
3964
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
3965
|
-
the following conditions:
|
|
3966
|
-
|
|
3967
|
-
The above copyright notice and this permission notice shall be
|
|
3968
|
-
included in all copies or substantial portions of the Software.
|
|
3969
|
-
|
|
3970
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
3971
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
3972
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
3973
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
3974
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
3975
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
3976
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
3977
|
-
```
|
|
3978
|
-
|
|
3979
3949
|
### proxyquire
|
|
3980
3950
|
|
|
3981
3951
|
This product includes source derived from [proxyquire](https://github.com/thlorenz/proxyquire) ([v1.8.0](https://github.com/thlorenz/proxyquire/tree/v1.8.0)), distributed under the [MIT License](https://github.com/thlorenz/proxyquire/blob/v1.8.0/LICENSE):
|
package/lib/collector/facts.js
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
'use strict'
|
|
7
7
|
|
|
8
8
|
const fetchSystemInfo = require('../system-info')
|
|
9
|
-
const
|
|
9
|
+
const defaultLogger = require('../logger').child({ component: 'facts' })
|
|
10
10
|
const os = require('os')
|
|
11
11
|
const parseLabels = require('../util/label-parser')
|
|
12
12
|
|
|
13
13
|
module.exports = facts
|
|
14
14
|
|
|
15
|
-
async function facts(agent, callback) {
|
|
15
|
+
async function facts(agent, callback, { logger = defaultLogger } = {}) {
|
|
16
16
|
const startTime = Date.now()
|
|
17
17
|
|
|
18
18
|
const systemInfoPromise = new Promise((resolve) => {
|
|
@@ -55,6 +55,7 @@ module.exports = function parse(name, response, callback) {
|
|
|
55
55
|
logger.trace(json, 'Deserialized from collector:')
|
|
56
56
|
|
|
57
57
|
payload = json.return_value || payload
|
|
58
|
+
// This is ignoring any `validations` present on the returned JSON.
|
|
58
59
|
} catch (err) {
|
|
59
60
|
logger.warn(err, 'Could not parse response from the collector: %s', body)
|
|
60
61
|
}
|
|
@@ -131,7 +131,15 @@ function reformatLogLine({ logLine, msg, agent, chindings = '', level, logger })
|
|
|
131
131
|
delete metadata.hostname
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
const agentMeta = Object.assign({}, { timestamp: Date.now()
|
|
134
|
+
const agentMeta = Object.assign({}, { timestamp: Date.now() }, metadata)
|
|
135
|
+
// eslint-disable-next-line eqeqeq
|
|
136
|
+
if (msg != undefined) {
|
|
137
|
+
// The spec lists `message` as "MUST" under the required column, but then
|
|
138
|
+
// details that it "MUST be omitted" if the value is "empty". Additionally,
|
|
139
|
+
// if someone has logged only a merging object, and that object contains a
|
|
140
|
+
// message key, we do not want to overwrite their value. See issue 2595.
|
|
141
|
+
agentMeta.message = msg
|
|
142
|
+
}
|
|
135
143
|
|
|
136
144
|
/**
|
|
137
145
|
* A function that gets executed in `_toPayloadSync` of log aggregator.
|
|
@@ -21,7 +21,6 @@ const Contextualizer = require('./contextualizer')
|
|
|
21
21
|
*/
|
|
22
22
|
module.exports = function initialize(shim, when) {
|
|
23
23
|
const agent = shim.agent
|
|
24
|
-
const contextManager = agent._contextManager
|
|
25
24
|
const spec = WHEN_SPEC
|
|
26
25
|
|
|
27
26
|
// Wrap library-level methods.
|
|
@@ -82,7 +81,7 @@ module.exports = function initialize(shim, when) {
|
|
|
82
81
|
return Promise(executor) // eslint-disable-line new-cap
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
const parent =
|
|
84
|
+
const parent = agent.tracer.getSegment()
|
|
86
85
|
let promise = null
|
|
87
86
|
if (
|
|
88
87
|
!parent ||
|
|
@@ -108,14 +107,11 @@ module.exports = function initialize(shim, when) {
|
|
|
108
107
|
const segment = _createSegment(segmentName)
|
|
109
108
|
Contextualizer.link(null, promise, segment)
|
|
110
109
|
|
|
111
|
-
segment.start()
|
|
112
110
|
try {
|
|
113
111
|
// Must run after promise is defined so that `__NR_wrapper` can be set.
|
|
114
|
-
|
|
112
|
+
agent.tracer.bindFunction(executor, segment, true).apply(context.self, context.args)
|
|
115
113
|
} catch (e) {
|
|
116
114
|
context.args[1](e)
|
|
117
|
-
} finally {
|
|
118
|
-
segment.touch()
|
|
119
115
|
}
|
|
120
116
|
}
|
|
121
117
|
|
package/lib/shim/shim.js
CHANGED
|
@@ -1083,7 +1083,7 @@ function getSegment(obj) {
|
|
|
1083
1083
|
return obj[symbols.segment]
|
|
1084
1084
|
}
|
|
1085
1085
|
|
|
1086
|
-
return this.
|
|
1086
|
+
return this.tracer.getSegment()
|
|
1087
1087
|
}
|
|
1088
1088
|
|
|
1089
1089
|
/**
|
|
@@ -1172,32 +1172,18 @@ function applySegment(func, segment, full, context, args, inContextCB) {
|
|
|
1172
1172
|
|
|
1173
1173
|
this.logger.trace('Applying segment %s', segment.name)
|
|
1174
1174
|
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
if (full) {
|
|
1180
|
-
segment.start()
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1175
|
+
/**
|
|
1176
|
+
*
|
|
1177
|
+
*/
|
|
1178
|
+
function runInContextCb() {
|
|
1183
1179
|
if (typeof inContextCB === 'function') {
|
|
1184
1180
|
inContextCB(segment)
|
|
1185
1181
|
}
|
|
1186
1182
|
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
} catch (error) {
|
|
1190
|
-
if (prevSegment === null && process.domain != null) {
|
|
1191
|
-
process.domain[symbols.segment] = contextManager.getContext()
|
|
1192
|
-
}
|
|
1183
|
+
return fnApply.call(func, this, arguments)
|
|
1184
|
+
}
|
|
1193
1185
|
|
|
1194
|
-
|
|
1195
|
-
} finally {
|
|
1196
|
-
if (full) {
|
|
1197
|
-
segment.touch()
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
})
|
|
1186
|
+
return this.tracer.bindFunction(runInContextCb, segment, full).apply(context, args)
|
|
1201
1187
|
}
|
|
1202
1188
|
/* eslint-enable max-params */
|
|
1203
1189
|
|
|
@@ -26,6 +26,7 @@ function Tracer(agent, contextManager) {
|
|
|
26
26
|
|
|
27
27
|
Tracer.prototype.getTransaction = getTransaction
|
|
28
28
|
Tracer.prototype.getSegment = getSegment
|
|
29
|
+
Tracer.prototype.setSegment = setSegment
|
|
29
30
|
Tracer.prototype.getSpanContext = getSpanContext
|
|
30
31
|
Tracer.prototype.createSegment = createSegment
|
|
31
32
|
Tracer.prototype.addSegment = addSegment
|
|
@@ -57,6 +58,10 @@ function getSegment() {
|
|
|
57
58
|
return this._contextManager.getContext()
|
|
58
59
|
}
|
|
59
60
|
|
|
61
|
+
function setSegment(segment) {
|
|
62
|
+
this._contextManager.setContext(segment)
|
|
63
|
+
}
|
|
64
|
+
|
|
60
65
|
// TODO: Remove/replace external uses to tracer.getSpanContext()
|
|
61
66
|
function getSpanContext() {
|
|
62
67
|
const currentSegment = this.getSegment()
|
package/lib/util/label-parser.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newrelic",
|
|
3
|
-
"version": "12.5.
|
|
3
|
+
"version": "12.5.2",
|
|
4
4
|
"author": "New Relic Node.js agent team <nodejs@newrelic.com>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"contributors": [
|
|
@@ -161,8 +161,8 @@
|
|
|
161
161
|
"bench": "node ./bin/run-bench.js",
|
|
162
162
|
"docker-env": "./bin/docker-env-vars.sh",
|
|
163
163
|
"docs": "rm -rf ./out && jsdoc -c ./jsdoc-conf.jsonc --private -r .",
|
|
164
|
-
"integration": "npm run prepare-test && npm run sub-install && time c8 -o ./coverage/integration borp --timeout 600000 --reporter ./test/lib/test-reporter.mjs
|
|
165
|
-
"integration:esm": "NODE_OPTIONS='--loader=./esm-loader.mjs' time c8 -o ./coverage/integration-esm borp --reporter ./test/lib/test-reporter.mjs
|
|
164
|
+
"integration": "npm run prepare-test && npm run sub-install && BORP_CONF_FILE=.borp.int.yaml time c8 -o ./coverage/integration borp --timeout 600000 --reporter ./test/lib/test-reporter.mjs",
|
|
165
|
+
"integration:esm": "NODE_OPTIONS='--loader=./esm-loader.mjs' BORP_CONF_FILE=.borp.int-esm.yaml time c8 -o ./coverage/integration-esm borp --reporter ./test/lib/test-reporter.mjs",
|
|
166
166
|
"prepare-test": "npm run ssl && npm run docker-env",
|
|
167
167
|
"lint": "eslint ./*.{js,mjs} lib test bin",
|
|
168
168
|
"lint:fix": "eslint --fix, ./*.{js,mjs} lib test bin",
|
|
@@ -197,11 +197,11 @@
|
|
|
197
197
|
"dependencies": {
|
|
198
198
|
"@grpc/grpc-js": "^1.9.4",
|
|
199
199
|
"@grpc/proto-loader": "^0.7.5",
|
|
200
|
-
"@newrelic/security-agent": "^
|
|
200
|
+
"@newrelic/security-agent": "^2.0.0",
|
|
201
201
|
"@tyriar/fibonacci-heap": "^2.0.7",
|
|
202
202
|
"concat-stream": "^2.0.0",
|
|
203
203
|
"https-proxy-agent": "^7.0.1",
|
|
204
|
-
"import-in-the-middle": "^1.
|
|
204
|
+
"import-in-the-middle": "^1.11.2",
|
|
205
205
|
"json-bigint": "^1.0.0",
|
|
206
206
|
"json-stringify-safe": "^5.0.0",
|
|
207
207
|
"module-details-from-path": "^1.0.3",
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
"ajv": "^6.12.6",
|
|
231
231
|
"async": "^3.2.4",
|
|
232
232
|
"aws-sdk": "^2.1604.0",
|
|
233
|
-
"borp": "^0.
|
|
233
|
+
"borp": "^0.18.0",
|
|
234
234
|
"c8": "^8.0.1",
|
|
235
235
|
"clean-jsdoc-theme": "^4.2.18",
|
|
236
236
|
"commander": "^7.0.0",
|