newrelic 12.16.1 → 12.18.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 +53 -0
- package/THIRD_PARTY_NOTICES.md +139 -110
- package/lib/agent.js +4 -0
- package/lib/config/default.js +57 -1
- package/lib/grpc/connection.js +26 -6
- package/lib/instrumentation/@azure/functions.js +311 -0
- package/lib/instrumentations.js +1 -0
- package/lib/otel/attr-mapping/db.js +83 -0
- package/lib/otel/attr-mapping/exceptions.js +23 -0
- package/lib/otel/attr-mapping/faas.js +25 -0
- package/lib/otel/attr-mapping/http.js +193 -0
- package/lib/otel/attr-mapping/messaging.js +105 -0
- package/lib/otel/attr-mapping/utils.js +75 -0
- package/lib/otel/constants.js +46 -2
- package/lib/otel/rules.js +30 -7
- package/lib/otel/segments/consumer.js +6 -15
- package/lib/otel/segments/database.js +7 -14
- package/lib/otel/segments/http-external.js +5 -10
- package/lib/otel/segments/producer.js +6 -7
- package/lib/otel/segments/server.js +15 -30
- package/lib/otel/segments/utils.js +8 -2
- package/lib/otel/setup.js +0 -5
- package/lib/otel/span-processor.js +33 -144
- package/lib/shim/message-shim/subscribe-consume.js +1 -1
- package/lib/spans/base-span-streamer.js +10 -9
- package/lib/spans/batch-span-streamer.js +28 -25
- package/lib/spans/create-span-event-aggregator.js +2 -1
- package/lib/spans/span-streamer.js +1 -1
- package/lib/transaction/index.js +105 -21
- package/lib/transaction/tracecontext.js +51 -421
- package/lib/util/logger.js +38 -6
- package/lib/utilization/aws-info.js +6 -3
- package/lib/utilization/azure-info.js +5 -2
- package/lib/utilization/azurefunction-info.js +46 -0
- package/lib/utilization/docker-info.js +12 -9
- package/lib/utilization/ecs-info.js +5 -4
- package/lib/utilization/gcp-info.js +5 -2
- package/lib/utilization/index.js +3 -1
- package/lib/utilization/kubernetes-info.js +4 -2
- package/lib/utilization/pcf-info.js +3 -2
- package/lib/w3c/traceparent.js +157 -0
- package/lib/w3c/tracestate-intrinsics.js +112 -0
- package/lib/w3c/tracestate.js +265 -0
- package/package.json +4 -5
package/NEWS.md
CHANGED
|
@@ -1,3 +1,56 @@
|
|
|
1
|
+
### v12.18.0 (2025-04-14)
|
|
2
|
+
|
|
3
|
+
#### Features
|
|
4
|
+
|
|
5
|
+
* Support Azure functions background trigger types ([#3028](https://github.com/newrelic/node-newrelic/pull/3028)) ([3bf17b0](https://github.com/newrelic/node-newrelic/commit/3bf17b03abaa713c1f9ad544c54c24a6374359c2))
|
|
6
|
+
* Support Azure functions HTTP trigger type ([#3021](https://github.com/newrelic/node-newrelic/pull/3021)) ([90d894b](https://github.com/newrelic/node-newrelic/commit/90d894bf1eb4a48f4b7f314ae22eef2cc76c32b9))
|
|
7
|
+
|
|
8
|
+
#### Bug fixes
|
|
9
|
+
|
|
10
|
+
* Updated span streamer to properly retry failed batches and handle flushing batch queue every 5 seconds ([#3033](https://github.com/newrelic/node-newrelic/pull/3033)) ([7db0e7c](https://github.com/newrelic/node-newrelic/commit/7db0e7ca929d54858addd5255b46507f82333045))
|
|
11
|
+
|
|
12
|
+
#### Code refactoring
|
|
13
|
+
|
|
14
|
+
* Update otel bridge rules synthesizer to properly handle consumer kind rules ([#3003](https://github.com/newrelic/node-newrelic/pull/3003)) ([3295dd1](https://github.com/newrelic/node-newrelic/commit/3295dd12bbebb708f3eeca2ad32fbc157a892fec))
|
|
15
|
+
|
|
16
|
+
#### Documentation
|
|
17
|
+
|
|
18
|
+
* Updated compatibility report ([#3020](https://github.com/newrelic/node-newrelic/pull/3020)) ([ce32b67](https://github.com/newrelic/node-newrelic/commit/ce32b6754383b6b1fe95d1d37759810b4caaf34c))
|
|
19
|
+
|
|
20
|
+
#### Miscellaneous chores
|
|
21
|
+
|
|
22
|
+
* Fixed prisma CI issues ([#3031](https://github.com/newrelic/node-newrelic/pull/3031)) ([1349cae](https://github.com/newrelic/node-newrelic/commit/1349cae4d87941e4f55dffc2445c90e73d823bbc))
|
|
23
|
+
* Improved logging within utilization detection ([#3034](https://github.com/newrelic/node-newrelic/pull/3034)) ([b47bd46](https://github.com/newrelic/node-newrelic/commit/b47bd46ad144723ac62192eb9cc474ddd1fce98d))
|
|
24
|
+
|
|
25
|
+
### v12.17.0 (2025-04-02)
|
|
26
|
+
|
|
27
|
+
#### Features
|
|
28
|
+
|
|
29
|
+
* Azure Function utilization ([#3017](https://github.com/newrelic/node-newrelic/pull/3017)) ([80ab93e](https://github.com/newrelic/node-newrelic/commit/80ab93ee5599800a823e3828f9730d5421b460c2))
|
|
30
|
+
* Support honoring W3C `traceparent` sampled flag ([#3009](https://github.com/newrelic/node-newrelic/pull/3009)) ([d903413](https://github.com/newrelic/node-newrelic/commit/d903413a6216dae2cde3e6b6366c3a390d4ed4cd))
|
|
31
|
+
* By default the agent will not honor the `traceparent` sampled flag.
|
|
32
|
+
* To control how sampling works with `traceparent` set the following in config:
|
|
33
|
+
* `distributed_tracing.sampler.remote_parent_sampled`(when the traceparent sampled flag is `01`)
|
|
34
|
+
* `always_on`: the agent will sample spans
|
|
35
|
+
* `always_off`: the agent will not sample spans
|
|
36
|
+
* `default`: the agent will rely on existing priority sampling to make its decisions
|
|
37
|
+
* `distributed_tracing.sampler.remote_parent_not_sampled`(when the traceparent sampled flag is `00`)
|
|
38
|
+
* `always_on`: the agent will sample spans
|
|
39
|
+
* `always_off`: the agent will not sample spans
|
|
40
|
+
* `default`: the agent will rely on existing priority sampling to make its decisions
|
|
41
|
+
|
|
42
|
+
#### Code refactoring
|
|
43
|
+
|
|
44
|
+
* Updated otel bridge to centralize mapping rules for a given span attribute to accomondate semantic convention spec updates ([#3010](https://github.com/newrelic/node-newrelic/pull/3010)) ([c20c36b](https://github.com/newrelic/node-newrelic/commit/c20c36bbe0f63ab18fbbe85ad4bfaa3b80f1475d))
|
|
45
|
+
|
|
46
|
+
#### Documentation
|
|
47
|
+
|
|
48
|
+
* Updated compatibility report ([#3013](https://github.com/newrelic/node-newrelic/pull/3013)) ([8fab715](https://github.com/newrelic/node-newrelic/commit/8fab715581ccc5da7118884a0080557891329daa))
|
|
49
|
+
|
|
50
|
+
#### Tests
|
|
51
|
+
|
|
52
|
+
* Pinned `openai@4.90.0` to work with `@langchain/openai` ([#3019](https://github.com/newrelic/node-newrelic/pull/3019)) ([eaa3db0](https://github.com/newrelic/node-newrelic/commit/eaa3db0a556a19c44a05926dc339ea7bcbc9cebd))
|
|
53
|
+
|
|
1
54
|
### v12.16.1 (2025-03-24)
|
|
2
55
|
|
|
3
56
|
#### Features
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -19,7 +19,6 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
19
19
|
* [@newrelic/security-agent](#newrelicsecurity-agent)
|
|
20
20
|
* [@opentelemetry/api](#opentelemetryapi)
|
|
21
21
|
* [@opentelemetry/core](#opentelemetrycore)
|
|
22
|
-
* [@opentelemetry/resources](#opentelemetryresources)
|
|
23
22
|
* [@opentelemetry/sdk-trace-base](#opentelemetrysdk-trace-base)
|
|
24
23
|
* [@tyriar/fibonacci-heap](#tyriarfibonacci-heap)
|
|
25
24
|
* [concat-stream](#concat-stream)
|
|
@@ -92,7 +91,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
92
91
|
|
|
93
92
|
### @grpc/grpc-js
|
|
94
93
|
|
|
95
|
-
This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.
|
|
94
|
+
This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.13.2](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.13.2)), distributed under the [Apache-2.0 License](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.13.2/LICENSE):
|
|
96
95
|
|
|
97
96
|
```
|
|
98
97
|
Apache License
|
|
@@ -510,10 +509,48 @@ This product includes source derived from [@grpc/proto-loader](https://github.co
|
|
|
510
509
|
|
|
511
510
|
### @newrelic/security-agent
|
|
512
511
|
|
|
513
|
-
This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v2.
|
|
512
|
+
This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v2.4.0](https://github.com/newrelic/csec-node-agent/tree/v2.4.0)), distributed under the [UNKNOWN License](https://github.com/newrelic/csec-node-agent/blob/v2.4.0/LICENSE):
|
|
514
513
|
|
|
515
514
|
```
|
|
516
|
-
|
|
515
|
+
## New Relic Software License v1.0
|
|
516
|
+
|
|
517
|
+
### Acceptance
|
|
518
|
+
|
|
519
|
+
This software license applies to the repositories, directories, or files that it has been associated with (referred to here as “the Software”). In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
520
|
+
|
|
521
|
+
### License
|
|
522
|
+
|
|
523
|
+
New Relic grants you a license for the Software to do everything you might do with the Software that would otherwise infringe the New Relic’s copyrights or patent rights, conditional on only using the Software for Permitted Purposes and compliance with all other Restrictions on Use. All other uses are prohibited.
|
|
524
|
+
|
|
525
|
+
### Permitted Purposes
|
|
526
|
+
|
|
527
|
+
The Software is solely for use with New Relic’s proprietary SaaS service (“New Relic Service”). To use the Software you must have a valid and active subscription agreement to the New Relic Service. You may not use the Software in conjunction with any other similar service.
|
|
528
|
+
|
|
529
|
+
### Restrictions on Use
|
|
530
|
+
|
|
531
|
+
1. The use of the Software is limited to you and your organization. You cannot expose the Software to third parties via the network or use the Software on behalf of anyone else.
|
|
532
|
+
2. You cannot modify the Software. You can compile or link the Software into your programs as described in the New Relic Documentation, but you cannot otherwise make any derivative works of the Software.
|
|
533
|
+
3. You cannot reverse engineer or decompile the Software.
|
|
534
|
+
4. You cannot use the Software for competitive analysis, benchmarking, or any purposes that compete with or are intended to compete with New Relic.
|
|
535
|
+
5. You cannot remove or obscure any proprietary notices in the Software.
|
|
536
|
+
6. You can only copy the Software to the extent needed to use the Software within your organization. You cannot distribute the Software to any third parties.
|
|
537
|
+
7. You can only use the New Relic Services and the Software consistent with your subscription agreement with New Relic, New Relic’s product Documentation and Acceptable Use Policy.
|
|
538
|
+
|
|
539
|
+
### Intellectual Property
|
|
540
|
+
|
|
541
|
+
Any feedback provided to New Relic about the Software, including feedback provided as source code, comments, or other copyrightable or patentable material, is provided to New Relic under the terms of the Apache Software License, version 2. If you do not provide attribution information or a copy of the license with your feedback, you waive the performance of those requirements of the Apache License with respect to New Relic. The license grant regarding any feedback is irrevocable and persists past the termination of this license.
|
|
542
|
+
|
|
543
|
+
### Termination
|
|
544
|
+
|
|
545
|
+
This license terminates when the Software stops being provided by New Relic or when described by the New Relic subscription agreement, whichever comes first. When this license terminates, you have a commercially reasonable time to either remove the Software from your systems.
|
|
546
|
+
|
|
547
|
+
### Other Terms
|
|
548
|
+
|
|
549
|
+
1. The Software is provided “AS IS.” New Relic disclaims all warranties, whether express, implied, statutory or otherwise, including warranties of merchantability, fitness for a particular purpose, title, and noninfringement.
|
|
550
|
+
2. To the full extent permitted by law, New Relic will have no liability arising from or related to the Software or from this license for any direct, indirect, special, incidental, or consequential damages of any kind, even if advised of their possibility in advance, and regardless of legal theory (whether contract, tort, negligence, strict liability or otherwise).
|
|
551
|
+
3. The Software may contain third-party software, including open source software (“OSS”). The third party software is governed by its own license and subject to its own terms, disclosed in the provided licensing information associated with the third party components. If a source code disclosure is required under the terms of the license covering any OSS component, the source code can be requested of New Relic by emailing opensource@newrelic.com.
|
|
552
|
+
|
|
553
|
+
|
|
517
554
|
```
|
|
518
555
|
|
|
519
556
|
### @opentelemetry/api
|
|
@@ -727,7 +764,7 @@ This product includes source derived from [@opentelemetry/api](https://github.co
|
|
|
727
764
|
|
|
728
765
|
### @opentelemetry/core
|
|
729
766
|
|
|
730
|
-
This product includes source derived from [@opentelemetry/core](https://github.com/open-telemetry/opentelemetry-js) ([
|
|
767
|
+
This product includes source derived from [@opentelemetry/core](https://github.com/open-telemetry/opentelemetry-js) ([v2.0.0](https://github.com/open-telemetry/opentelemetry-js/tree/v2.0.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v2.0.0/LICENSE):
|
|
731
768
|
|
|
732
769
|
```
|
|
733
770
|
Apache License
|
|
@@ -934,9 +971,9 @@ This product includes source derived from [@opentelemetry/core](https://github.c
|
|
|
934
971
|
|
|
935
972
|
```
|
|
936
973
|
|
|
937
|
-
### @opentelemetry/
|
|
974
|
+
### @opentelemetry/sdk-trace-base
|
|
938
975
|
|
|
939
|
-
This product includes source derived from [@opentelemetry/
|
|
976
|
+
This product includes source derived from [@opentelemetry/sdk-trace-base](https://github.com/open-telemetry/opentelemetry-js) ([v2.0.0](https://github.com/open-telemetry/opentelemetry-js/tree/v2.0.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v2.0.0/LICENSE):
|
|
940
977
|
|
|
941
978
|
```
|
|
942
979
|
Apache License
|
|
@@ -1143,9 +1180,98 @@ This product includes source derived from [@opentelemetry/resources](https://git
|
|
|
1143
1180
|
|
|
1144
1181
|
```
|
|
1145
1182
|
|
|
1146
|
-
### @
|
|
1183
|
+
### @tyriar/fibonacci-heap
|
|
1184
|
+
|
|
1185
|
+
This product includes source derived from [@tyriar/fibonacci-heap](https://github.com/gwtw/ts-fibonacci-heap) ([v2.0.9](https://github.com/gwtw/ts-fibonacci-heap/tree/v2.0.9)), distributed under the [MIT License](https://github.com/gwtw/ts-fibonacci-heap/blob/v2.0.9/LICENSE):
|
|
1186
|
+
|
|
1187
|
+
```
|
|
1188
|
+
The MIT License (MIT)
|
|
1189
|
+
|
|
1190
|
+
Copyright (c) 2014 Daniel Imms, http://www.growingwiththeweb.com
|
|
1191
|
+
|
|
1192
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1193
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
1194
|
+
in the Software without restriction, including without limitation the rights
|
|
1195
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1196
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
1197
|
+
furnished to do so, subject to the following conditions:
|
|
1198
|
+
|
|
1199
|
+
The above copyright notice and this permission notice shall be included in
|
|
1200
|
+
all copies or substantial portions of the Software.
|
|
1201
|
+
|
|
1202
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1203
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1204
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1205
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1206
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1207
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1208
|
+
THE SOFTWARE.
|
|
1209
|
+
|
|
1210
|
+
```
|
|
1211
|
+
|
|
1212
|
+
### concat-stream
|
|
1213
|
+
|
|
1214
|
+
This product includes source derived from [concat-stream](https://github.com/maxogden/concat-stream) ([v2.0.0](https://github.com/maxogden/concat-stream/tree/v2.0.0)), distributed under the [MIT License](https://github.com/maxogden/concat-stream/blob/v2.0.0/LICENSE):
|
|
1215
|
+
|
|
1216
|
+
```
|
|
1217
|
+
The MIT License
|
|
1218
|
+
|
|
1219
|
+
Copyright (c) 2013 Max Ogden
|
|
1220
|
+
|
|
1221
|
+
Permission is hereby granted, free of charge,
|
|
1222
|
+
to any person obtaining a copy of this software and
|
|
1223
|
+
associated documentation files (the "Software"), to
|
|
1224
|
+
deal in the Software without restriction, including
|
|
1225
|
+
without limitation the rights to use, copy, modify,
|
|
1226
|
+
merge, publish, distribute, sublicense, and/or sell
|
|
1227
|
+
copies of the Software, and to permit persons to whom
|
|
1228
|
+
the Software is furnished to do so,
|
|
1229
|
+
subject to the following conditions:
|
|
1147
1230
|
|
|
1148
|
-
|
|
1231
|
+
The above copyright notice and this permission notice
|
|
1232
|
+
shall be included in all copies or substantial portions of the Software.
|
|
1233
|
+
|
|
1234
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
1235
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
1236
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
1237
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
|
1238
|
+
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
1239
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
1240
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1241
|
+
```
|
|
1242
|
+
|
|
1243
|
+
### https-proxy-agent
|
|
1244
|
+
|
|
1245
|
+
This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) ([v7.0.6](https://github.com/TooTallNate/proxy-agents/tree/v7.0.6)), distributed under the [MIT License](https://github.com/TooTallNate/proxy-agents/blob/v7.0.6/LICENSE):
|
|
1246
|
+
|
|
1247
|
+
```
|
|
1248
|
+
(The MIT License)
|
|
1249
|
+
|
|
1250
|
+
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
|
|
1251
|
+
|
|
1252
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
1253
|
+
a copy of this software and associated documentation files (the
|
|
1254
|
+
'Software'), to deal in the Software without restriction, including
|
|
1255
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
1256
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
1257
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
1258
|
+
the following conditions:
|
|
1259
|
+
|
|
1260
|
+
The above copyright notice and this permission notice shall be
|
|
1261
|
+
included in all copies or substantial portions of the Software.
|
|
1262
|
+
|
|
1263
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
1264
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
1265
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
1266
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
1267
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
1268
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
1269
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1270
|
+
```
|
|
1271
|
+
|
|
1272
|
+
### import-in-the-middle
|
|
1273
|
+
|
|
1274
|
+
This product includes source derived from [import-in-the-middle](https://github.com/nodejs/import-in-the-middle) ([v1.13.1](https://github.com/nodejs/import-in-the-middle/tree/v1.13.1)), distributed under the [Apache-2.0 License](https://github.com/nodejs/import-in-the-middle/blob/v1.13.1/LICENSE):
|
|
1149
1275
|
|
|
1150
1276
|
```
|
|
1151
1277
|
Apache License
|
|
@@ -1352,103 +1478,6 @@ This product includes source derived from [@opentelemetry/sdk-trace-base](https:
|
|
|
1352
1478
|
|
|
1353
1479
|
```
|
|
1354
1480
|
|
|
1355
|
-
### @tyriar/fibonacci-heap
|
|
1356
|
-
|
|
1357
|
-
This product includes source derived from [@tyriar/fibonacci-heap](https://github.com/gwtw/ts-fibonacci-heap) ([v2.0.9](https://github.com/gwtw/ts-fibonacci-heap/tree/v2.0.9)), distributed under the [MIT License](https://github.com/gwtw/ts-fibonacci-heap/blob/v2.0.9/LICENSE):
|
|
1358
|
-
|
|
1359
|
-
```
|
|
1360
|
-
The MIT License (MIT)
|
|
1361
|
-
|
|
1362
|
-
Copyright (c) 2014 Daniel Imms, http://www.growingwiththeweb.com
|
|
1363
|
-
|
|
1364
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1365
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
1366
|
-
in the Software without restriction, including without limitation the rights
|
|
1367
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1368
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
1369
|
-
furnished to do so, subject to the following conditions:
|
|
1370
|
-
|
|
1371
|
-
The above copyright notice and this permission notice shall be included in
|
|
1372
|
-
all copies or substantial portions of the Software.
|
|
1373
|
-
|
|
1374
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1375
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1376
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1377
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1378
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1379
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1380
|
-
THE SOFTWARE.
|
|
1381
|
-
|
|
1382
|
-
```
|
|
1383
|
-
|
|
1384
|
-
### concat-stream
|
|
1385
|
-
|
|
1386
|
-
This product includes source derived from [concat-stream](https://github.com/maxogden/concat-stream) ([v2.0.0](https://github.com/maxogden/concat-stream/tree/v2.0.0)), distributed under the [MIT License](https://github.com/maxogden/concat-stream/blob/v2.0.0/LICENSE):
|
|
1387
|
-
|
|
1388
|
-
```
|
|
1389
|
-
The MIT License
|
|
1390
|
-
|
|
1391
|
-
Copyright (c) 2013 Max Ogden
|
|
1392
|
-
|
|
1393
|
-
Permission is hereby granted, free of charge,
|
|
1394
|
-
to any person obtaining a copy of this software and
|
|
1395
|
-
associated documentation files (the "Software"), to
|
|
1396
|
-
deal in the Software without restriction, including
|
|
1397
|
-
without limitation the rights to use, copy, modify,
|
|
1398
|
-
merge, publish, distribute, sublicense, and/or sell
|
|
1399
|
-
copies of the Software, and to permit persons to whom
|
|
1400
|
-
the Software is furnished to do so,
|
|
1401
|
-
subject to the following conditions:
|
|
1402
|
-
|
|
1403
|
-
The above copyright notice and this permission notice
|
|
1404
|
-
shall be included in all copies or substantial portions of the Software.
|
|
1405
|
-
|
|
1406
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
1407
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
1408
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
1409
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
|
1410
|
-
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
1411
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
1412
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1413
|
-
```
|
|
1414
|
-
|
|
1415
|
-
### https-proxy-agent
|
|
1416
|
-
|
|
1417
|
-
This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) ([v7.0.6](https://github.com/TooTallNate/proxy-agents/tree/v7.0.6)), distributed under the [MIT License](https://github.com/TooTallNate/proxy-agents/blob/v7.0.6/LICENSE):
|
|
1418
|
-
|
|
1419
|
-
```
|
|
1420
|
-
(The MIT License)
|
|
1421
|
-
|
|
1422
|
-
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
|
|
1423
|
-
|
|
1424
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
1425
|
-
a copy of this software and associated documentation files (the
|
|
1426
|
-
'Software'), to deal in the Software without restriction, including
|
|
1427
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
1428
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
1429
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
1430
|
-
the following conditions:
|
|
1431
|
-
|
|
1432
|
-
The above copyright notice and this permission notice shall be
|
|
1433
|
-
included in all copies or substantial portions of the Software.
|
|
1434
|
-
|
|
1435
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
1436
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
1437
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
1438
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
1439
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
1440
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
1441
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1442
|
-
```
|
|
1443
|
-
|
|
1444
|
-
### import-in-the-middle
|
|
1445
|
-
|
|
1446
|
-
This product includes source derived from [import-in-the-middle](https://github.com/nodejs/import-in-the-middle) ([v1.13.0](https://github.com/nodejs/import-in-the-middle/tree/v1.13.0)), distributed under the [Apache-2.0 License](undefined):
|
|
1447
|
-
|
|
1448
|
-
```
|
|
1449
|
-
undefined
|
|
1450
|
-
```
|
|
1451
|
-
|
|
1452
1481
|
### json-bigint
|
|
1453
1482
|
|
|
1454
1483
|
This product includes source derived from [json-bigint](https://github.com/sidorares/json-bigint) ([v1.0.0](https://github.com/sidorares/json-bigint/tree/v1.0.0)), distributed under the [MIT License](https://github.com/sidorares/json-bigint/blob/v1.0.0/LICENSE):
|
|
@@ -1586,7 +1615,7 @@ IN THE SOFTWARE.
|
|
|
1586
1615
|
|
|
1587
1616
|
### require-in-the-middle
|
|
1588
1617
|
|
|
1589
|
-
This product includes source derived from [require-in-the-middle](https://github.com/elastic/require-in-the-middle) ([v7.
|
|
1618
|
+
This product includes source derived from [require-in-the-middle](https://github.com/elastic/require-in-the-middle) ([v7.5.0](https://github.com/elastic/require-in-the-middle/tree/v7.5.0)), distributed under the [MIT License](https://github.com/elastic/require-in-the-middle/blob/v7.5.0/LICENSE):
|
|
1590
1619
|
|
|
1591
1620
|
```
|
|
1592
1621
|
The MIT License (MIT)
|
|
@@ -1672,7 +1701,7 @@ SOFTWARE.
|
|
|
1672
1701
|
|
|
1673
1702
|
### @aws-sdk/client-s3
|
|
1674
1703
|
|
|
1675
|
-
This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.
|
|
1704
|
+
This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.726.1](https://github.com/aws/aws-sdk-js-v3/tree/v3.726.1)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.726.1/LICENSE):
|
|
1676
1705
|
|
|
1677
1706
|
```
|
|
1678
1707
|
Apache License
|
|
@@ -1881,7 +1910,7 @@ This product includes source derived from [@aws-sdk/client-s3](https://github.co
|
|
|
1881
1910
|
|
|
1882
1911
|
### @aws-sdk/s3-request-presigner
|
|
1883
1912
|
|
|
1884
|
-
This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.
|
|
1913
|
+
This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.726.1](https://github.com/aws/aws-sdk-js-v3/tree/v3.726.1)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.726.1/LICENSE):
|
|
1885
1914
|
|
|
1886
1915
|
```
|
|
1887
1916
|
Apache License
|
|
@@ -3741,7 +3770,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
3741
3770
|
|
|
3742
3771
|
### eslint
|
|
3743
3772
|
|
|
3744
|
-
This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v9.
|
|
3773
|
+
This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v9.18.0](https://github.com/eslint/eslint/tree/v9.18.0)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v9.18.0/LICENSE):
|
|
3745
3774
|
|
|
3746
3775
|
```
|
|
3747
3776
|
Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
|
package/lib/agent.js
CHANGED
|
@@ -303,6 +303,10 @@ function Agent(config) {
|
|
|
303
303
|
}
|
|
304
304
|
util.inherits(Agent, EventEmitter)
|
|
305
305
|
|
|
306
|
+
Object.defineProperty(Agent.prototype, Symbol.toStringTag, {
|
|
307
|
+
value: 'Agent'
|
|
308
|
+
})
|
|
309
|
+
|
|
306
310
|
/**
|
|
307
311
|
* The agent is meant to only exist once per application, but the singleton is
|
|
308
312
|
* managed by index.js. An agent will be created even if the agent's disabled by
|
package/lib/config/default.js
CHANGED
|
@@ -492,6 +492,14 @@ defaultConfig.definition = () => ({
|
|
|
492
492
|
formatter: boolean,
|
|
493
493
|
default: true
|
|
494
494
|
},
|
|
495
|
+
/**
|
|
496
|
+
* This flag dictates whether the agent attempts to read environment variables
|
|
497
|
+
* and invocation context to get info about the Azure Function called.
|
|
498
|
+
*/
|
|
499
|
+
detect_azurefunction: {
|
|
500
|
+
formatter: boolean,
|
|
501
|
+
default: true
|
|
502
|
+
},
|
|
495
503
|
/**
|
|
496
504
|
* This flag dictates whether the agent attempts to read files
|
|
497
505
|
* to get info about the container the process is running in.
|
|
@@ -1083,6 +1091,7 @@ defaultConfig.definition = () => ({
|
|
|
1083
1091
|
}
|
|
1084
1092
|
}
|
|
1085
1093
|
},
|
|
1094
|
+
|
|
1086
1095
|
/**
|
|
1087
1096
|
* Controls the method of cross agent tracing in the agent.
|
|
1088
1097
|
* Distributed tracing lets you see the path that a request takes through your
|
|
@@ -1109,8 +1118,41 @@ defaultConfig.definition = () => ({
|
|
|
1109
1118
|
exclude_newrelic_header: {
|
|
1110
1119
|
formatter: boolean,
|
|
1111
1120
|
default: false
|
|
1121
|
+
},
|
|
1122
|
+
|
|
1123
|
+
sampler: {
|
|
1124
|
+
/**
|
|
1125
|
+
* When set to `always_on`, the sampled flag in the `traceparent` header
|
|
1126
|
+
* being set to "true" will result in the local transaction being sampled
|
|
1127
|
+
* with a priority value of "2". When set to `always_off`, the local
|
|
1128
|
+
* transaction will never be sampled. At the default setting, the sampling
|
|
1129
|
+
* decision will be determined according to the normal algorithm.
|
|
1130
|
+
*
|
|
1131
|
+
* This setting takes precedence over the `remote_parent_not_sampled`
|
|
1132
|
+
* setting.
|
|
1133
|
+
*/
|
|
1134
|
+
remote_parent_sampled: {
|
|
1135
|
+
formatter: allowList.bind(null, ['always_on', 'always_off', 'default']),
|
|
1136
|
+
default: 'default'
|
|
1137
|
+
},
|
|
1138
|
+
|
|
1139
|
+
/**
|
|
1140
|
+
* When set to `always_on`, the local transaction will be sampled with a
|
|
1141
|
+
* priority of "2".
|
|
1142
|
+
* When set to `always_off`, the local transaction will never be sampled.
|
|
1143
|
+
* At the default setting, the sampling decision will be determined
|
|
1144
|
+
* according to the normal algorithm.
|
|
1145
|
+
*
|
|
1146
|
+
* This setting only affects decisions when the traceparent sampled flag
|
|
1147
|
+
* is set to 0.
|
|
1148
|
+
*/
|
|
1149
|
+
remote_parent_not_sampled: {
|
|
1150
|
+
formatter: allowList.bind(null, ['always_on', 'always_off', 'default']),
|
|
1151
|
+
default: 'default'
|
|
1152
|
+
}
|
|
1112
1153
|
}
|
|
1113
1154
|
},
|
|
1155
|
+
|
|
1114
1156
|
/**
|
|
1115
1157
|
* Controls the use of cross-application tracing.
|
|
1116
1158
|
*
|
|
@@ -1155,7 +1197,14 @@ defaultConfig.definition = () => ({
|
|
|
1155
1197
|
port: {
|
|
1156
1198
|
formatter: int,
|
|
1157
1199
|
default: 443
|
|
1158
|
-
}
|
|
1200
|
+
},
|
|
1201
|
+
/**
|
|
1202
|
+
* For testing only. This allows the connection to an insecure gRPC server.
|
|
1203
|
+
*/
|
|
1204
|
+
insecure: {
|
|
1205
|
+
formatter: boolean,
|
|
1206
|
+
default: false
|
|
1207
|
+
},
|
|
1159
1208
|
},
|
|
1160
1209
|
span_events: {
|
|
1161
1210
|
/**
|
|
@@ -1164,6 +1213,13 @@ defaultConfig.definition = () => ({
|
|
|
1164
1213
|
queue_size: {
|
|
1165
1214
|
formatter: int,
|
|
1166
1215
|
default: 10000
|
|
1216
|
+
},
|
|
1217
|
+
/**
|
|
1218
|
+
* Size of batches to post to 8T server
|
|
1219
|
+
*/
|
|
1220
|
+
batch_size: {
|
|
1221
|
+
formatter: int,
|
|
1222
|
+
default: 750
|
|
1167
1223
|
}
|
|
1168
1224
|
},
|
|
1169
1225
|
batching: {
|
package/lib/grpc/connection.js
CHANGED
|
@@ -62,6 +62,7 @@ class GrpcConnection extends EventEmitter {
|
|
|
62
62
|
|
|
63
63
|
const traceObserverConfig = infiniteTracingConfig.trace_observer
|
|
64
64
|
this._endpoint = this.getTraceObserverEndpoint(traceObserverConfig)
|
|
65
|
+
this._insecureConnection = traceObserverConfig.insecure
|
|
65
66
|
|
|
66
67
|
this._client = null
|
|
67
68
|
this.stream = null
|
|
@@ -202,11 +203,13 @@ class GrpcConnection extends EventEmitter {
|
|
|
202
203
|
|
|
203
204
|
_disconnect() {
|
|
204
205
|
logger.trace('Disconnecting from gRPC endpoint.')
|
|
206
|
+
this._setState(connectionStates.disconnected)
|
|
205
207
|
|
|
206
208
|
if (this.stream) {
|
|
207
209
|
this.stream.removeAllListeners()
|
|
208
210
|
|
|
209
211
|
const oldStream = this.stream
|
|
212
|
+
|
|
210
213
|
this.stream.on('status', function endStreamStatusHandler(grpcStatus) {
|
|
211
214
|
logger.trace('End stream status received [%s]: %s', grpcStatus.code, grpcStatus.details)
|
|
212
215
|
|
|
@@ -228,8 +231,6 @@ class GrpcConnection extends EventEmitter {
|
|
|
228
231
|
|
|
229
232
|
this.stream = null
|
|
230
233
|
}
|
|
231
|
-
|
|
232
|
-
this._setState(connectionStates.disconnected)
|
|
233
234
|
}
|
|
234
235
|
|
|
235
236
|
/**
|
|
@@ -374,12 +375,10 @@ class GrpcConnection extends EventEmitter {
|
|
|
374
375
|
|
|
375
376
|
const traceApi = protoDescriptor.com.newrelic.trace.v1
|
|
376
377
|
|
|
377
|
-
const credentials = this._generateCredentials(grpc)
|
|
378
|
-
|
|
379
|
-
// If you want to use mock server use insecure creds
|
|
380
|
-
// const credentials = grpc.credentials.createInsecure()
|
|
378
|
+
const credentials = this._insecureConnection ? grpc.credentials.createInsecure() : this._generateCredentials(grpc)
|
|
381
379
|
|
|
382
380
|
const opts = {}
|
|
381
|
+
|
|
383
382
|
if (this._compression) {
|
|
384
383
|
// 2 = gzip compression
|
|
385
384
|
// see: https://github.com/grpc/grpc-node/blob/master/packages/grpc-js/src/compression-algorithms.ts#L21
|
|
@@ -393,6 +392,27 @@ class GrpcConnection extends EventEmitter {
|
|
|
393
392
|
.incrementCallCount()
|
|
394
393
|
}
|
|
395
394
|
|
|
395
|
+
// this defines retries of writes to stream if it fails with `UNAVAILABLE` or `INTERNAL`
|
|
396
|
+
const serviceConfig = {
|
|
397
|
+
methodConfig: [
|
|
398
|
+
{
|
|
399
|
+
name: [
|
|
400
|
+
{
|
|
401
|
+
service: 'com.newrelic.trace.v1.IngestService'
|
|
402
|
+
}
|
|
403
|
+
],
|
|
404
|
+
retryPolicy: {
|
|
405
|
+
maxAttempts: 10,
|
|
406
|
+
initialBackoff: '0.1s',
|
|
407
|
+
maxBackoff: '1s',
|
|
408
|
+
backoffMultiplier: 2,
|
|
409
|
+
retryableStatusCodes: ['UNAVAILABLE', 'INTERNAL']
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
]
|
|
413
|
+
}
|
|
414
|
+
opts['grpc.service_config'] = JSON.stringify(serviceConfig)
|
|
415
|
+
|
|
396
416
|
return new traceApi.IngestService(endpoint, credentials, opts)
|
|
397
417
|
}
|
|
398
418
|
}
|