newrelic 14.1.0 → 14.1.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 +24 -0
- package/README.md +2 -27
- package/THIRD_PARTY_NOTICES.md +21 -21
- package/lib/collector/http-agents.js +33 -5
- package/lib/config/index.js +1 -0
- package/lib/otel/metrics/generate-proxy-agent-factory.js +31 -0
- package/lib/otel/metrics/index.js +17 -7
- package/lib/otel/metrics/nr-exporter.js +10 -2
- package/lib/otel/metrics/nr-proxying-delegate.js +28 -1
- package/lib/subscribers/azure-functions/azure-handler-base.js +16 -3
- package/lib/util/logger.js +1 -0
- package/package.json +7 -7
package/NEWS.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
### v14.1.2 (2026-06-25)
|
|
2
|
+
|
|
3
|
+
#### Bug fixes
|
|
4
|
+
|
|
5
|
+
* Fixed Azure functions crashing when they include response headers ([#4070](https://github.com/newrelic/node-newrelic/pull/4070)) ([c88d2b7](https://github.com/newrelic/node-newrelic/commit/c88d2b7da7d723fa63b85d7bd802a7601717155f))
|
|
6
|
+
|
|
7
|
+
#### Documentation
|
|
8
|
+
|
|
9
|
+
* Updated compatibility report ([#4067](https://github.com/newrelic/node-newrelic/pull/4067)) ([0ae24b8](https://github.com/newrelic/node-newrelic/commit/0ae24b865d61b0035cffdafbcfc6543cd7dce27d))
|
|
10
|
+
|
|
11
|
+
### v14.1.1 (2026-06-23)
|
|
12
|
+
|
|
13
|
+
#### Documentation
|
|
14
|
+
|
|
15
|
+
* Removed outdated Next.js documentation in repo ([#4060](https://github.com/newrelic/node-newrelic/pull/4060)) ([185bb66](https://github.com/newrelic/node-newrelic/commit/185bb66c6b8c8ddc26c934adccc28bf47e9ddfd9))
|
|
16
|
+
* Updated compatibility report ([#4047](https://github.com/newrelic/node-newrelic/pull/4047)) ([25cbd38](https://github.com/newrelic/node-newrelic/commit/25cbd38f8da143c7c0010634b0282f2409cc0631))
|
|
17
|
+
|
|
18
|
+
#### Miscellaneous chores
|
|
19
|
+
|
|
20
|
+
* Added proxy config support to OTEL metrics ([#4041](https://github.com/newrelic/node-newrelic/pull/4041)) ([6c04b8a](https://github.com/newrelic/node-newrelic/commit/6c04b8ab780006ff3e15406a56e9efafa79b1509))
|
|
21
|
+
* Added supportability metrics to OTEL metrics export ([#4051](https://github.com/newrelic/node-newrelic/pull/4051)) ([db6e4e3](https://github.com/newrelic/node-newrelic/commit/db6e4e364e61deb5da33a25d9ce13fb950c01162))
|
|
22
|
+
* Updated min version of `@opentelemetry` `0.x` packages to `^0.219.0` ([#4065](https://github.com/newrelic/node-newrelic/pull/4065)) ([3f58ad0](https://github.com/newrelic/node-newrelic/commit/3f58ad010592fe9909a210f7688bce6f4e72c188))
|
|
23
|
+
|
|
24
|
+
|
|
1
25
|
### v14.1.0 (2026-06-02)
|
|
2
26
|
|
|
3
27
|
#### Features
|
package/README.md
CHANGED
|
@@ -62,34 +62,9 @@ To use New Relic's Node.js agent entails these three steps, which are described
|
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
## Next.js instrumentation
|
|
65
|
-
|
|
65
|
+
We recommend using the hybrid agent functionality to setup Next.js. Please read our [Next.js instrumentation with hybrid agent](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/extend-your-instrumentation/nextjs-instrumentation) document for more information. The following example applications show how to load the `newrelic` hybrid agent instrumentation, inject browser agent, and deploying to Vercel:
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Here are documents for more in-depth explanations about [transaction naming](./documentation/nextjs/transactions.md), and [segments/spans](./documentation/nextjs/segments-and-spans.md).
|
|
70
|
-
|
|
71
|
-
### Setup
|
|
72
|
-
Typically you are running a Next.js app with the `next` cli and you must load the agent via `NODE_OPTIONS`:
|
|
73
|
-
|
|
74
|
-
```sh
|
|
75
|
-
NODE_OPTIONS='-r newrelic' next start
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
If you are having trouble getting the `newrelic` package to instrument Next.js, take a look at our [FAQs](./documentation/nextjs/faqs/README.md).
|
|
79
|
-
|
|
80
|
-
### Next.js example projects
|
|
81
|
-
The following example applications show how to load the `newrelic` instrumentation, inject browser agent, and handle errors:
|
|
82
|
-
|
|
83
|
-
* [Pages Router example](https://github.com/newrelic/newrelic-node-examples/tree/9415503f3bd78fa5d87a7214596d51c946199474/nextjs/nextjs-legacy)
|
|
84
|
-
* [App Router example](https://github.com/newrelic/newrelic-node-examples/tree/9415503f3bd78fa5d87a7214596d51c946199474/nextjs/nextjs-app-router)
|
|
85
|
-
|
|
86
|
-
### Custom Next.js servers
|
|
87
|
-
|
|
88
|
-
If you are using next as a [custom server](https://nextjs.org/docs/advanced-features/custom-server), you're probably not running your application with the `next` CLI. In that scenario we recommend running the Next.js instrumentation as follows.
|
|
89
|
-
|
|
90
|
-
```sh
|
|
91
|
-
node -r newrelic your-program.js
|
|
92
|
-
```
|
|
67
|
+
* [App Router example](https://github.com/newrelic/newrelic-node-examples/tree/9fa74c516926014fa33758cbd6e3737334ed4f98/nextjs/nextjs-app-router)
|
|
93
68
|
|
|
94
69
|
## ECMAScript Modules
|
|
95
70
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -92,7 +92,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
92
92
|
|
|
93
93
|
### @apm-js-collab/tracing-hooks
|
|
94
94
|
|
|
95
|
-
This product includes source derived from [@apm-js-collab/tracing-hooks](https://github.com/apm-js-collab/tracing-hooks) ([v0.9.
|
|
95
|
+
This product includes source derived from [@apm-js-collab/tracing-hooks](https://github.com/apm-js-collab/tracing-hooks) ([v0.9.1](https://github.com/apm-js-collab/tracing-hooks/tree/v0.9.1)), distributed under the [Apache-2.0 License](https://github.com/apm-js-collab/tracing-hooks/blob/v0.9.1/LICENSE):
|
|
96
96
|
|
|
97
97
|
```
|
|
98
98
|
|
|
@@ -766,7 +766,7 @@ This license terminates when the Software stops being provided by New Relic or w
|
|
|
766
766
|
|
|
767
767
|
### @opentelemetry/api-logs
|
|
768
768
|
|
|
769
|
-
This product includes source derived from [@opentelemetry/api-logs](https://github.com/open-telemetry/opentelemetry-js) ([v0.
|
|
769
|
+
This product includes source derived from [@opentelemetry/api-logs](https://github.com/open-telemetry/opentelemetry-js) ([v0.219.0](https://github.com/open-telemetry/opentelemetry-js/tree/v0.219.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v0.219.0/LICENSE):
|
|
770
770
|
|
|
771
771
|
```
|
|
772
772
|
Apache License
|
|
@@ -1184,7 +1184,7 @@ This product includes source derived from [@opentelemetry/api](https://github.co
|
|
|
1184
1184
|
|
|
1185
1185
|
### @opentelemetry/core
|
|
1186
1186
|
|
|
1187
|
-
This product includes source derived from [@opentelemetry/core](https://github.com/open-telemetry/opentelemetry-js) ([v2.
|
|
1187
|
+
This product includes source derived from [@opentelemetry/core](https://github.com/open-telemetry/opentelemetry-js) ([v2.8.0](https://github.com/open-telemetry/opentelemetry-js/tree/v2.8.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v2.8.0/LICENSE):
|
|
1188
1188
|
|
|
1189
1189
|
```
|
|
1190
1190
|
Apache License
|
|
@@ -1393,7 +1393,7 @@ This product includes source derived from [@opentelemetry/core](https://github.c
|
|
|
1393
1393
|
|
|
1394
1394
|
### @opentelemetry/exporter-metrics-otlp-http
|
|
1395
1395
|
|
|
1396
|
-
This product includes source derived from [@opentelemetry/exporter-metrics-otlp-http](https://github.com/open-telemetry/opentelemetry-js) ([v0.
|
|
1396
|
+
This product includes source derived from [@opentelemetry/exporter-metrics-otlp-http](https://github.com/open-telemetry/opentelemetry-js) ([v0.219.0](https://github.com/open-telemetry/opentelemetry-js/tree/v0.219.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v0.219.0/LICENSE):
|
|
1397
1397
|
|
|
1398
1398
|
```
|
|
1399
1399
|
Apache License
|
|
@@ -1602,7 +1602,7 @@ This product includes source derived from [@opentelemetry/exporter-metrics-otlp-
|
|
|
1602
1602
|
|
|
1603
1603
|
### @opentelemetry/otlp-exporter-base
|
|
1604
1604
|
|
|
1605
|
-
This product includes source derived from [@opentelemetry/otlp-exporter-base](https://github.com/open-telemetry/opentelemetry-js) ([v0.
|
|
1605
|
+
This product includes source derived from [@opentelemetry/otlp-exporter-base](https://github.com/open-telemetry/opentelemetry-js) ([v0.219.0](https://github.com/open-telemetry/opentelemetry-js/tree/v0.219.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v0.219.0/LICENSE):
|
|
1606
1606
|
|
|
1607
1607
|
```
|
|
1608
1608
|
Apache License
|
|
@@ -1811,7 +1811,7 @@ This product includes source derived from [@opentelemetry/otlp-exporter-base](ht
|
|
|
1811
1811
|
|
|
1812
1812
|
### @opentelemetry/otlp-transformer
|
|
1813
1813
|
|
|
1814
|
-
This product includes source derived from [@opentelemetry/otlp-transformer](https://github.com/open-telemetry/opentelemetry-js) ([v0.
|
|
1814
|
+
This product includes source derived from [@opentelemetry/otlp-transformer](https://github.com/open-telemetry/opentelemetry-js) ([v0.219.0](https://github.com/open-telemetry/opentelemetry-js/tree/v0.219.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v0.219.0/LICENSE):
|
|
1815
1815
|
|
|
1816
1816
|
```
|
|
1817
1817
|
Apache License
|
|
@@ -2020,7 +2020,7 @@ This product includes source derived from [@opentelemetry/otlp-transformer](http
|
|
|
2020
2020
|
|
|
2021
2021
|
### @opentelemetry/resources
|
|
2022
2022
|
|
|
2023
|
-
This product includes source derived from [@opentelemetry/resources](https://github.com/open-telemetry/opentelemetry-js) ([v2.
|
|
2023
|
+
This product includes source derived from [@opentelemetry/resources](https://github.com/open-telemetry/opentelemetry-js) ([v2.8.0](https://github.com/open-telemetry/opentelemetry-js/tree/v2.8.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v2.8.0/LICENSE):
|
|
2024
2024
|
|
|
2025
2025
|
```
|
|
2026
2026
|
Apache License
|
|
@@ -2229,7 +2229,7 @@ This product includes source derived from [@opentelemetry/resources](https://git
|
|
|
2229
2229
|
|
|
2230
2230
|
### @opentelemetry/sdk-logs
|
|
2231
2231
|
|
|
2232
|
-
This product includes source derived from [@opentelemetry/sdk-logs](https://github.com/open-telemetry/opentelemetry-js) ([v0.
|
|
2232
|
+
This product includes source derived from [@opentelemetry/sdk-logs](https://github.com/open-telemetry/opentelemetry-js) ([v0.219.0](https://github.com/open-telemetry/opentelemetry-js/tree/v0.219.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v0.219.0/LICENSE):
|
|
2233
2233
|
|
|
2234
2234
|
```
|
|
2235
2235
|
Apache License
|
|
@@ -2438,7 +2438,7 @@ This product includes source derived from [@opentelemetry/sdk-logs](https://gith
|
|
|
2438
2438
|
|
|
2439
2439
|
### @opentelemetry/sdk-metrics
|
|
2440
2440
|
|
|
2441
|
-
This product includes source derived from [@opentelemetry/sdk-metrics](https://github.com/open-telemetry/opentelemetry-js) ([v2.
|
|
2441
|
+
This product includes source derived from [@opentelemetry/sdk-metrics](https://github.com/open-telemetry/opentelemetry-js) ([v2.8.0](https://github.com/open-telemetry/opentelemetry-js/tree/v2.8.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v2.8.0/LICENSE):
|
|
2442
2442
|
|
|
2443
2443
|
```
|
|
2444
2444
|
Apache License
|
|
@@ -2647,7 +2647,7 @@ This product includes source derived from [@opentelemetry/sdk-metrics](https://g
|
|
|
2647
2647
|
|
|
2648
2648
|
### @opentelemetry/sdk-trace-base
|
|
2649
2649
|
|
|
2650
|
-
This product includes source derived from [@opentelemetry/sdk-trace-base](https://github.com/open-telemetry/opentelemetry-js) ([v2.
|
|
2650
|
+
This product includes source derived from [@opentelemetry/sdk-trace-base](https://github.com/open-telemetry/opentelemetry-js) ([v2.8.0](https://github.com/open-telemetry/opentelemetry-js/tree/v2.8.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v2.8.0/LICENSE):
|
|
2651
2651
|
|
|
2652
2652
|
```
|
|
2653
2653
|
Apache License
|
|
@@ -2916,7 +2916,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
2916
2916
|
|
|
2917
2917
|
### https-proxy-agent
|
|
2918
2918
|
|
|
2919
|
-
This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) ([v9.
|
|
2919
|
+
This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) ([v9.1.0](https://github.com/TooTallNate/proxy-agents/tree/v9.1.0)), distributed under the [MIT License](https://github.com/TooTallNate/proxy-agents/blob/v9.1.0/LICENSE):
|
|
2920
2920
|
|
|
2921
2921
|
```
|
|
2922
2922
|
(The MIT License)
|
|
@@ -2945,7 +2945,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
2945
2945
|
|
|
2946
2946
|
### import-in-the-middle
|
|
2947
2947
|
|
|
2948
|
-
This product includes source derived from [import-in-the-middle](https://github.com/nodejs/import-in-the-middle) ([v3.0
|
|
2948
|
+
This product includes source derived from [import-in-the-middle](https://github.com/nodejs/import-in-the-middle) ([v3.1.0](https://github.com/nodejs/import-in-the-middle/tree/v3.1.0)), distributed under the [Apache-2.0 License](https://github.com/nodejs/import-in-the-middle/blob/v3.1.0/LICENSE):
|
|
2949
2949
|
|
|
2950
2950
|
```
|
|
2951
2951
|
Apache License
|
|
@@ -3265,7 +3265,7 @@ SOFTWARE.
|
|
|
3265
3265
|
|
|
3266
3266
|
### semver
|
|
3267
3267
|
|
|
3268
|
-
This product includes source derived from [semver](https://github.com/npm/node-semver) ([v7.8.
|
|
3268
|
+
This product includes source derived from [semver](https://github.com/npm/node-semver) ([v7.8.5](https://github.com/npm/node-semver/tree/v7.8.5)), distributed under the [ISC License](https://github.com/npm/node-semver/blob/v7.8.5/LICENSE):
|
|
3269
3269
|
|
|
3270
3270
|
```
|
|
3271
3271
|
The ISC License
|
|
@@ -3321,7 +3321,7 @@ SOFTWARE.
|
|
|
3321
3321
|
|
|
3322
3322
|
### @aws-sdk/client-s3
|
|
3323
3323
|
|
|
3324
|
-
This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.
|
|
3324
|
+
This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.1073.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.1073.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.1073.0/LICENSE):
|
|
3325
3325
|
|
|
3326
3326
|
```
|
|
3327
3327
|
Apache License
|
|
@@ -3530,7 +3530,7 @@ This product includes source derived from [@aws-sdk/client-s3](https://github.co
|
|
|
3530
3530
|
|
|
3531
3531
|
### @aws-sdk/s3-request-presigner
|
|
3532
3532
|
|
|
3533
|
-
This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.
|
|
3533
|
+
This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.1073.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.1073.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.1073.0/LICENSE):
|
|
3534
3534
|
|
|
3535
3535
|
```
|
|
3536
3536
|
Apache License
|
|
@@ -4215,7 +4215,7 @@ THE SOFTWARE.
|
|
|
4215
4215
|
|
|
4216
4216
|
### @opentelemetry/exporter-metrics-otlp-proto
|
|
4217
4217
|
|
|
4218
|
-
This product includes source derived from [@opentelemetry/exporter-metrics-otlp-proto](https://github.com/open-telemetry/opentelemetry-js) ([v0.
|
|
4218
|
+
This product includes source derived from [@opentelemetry/exporter-metrics-otlp-proto](https://github.com/open-telemetry/opentelemetry-js) ([v0.219.0](https://github.com/open-telemetry/opentelemetry-js/tree/v0.219.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v0.219.0/LICENSE):
|
|
4219
4219
|
|
|
4220
4220
|
```
|
|
4221
4221
|
Apache License
|
|
@@ -4454,7 +4454,7 @@ SOFTWARE.
|
|
|
4454
4454
|
|
|
4455
4455
|
### @smithy/eventstream-codec
|
|
4456
4456
|
|
|
4457
|
-
This product includes source derived from [@smithy/eventstream-codec](https://github.com/smithy-lang/smithy-typescript) ([v4.
|
|
4457
|
+
This product includes source derived from [@smithy/eventstream-codec](https://github.com/smithy-lang/smithy-typescript) ([v4.4.1](https://github.com/smithy-lang/smithy-typescript/tree/v4.4.1)), distributed under the [Apache-2.0 License](https://github.com/smithy-lang/smithy-typescript/blob/v4.4.1/LICENSE):
|
|
4458
4458
|
|
|
4459
4459
|
```
|
|
4460
4460
|
Apache License
|
|
@@ -4663,7 +4663,7 @@ This product includes source derived from [@smithy/eventstream-codec](https://gi
|
|
|
4663
4663
|
|
|
4664
4664
|
### @smithy/util-utf8
|
|
4665
4665
|
|
|
4666
|
-
This product includes source derived from [@smithy/util-utf8](https://github.com/smithy-lang/smithy-typescript) ([v4.
|
|
4666
|
+
This product includes source derived from [@smithy/util-utf8](https://github.com/smithy-lang/smithy-typescript) ([v4.4.1](https://github.com/smithy-lang/smithy-typescript/tree/v4.4.1)), distributed under the [Apache-2.0 License](https://github.com/smithy-lang/smithy-typescript/blob/v4.4.1/LICENSE):
|
|
4667
4667
|
|
|
4668
4668
|
```
|
|
4669
4669
|
Apache License
|
|
@@ -4922,7 +4922,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
4922
4922
|
|
|
4923
4923
|
### clean-jsdoc-theme
|
|
4924
4924
|
|
|
4925
|
-
This product includes source derived from [clean-jsdoc-theme](https://github.com/ankitskvmdam/clean-jsdoc-theme) ([v4.3.
|
|
4925
|
+
This product includes source derived from [clean-jsdoc-theme](https://github.com/ankitskvmdam/clean-jsdoc-theme) ([v4.3.3](https://github.com/ankitskvmdam/clean-jsdoc-theme/tree/v4.3.3)), distributed under the [MIT License](https://github.com/ankitskvmdam/clean-jsdoc-theme/blob/v4.3.3/LICENSE):
|
|
4926
4926
|
|
|
4927
4927
|
```
|
|
4928
4928
|
MIT License
|
|
@@ -5615,7 +5615,7 @@ SOFTWARE.
|
|
|
5615
5615
|
|
|
5616
5616
|
### protobufjs
|
|
5617
5617
|
|
|
5618
|
-
This product includes source derived from [protobufjs](https://github.com/protobufjs/protobuf.js) ([v8.4
|
|
5618
|
+
This product includes source derived from [protobufjs](https://github.com/protobufjs/protobuf.js) ([v8.6.4](https://github.com/protobufjs/protobuf.js/tree/v8.6.4)), distributed under the [BSD-3-Clause License](https://github.com/protobufjs/protobuf.js/blob/v8.6.4/LICENSE):
|
|
5619
5619
|
|
|
5620
5620
|
```
|
|
5621
5621
|
This license applies to all parts of protobuf.js except those files
|
|
@@ -5792,7 +5792,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
5792
5792
|
|
|
5793
5793
|
### @datadog/pprof
|
|
5794
5794
|
|
|
5795
|
-
This product includes source derived from [@datadog/pprof](https://github.com/DataDog/pprof-nodejs) ([v5.
|
|
5795
|
+
This product includes source derived from [@datadog/pprof](https://github.com/DataDog/pprof-nodejs) ([v5.15.0](https://github.com/DataDog/pprof-nodejs/tree/v5.15.0)), distributed under the [Apache-2.0 License](https://github.com/DataDog/pprof-nodejs/blob/v5.15.0/LICENSE):
|
|
5796
5796
|
|
|
5797
5797
|
```
|
|
5798
5798
|
|
|
@@ -18,7 +18,9 @@ let agentProxyWithKeepAlive = null
|
|
|
18
18
|
/**
|
|
19
19
|
* Returns an HTTP agent with keep-alive enabled
|
|
20
20
|
*
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {AgentConfig} config configuration for HTTP agent
|
|
22
|
+
*
|
|
23
|
+
* @returns {object} `https.Agent` instance.
|
|
22
24
|
*/
|
|
23
25
|
exports.keepAliveAgent = function keepAliveAgent(config) {
|
|
24
26
|
config = config ? config : {}
|
|
@@ -40,17 +42,19 @@ exports.keepAliveAgent = function keepAliveAgent(config) {
|
|
|
40
42
|
* NPM package with configuration suitable for working via
|
|
41
43
|
* the configured newrelic-agent's proxy configuration.
|
|
42
44
|
*
|
|
43
|
-
* Include keep-alive configuration, but ultimately
|
|
45
|
+
* Include keep-alive configuration, but ultimately it's up
|
|
44
46
|
* to the proxy server as to how its connection is made
|
|
45
47
|
* with New Relic's servers.
|
|
46
48
|
*
|
|
47
|
-
* @param {
|
|
49
|
+
* @param {AgentConfig} config configuration for proxy agent
|
|
50
|
+
*
|
|
51
|
+
* @returns {object} `https.Agent` instance.
|
|
48
52
|
*/
|
|
49
53
|
exports.proxyAgent = function proxyAgent(config) {
|
|
50
54
|
if (agentProxyWithKeepAlive !== null) {
|
|
51
55
|
return agentProxyWithKeepAlive
|
|
52
56
|
}
|
|
53
|
-
const proxyUrl =
|
|
57
|
+
const proxyUrl = buildProxyUrl(config)
|
|
54
58
|
|
|
55
59
|
// Tests may supply 127.0.0.1 as the host, but SNI requires a hostname.
|
|
56
60
|
const servername = config.host
|
|
@@ -61,6 +65,9 @@ exports.proxyAgent = function proxyAgent(config) {
|
|
|
61
65
|
keepAlive: true,
|
|
62
66
|
servername
|
|
63
67
|
}
|
|
68
|
+
if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0') {
|
|
69
|
+
proxyOpts.rejectUnauthorized = false
|
|
70
|
+
}
|
|
64
71
|
|
|
65
72
|
logger.info(`using proxy: ${proxyUrl}`)
|
|
66
73
|
// lazy-load `https-proxy-agent` as it is ESM
|
|
@@ -71,7 +78,16 @@ exports.proxyAgent = function proxyAgent(config) {
|
|
|
71
78
|
return agentProxyWithKeepAlive
|
|
72
79
|
}
|
|
73
80
|
|
|
74
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Reads the proxy configuration options from an agent configuration
|
|
83
|
+
* instance and returns an appropriate URL to the configured proxy.
|
|
84
|
+
*
|
|
85
|
+
* @param {AgentConfig} config The agent configuration instance to get
|
|
86
|
+
* proxy information from.
|
|
87
|
+
*
|
|
88
|
+
* @returns {string} Proxy URL.
|
|
89
|
+
*/
|
|
90
|
+
function buildProxyUrl(config) {
|
|
75
91
|
let proxyUrl
|
|
76
92
|
if (config.proxy) {
|
|
77
93
|
proxyUrl = config.proxy
|
|
@@ -88,3 +104,15 @@ function proxyOptions(config) {
|
|
|
88
104
|
|
|
89
105
|
return proxyUrl
|
|
90
106
|
}
|
|
107
|
+
exports.buildProxyUrl = buildProxyUrl
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Indicates if the agent has been configured with proxy configuration or not.
|
|
111
|
+
*
|
|
112
|
+
* @param {AgentConfig} config The agent configuration.
|
|
113
|
+
*
|
|
114
|
+
* @returns {boolean} The result of the inspection.
|
|
115
|
+
*/
|
|
116
|
+
exports.proxySettingsPresent = function proxySettingsPresent(config) {
|
|
117
|
+
return config.proxy !== '' || config.proxy_host !== ''
|
|
118
|
+
}
|
package/lib/config/index.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 New Relic Corporation. All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use strict'
|
|
7
|
+
|
|
8
|
+
const defaultLogger = require('../../logger').child({
|
|
9
|
+
component: 'opentelemetry-metrics-proxy-factory'
|
|
10
|
+
})
|
|
11
|
+
const { proxyAgent } = require('#agentlib/collector/http-agents.js')
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Builds a factory function compliant with OTEL's requirements for supplying
|
|
15
|
+
* an `http.Agent` instance.
|
|
16
|
+
*
|
|
17
|
+
* @param {object} params Function parameters.
|
|
18
|
+
* @param {AgentConfig} params.agentConfig Agent configuration instance.
|
|
19
|
+
* @param {object} params.logger Agent logger instance.
|
|
20
|
+
*
|
|
21
|
+
* @returns {Function} Factory function for OTEL.
|
|
22
|
+
*/
|
|
23
|
+
module.exports = function generateProxyAgentFactory({
|
|
24
|
+
agentConfig,
|
|
25
|
+
logger = defaultLogger
|
|
26
|
+
}) {
|
|
27
|
+
return function httpAgentFactory() {
|
|
28
|
+
logger.trace('returning https proxy agent')
|
|
29
|
+
return proxyAgent(agentConfig)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -12,11 +12,13 @@ const {
|
|
|
12
12
|
MeterProvider,
|
|
13
13
|
PeriodicExportingMetricReader
|
|
14
14
|
} = require('@opentelemetry/sdk-metrics')
|
|
15
|
-
const NROTLPMetricExporter = require('./nr-exporter.js')
|
|
16
15
|
|
|
16
|
+
const { proxySettingsPresent } = require('#agentlib/collector/http-agents.js')
|
|
17
17
|
const defaultLogger = require('../../logger').child({ component: 'opentelemetry-metrics' })
|
|
18
|
+
const NROTLPMetricExporter = require('./nr-exporter.js')
|
|
18
19
|
const SetupSignal = require('../setup-signal.js')
|
|
19
20
|
const ProxyingExporter = require('./proxying-exporter.js')
|
|
21
|
+
const generateProxyAgentFactory = require('./generate-proxy-agent-factory.js')
|
|
20
22
|
|
|
21
23
|
class SetupMetrics extends SetupSignal {
|
|
22
24
|
constructor({ agent, logger = defaultLogger } = {}) {
|
|
@@ -96,13 +98,21 @@ class SetupMetrics extends SetupSignal {
|
|
|
96
98
|
agent.removeListener('started', postReady)
|
|
97
99
|
|
|
98
100
|
reader.collect().then(({ resourceMetrics: collectedMetrics }) => {
|
|
101
|
+
const exporterConfig = {
|
|
102
|
+
url: `https://${config.host}:${config.port}/v1/metrics`,
|
|
103
|
+
headers: { 'api-key': config.license_key },
|
|
104
|
+
temporalityPreference: AggregationTemporality.DELTA
|
|
105
|
+
}
|
|
106
|
+
if (proxySettingsPresent(agent.config) === true) {
|
|
107
|
+
exporterConfig.httpAgentOptions = generateProxyAgentFactory({
|
|
108
|
+
agentConfig: agent.config,
|
|
109
|
+
logger
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
|
|
99
113
|
proxyExporter.exporter = new NROTLPMetricExporter(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
headers: { 'api-key': config.license_key },
|
|
103
|
-
temporalityPreference: AggregationTemporality.DELTA
|
|
104
|
-
},
|
|
105
|
-
logger
|
|
114
|
+
exporterConfig,
|
|
115
|
+
{ agent, logger }
|
|
106
116
|
)
|
|
107
117
|
|
|
108
118
|
const resource = resourceFromAttributes({ 'entity.guid': config.entity_guid })
|
|
@@ -23,7 +23,15 @@ const NRProxyingSerializer = require('./nr-proxying-serializer.js')
|
|
|
23
23
|
* the internal objects so that we can write audit logs.
|
|
24
24
|
*/
|
|
25
25
|
class NROTLPMetricExporter extends OTLPMetricExporterBase {
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @param {object} config Standard OTEL exporter configuration object. You
|
|
28
|
+
* have to dig through the OTEL source code to figure out what all it
|
|
29
|
+
* supports.
|
|
30
|
+
* @param {object} deps Local dependency injections.
|
|
31
|
+
* @param {object} deps.agent Current agent instance.
|
|
32
|
+
* @param {AgentLogger} deps.logger Agent logger instance.
|
|
33
|
+
*/
|
|
34
|
+
constructor(config = {}, { agent, logger = defaultLogger } = {}) {
|
|
27
35
|
const convertedOptions = convertLegacyHttpOptions(
|
|
28
36
|
config,
|
|
29
37
|
'METRICS',
|
|
@@ -35,7 +43,7 @@ class NROTLPMetricExporter extends OTLPMetricExporterBase {
|
|
|
35
43
|
convertedOptions,
|
|
36
44
|
new NRProxyingSerializer({ destinationUrl: config.url, logger })
|
|
37
45
|
)
|
|
38
|
-
const proxyingDelegate = new NRProxyingDelegate(delegate, logger)
|
|
46
|
+
const proxyingDelegate = new NRProxyingDelegate(delegate, { agent, logger })
|
|
39
47
|
|
|
40
48
|
super(proxyingDelegate, config)
|
|
41
49
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
'use strict'
|
|
7
7
|
|
|
8
|
+
const { ExportResultCode } = require('@opentelemetry/core')
|
|
8
9
|
const defaultLogger = require('#agentlib/logger.js').child({
|
|
9
10
|
component: 'nr-proxying-delegate'
|
|
10
11
|
})
|
|
@@ -15,17 +16,43 @@ const defaultLogger = require('#agentlib/logger.js').child({
|
|
|
15
16
|
* can write an audit log when the export has completed.
|
|
16
17
|
*/
|
|
17
18
|
class NRProxyingDelegate {
|
|
19
|
+
#agent
|
|
18
20
|
#logger
|
|
19
21
|
#wrappedDelegate
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
/**
|
|
24
|
+
* @param {object} delegateToProxy OTEL delegate instance that does the
|
|
25
|
+
* actual data exporting work.
|
|
26
|
+
* @param {object} deps Local dependency injections.
|
|
27
|
+
* @param {object} deps.agent Current agent instance.
|
|
28
|
+
* @param {AgentLogger} deps.logger Agent logger instance.
|
|
29
|
+
*/
|
|
30
|
+
constructor(delegateToProxy, { agent, logger = defaultLogger } = {}) {
|
|
22
31
|
this.#wrappedDelegate = delegateToProxy
|
|
32
|
+
this.#agent = agent
|
|
23
33
|
this.#logger = logger.child({ subcomponent: this.constructor.name })
|
|
24
34
|
}
|
|
25
35
|
|
|
26
36
|
export(items, resultCallback) {
|
|
27
37
|
this.#wrappedDelegate.export(items, (result) => {
|
|
28
38
|
this.#logger.audit('Received metrics export result code: %s', result.code)
|
|
39
|
+
|
|
40
|
+
switch (result.code) {
|
|
41
|
+
case ExportResultCode.SUCCESS: {
|
|
42
|
+
this.#agent.metrics
|
|
43
|
+
.getOrCreateMetric('Supportability/Metrics/Nodejs/OpenTelemetryBridge/export/success')
|
|
44
|
+
.incrementCallCount()
|
|
45
|
+
break
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
case ExportResultCode.FAILED: {
|
|
49
|
+
this.#agent.metrics
|
|
50
|
+
.getOrCreateMetric('Supportability/Metrics/Nodejs/OpenTelemetryBridge/export/failure')
|
|
51
|
+
.incrementCallCount()
|
|
52
|
+
break
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
29
56
|
resultCallback(result)
|
|
30
57
|
})
|
|
31
58
|
}
|
|
@@ -42,9 +42,22 @@ module.exports = class AzureHandler {
|
|
|
42
42
|
const newCtx = this.createTransaction({ handlerArgs, ctx })
|
|
43
43
|
const transaction = newCtx?.transaction
|
|
44
44
|
this.addFaasAttributes(transaction, context)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
|
|
46
|
+
// We need to wrap up all of our operations into a function that we
|
|
47
|
+
// can execute within the same context. If we only run the original handler
|
|
48
|
+
// in the context, then when we try to finalize the transaction we will
|
|
49
|
+
// not have access to the segment.
|
|
50
|
+
const wrappedHandler = async (...args) => {
|
|
51
|
+
const result = await originalHandler.apply(thisArg, args)
|
|
52
|
+
this.handleColdStart(transaction)
|
|
53
|
+
return this.finalizeTransaction({ result, transaction })
|
|
54
|
+
}
|
|
55
|
+
return await this.runHandlerInContext({
|
|
56
|
+
originalHandler: wrappedHandler,
|
|
57
|
+
ctx: newCtx,
|
|
58
|
+
thisArg,
|
|
59
|
+
handlerArgs
|
|
60
|
+
})
|
|
48
61
|
}
|
|
49
62
|
|
|
50
63
|
runHandlerInContext({ originalHandler, ctx, thisArg, handlerArgs }) {
|
package/lib/util/logger.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newrelic",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.2",
|
|
4
4
|
"author": "New Relic Node.js agent team <nodejs@newrelic.com>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"contributors": [
|
|
@@ -202,13 +202,13 @@
|
|
|
202
202
|
"@grpc/proto-loader": "^0.8.1",
|
|
203
203
|
"@newrelic/security-agent": "^3.0.0",
|
|
204
204
|
"@opentelemetry/api": "^1.9.0",
|
|
205
|
-
"@opentelemetry/api-logs": "^0.
|
|
205
|
+
"@opentelemetry/api-logs": "^0.219.0",
|
|
206
206
|
"@opentelemetry/core": "^2.0.0",
|
|
207
|
-
"@opentelemetry/exporter-metrics-otlp-http": "^0.
|
|
208
|
-
"@opentelemetry/otlp-exporter-base": "^0.
|
|
209
|
-
"@opentelemetry/otlp-transformer": "^0.
|
|
207
|
+
"@opentelemetry/exporter-metrics-otlp-http": "^0.219.0",
|
|
208
|
+
"@opentelemetry/otlp-exporter-base": "^0.219.0",
|
|
209
|
+
"@opentelemetry/otlp-transformer": "^0.219.0",
|
|
210
210
|
"@opentelemetry/resources": "^2.0.1",
|
|
211
|
-
"@opentelemetry/sdk-logs": "^0.
|
|
211
|
+
"@opentelemetry/sdk-logs": "^0.219.0",
|
|
212
212
|
"@opentelemetry/sdk-metrics": "^2.0.1",
|
|
213
213
|
"@opentelemetry/sdk-trace-base": "^2.0.0",
|
|
214
214
|
"@tyriar/fibonacci-heap": "^2.0.7",
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
"@newrelic/eslint-config": "^0.7.0",
|
|
236
236
|
"@newrelic/newrelic-oss-cli": "^0.1.2",
|
|
237
237
|
"@octokit/rest": "^18.0.15",
|
|
238
|
-
"@opentelemetry/exporter-metrics-otlp-proto": "^0.
|
|
238
|
+
"@opentelemetry/exporter-metrics-otlp-proto": "^0.219.0",
|
|
239
239
|
"@slack/bolt": "^3.7.0",
|
|
240
240
|
"@smithy/eventstream-codec": "^4.3.3",
|
|
241
241
|
"@smithy/util-utf8": "^4.3.3",
|