newrelic 13.1.0 → 13.2.1

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.
Files changed (57) hide show
  1. package/NEWS.md +56 -0
  2. package/README.md +2 -4
  3. package/THIRD_PARTY_NOTICES.md +222 -11
  4. package/esm-loader.mjs +14 -1
  5. package/index.js +2 -2
  6. package/lib/agent.js +1 -2
  7. package/lib/config/build-instrumentation-config.js +3 -0
  8. package/lib/config/default.js +1397 -1395
  9. package/lib/config/index.js +15 -19
  10. package/lib/context-manager/context.js +13 -4
  11. package/lib/harvester.js +11 -13
  12. package/lib/instrumentation/@google/genai.js +8 -3
  13. package/lib/instrumentation/@hapi/hapi.js +4 -6
  14. package/lib/instrumentation/@nestjs/core.js +12 -14
  15. package/lib/instrumentation/aws-sdk/v3/bedrock.js +2 -2
  16. package/lib/instrumentation/kafkajs/producer.js +13 -19
  17. package/lib/instrumentation/openai.js +2 -2
  18. package/lib/instrumentation/undici.js +48 -40
  19. package/lib/instrumentations.js +14 -5
  20. package/lib/llm-events/aws-bedrock/utils.js +1 -1
  21. package/lib/metrics/names.js +8 -0
  22. package/lib/metrics/normalizer.js +1 -3
  23. package/lib/otel/context.js +18 -14
  24. package/lib/otel/metrics/bootstrap-metrics.js +1 -1
  25. package/lib/serverless/aws-lambda.js +1 -3
  26. package/lib/shim/webframework-shim/middleware-mounter.js +1 -3
  27. package/lib/shimmer.js +56 -8
  28. package/lib/subscriber-configs.js +17 -0
  29. package/lib/subscribers/application-logs.js +55 -0
  30. package/lib/subscribers/base.js +177 -0
  31. package/lib/subscribers/create-config.js +27 -0
  32. package/lib/subscribers/db-operation.js +21 -0
  33. package/lib/subscribers/db-query.js +54 -0
  34. package/lib/subscribers/db.js +57 -0
  35. package/lib/subscribers/elasticsearch/config.js +49 -0
  36. package/lib/subscribers/elasticsearch/elasticsearch.js +42 -0
  37. package/lib/subscribers/elasticsearch/opensearch.js +15 -0
  38. package/lib/subscribers/elasticsearch/transport.js +14 -0
  39. package/lib/subscribers/ioredis/config.js +37 -0
  40. package/lib/subscribers/ioredis/index.js +48 -0
  41. package/lib/subscribers/mcp-sdk/client-prompt.js +23 -0
  42. package/lib/subscribers/mcp-sdk/client-resource.js +24 -0
  43. package/lib/subscribers/mcp-sdk/client-tool.js +23 -0
  44. package/lib/subscribers/mcp-sdk/client.js +29 -0
  45. package/lib/subscribers/mcp-sdk/config.js +104 -0
  46. package/lib/subscribers/pino/config.js +20 -0
  47. package/lib/subscribers/pino/index.js +102 -0
  48. package/lib/transaction/trace/aggregator.js +7 -9
  49. package/lib/util/camel-case.js +1 -3
  50. package/lib/util/get-package-version.js +34 -0
  51. package/lib/w3c/tracestate.js +3 -3
  52. package/package.json +5 -4
  53. package/lib/instrumentation/@elastic/elasticsearch.js +0 -62
  54. package/lib/instrumentation/@opensearch-project/opensearch.js +0 -66
  55. package/lib/instrumentation/ioredis.js +0 -50
  56. package/lib/instrumentation/pino/nr-hooks.js +0 -19
  57. package/lib/instrumentation/pino/pino.js +0 -168
package/NEWS.md CHANGED
@@ -1,3 +1,57 @@
1
+ ### v13.2.1 (2025-08-21)
2
+
3
+ #### Code refactoring
4
+
5
+ * Updated agent to use `@apm-js-collab/tracing-hooks` for the CJS/ESM registration for tracing channel based instrumentation ([#3324](https://github.com/newrelic/node-newrelic/pull/3324)) ([4b2c14f](https://github.com/newrelic/node-newrelic/commit/4b2c14f35d5c658160ad9420ca562f73ae55bbc0))
6
+
7
+ #### Documentation
8
+
9
+ * Updated compatibility report ([#3330](https://github.com/newrelic/node-newrelic/pull/3330)) ([2831a89](https://github.com/newrelic/node-newrelic/commit/2831a895e0278a05bed8e9f81245c7f9ae515eca))
10
+
11
+ ### v13.2.0 (2025-08-20)
12
+
13
+ #### Features
14
+
15
+ * Added ability to register `Supportability/Features/Instrumentation/OnRequire/<pkg>` metrics for subscriber based instrumentation ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([87bfa40](https://github.com/newrelic/node-newrelic/commit/87bfa400c216352f12bbbc500e74f8e58285a275))
16
+ * Added esm loader hook and commonjs patch to work with orchestrion-js ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([415aeba](https://github.com/newrelic/node-newrelic/commit/415aeba6db04aa54cc1f44e64c0e6d2235d47108))
17
+ * Added instrumentation for `@modelcontextprotocol/sdk` client calls `client.callTool`, `client.readResource`, and `client.getPrompt` ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([5d9790b](https://github.com/newrelic/node-newrelic/commit/5d9790b4bd9ab24db4a38618ef96c3b50fbadae7))
18
+
19
+ #### Bug fixes
20
+
21
+ * Fixed logic around detecting OTEL packages ([#3326](https://github.com/newrelic/node-newrelic/pull/3326)) ([4df30e5](https://github.com/newrelic/node-newrelic/commit/4df30e5c2021e0d933e4a77ccd4409405928fa39))
22
+ * Updated `shimmer.setupSubscribers` to properly setup and skip subscribers that are disabled ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([cf5b3ec](https://github.com/newrelic/node-newrelic/commit/cf5b3ec39e2cad05c46ec7865f5b8b8377cb4710))
23
+
24
+ #### Code refactoring
25
+
26
+ * Added ability to disable subscribers via `config.instrumentation.<pkg-name>.enabled` ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([55f8fe7](https://github.com/newrelic/node-newrelic/commit/55f8fe7bc7035ab1822986eb51a228e266e3d3eb))
27
+ * Added ability to prevent creation of segments in subscriber based instrumentation when parent is marked as internal and of the same package ([#3322](https://github.com/newrelic/node-newrelic/pull/3322)) ([91f91c2](https://github.com/newrelic/node-newrelic/commit/91f91c2c85f2715bb1c1db5847704623fd65851e))
28
+ * Removed `id` parameter from `opensearch` class ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([8be00ce](https://github.com/newrelic/node-newrelic/commit/8be00cef67a2637f7d7a3ab33cccb6824ab34478))
29
+ * Updated `opensearch` instrumentation to subscribe to events emitted ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([9a27a5d](https://github.com/newrelic/node-newrelic/commit/9a27a5daba8a82c350cf129e3b2548527868ae90))
30
+ * Updated elasticsearch instrumentation to subscribe to events emitted ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([a3e2348](https://github.com/newrelic/node-newrelic/commit/a3e2348d9af62d12cb570c26f557096968d38daa))
31
+ * Updated ioredis instrumentation to subscribe to events emitted ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([90b97d2](https://github.com/newrelic/node-newrelic/commit/90b97d28a9bbf5c1646ce3ca399bb6772c17c07c))
32
+ * Updated pino instrumentation to subscribe to events emitted ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([28bbe9f](https://github.com/newrelic/node-newrelic/commit/28bbe9fee831d57d4fb77d01ef4cd2f6072bf9d8))
33
+ * Updated subscribers to have a common createSegment that creates, assigns attributes, starts segment ([#3317](https://github.com/newrelic/node-newrelic/pull/3317)) ([aa3f8d9](https://github.com/newrelic/node-newrelic/commit/aa3f8d936aa9fd7ffdad1f771dc16da8782ad917))
34
+ * Updated undici instrumentation to remove its reliance on shim. Also updated storing the relevant segments on context instead of symbols on the request object ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([ec17fa7](https://github.com/newrelic/node-newrelic/commit/ec17fa7ef431bf51c527d2c58cdf216fee641884))
35
+
36
+ #### Documentation
37
+
38
+ * Updated compatibility report ([#3313](https://github.com/newrelic/node-newrelic/pull/3313)) ([749ddc9](https://github.com/newrelic/node-newrelic/commit/749ddc9c050ee81f8969e8f173233dcb78826da1)) ([#3304](https://github.com/newrelic/node-newrelic/pull/3304)) ([cc000a7](https://github.com/newrelic/node-newrelic/commit/cc000a72870b508c929449b57a35d289ce093f42))
39
+
40
+ #### Miscellaneous chores
41
+
42
+ * change from ending segment to touching for feature parity with shim ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([4d39fc5](https://github.com/newrelic/node-newrelic/commit/4d39fc564a23798d42105398d0b8ea6c0e9280cc))
43
+ * Updated eslint configuration ([#3296](https://github.com/newrelic/node-newrelic/pull/3296)) ([5c168a6](https://github.com/newrelic/node-newrelic/commit/5c168a657cddece16c0b1124307526ffb3588953))
44
+
45
+ #### Tests
46
+
47
+ * Fixed obtaining opensearch package version for older versions we instrument ([#3314](https://github.com/newrelic/node-newrelic/pull/3314)) ([e45ab27](https://github.com/newrelic/node-newrelic/commit/e45ab275109dd601945776c0de88ba954a8c57e2))
48
+ * Removed unnecessary `prisma.$use` in tests to unpin ([#3303](https://github.com/newrelic/node-newrelic/pull/3303)) ([db20324](https://github.com/newrelic/node-newrelic/commit/db20324535ebf714237dc716c3f6718fd90cfb36))
49
+
50
+ #### Continuous integration
51
+
52
+ * Allow users to run benchmark tests even if not sending metrics ([#3307](https://github.com/newrelic/node-newrelic/pull/3307)) ([1be1514](https://github.com/newrelic/node-newrelic/commit/1be1514c9d49465a29e6b8fbc09c3bb5ebc1b112))
53
+ * Change benchmark tests to use `TEST_LICENSE` ([#3325](https://github.com/newrelic/node-newrelic/pull/3325)) ([1f7f733](https://github.com/newrelic/node-newrelic/commit/1f7f733b2d10a5447662e159038fa32f1c036235))
54
+
1
55
  ### v13.1.0 (2025-08-13)
2
56
 
3
57
  #### Features
@@ -7767,3 +7821,5 @@ Special thanks to Ryan Copley (@RyanCopley) for the contribution.
7767
7821
  * The agent reports transaction trace data.
7768
7822
 
7769
7823
  [mdn-async-function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
7824
+
7825
+
package/README.md CHANGED
@@ -105,14 +105,12 @@ The New Relic Node.js agent includes ***_experimental_*** support for ES Modules
105
105
  $ mv newrelic.js newrelic.cjs
106
106
  ```
107
107
 
108
- 2. To use the newrelic ESM loader, start your program with node and use the `--experimental-loader` flag and a path to the loader file, like this:
108
+ 2. To use the newrelic ESM loader, start your program with node and use the `--import` flag and a path to the loader file, like this:
109
109
 
110
110
  ```sh
111
- $ node --experimental-loader newrelic/esm-loader.mjs -r newrelic your-program.js
111
+ $ node --import newrelic/esm-loader.mjs -r newrelic your-program.js
112
112
  ```
113
113
 
114
- **Note**: Unlike the CommonJS methods listed above, there are no alternatives to running the agent without the `--experimental-loader` flag.
115
-
116
114
  ### Custom Instrumentation
117
115
 
118
116
  The agent supports adding your own custom instrumentation to ES module applications. You can use the instrumentation API methods. The only other difference between CommonJS custom instrumentation and ESM is you must provide a property of `isEsm: true`.
@@ -14,6 +14,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
14
14
 
15
15
  **[dependencies](#dependencies)**
16
16
 
17
+ * [@apm-js-collab/tracing-hooks](#apm-js-collabtracing-hooks)
17
18
  * [@grpc/grpc-js](#grpcgrpc-js)
18
19
  * [@grpc/proto-loader](#grpcproto-loader)
19
20
  * [@newrelic/security-agent](#newrelicsecurity-agent)
@@ -95,6 +96,216 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
95
96
 
96
97
  ## dependencies
97
98
 
99
+ ### @apm-js-collab/tracing-hooks
100
+
101
+ This product includes source derived from [@apm-js-collab/tracing-hooks](https://github.com/apm-js-collab/tracing-hooks) ([v0.1.1](https://github.com/apm-js-collab/tracing-hooks/tree/v0.1.1)), distributed under the [Apache-2.0 License](https://github.com/apm-js-collab/tracing-hooks/blob/v0.1.1/LICENSE):
102
+
103
+ ```
104
+
105
+ Apache License
106
+ Version 2.0, January 2004
107
+ http://www.apache.org/licenses/
108
+
109
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
110
+
111
+ 1. Definitions.
112
+
113
+ "License" shall mean the terms and conditions for use, reproduction,
114
+ and distribution as defined by Sections 1 through 9 of this document.
115
+
116
+ "Licensor" shall mean the copyright owner or entity authorized by
117
+ the copyright owner that is granting the License.
118
+
119
+ "Legal Entity" shall mean the union of the acting entity and all
120
+ other entities that control, are controlled by, or are under common
121
+ control with that entity. For the purposes of this definition,
122
+ "control" means (i) the power, direct or indirect, to cause the
123
+ direction or management of such entity, whether by contract or
124
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
125
+ outstanding shares, or (iii) beneficial ownership of such entity.
126
+
127
+ "You" (or "Your") shall mean an individual or Legal Entity
128
+ exercising permissions granted by this License.
129
+
130
+ "Source" form shall mean the preferred form for making modifications,
131
+ including but not limited to software source code, documentation
132
+ source, and configuration files.
133
+
134
+ "Object" form shall mean any form resulting from mechanical
135
+ transformation or translation of a Source form, including but
136
+ not limited to compiled object code, generated documentation,
137
+ and conversions to other media types.
138
+
139
+ "Work" shall mean the work of authorship, whether in Source or
140
+ Object form, made available under the License, as indicated by a
141
+ copyright notice that is included in or attached to the work
142
+ (an example is provided in the Appendix below).
143
+
144
+ "Derivative Works" shall mean any work, whether in Source or Object
145
+ form, that is based on (or derived from) the Work and for which the
146
+ editorial revisions, annotations, elaborations, or other modifications
147
+ represent, as a whole, an original work of authorship. For the purposes
148
+ of this License, Derivative Works shall not include works that remain
149
+ separable from, or merely link (or bind by name) to the interfaces of,
150
+ the Work and Derivative Works thereof.
151
+
152
+ "Contribution" shall mean any work of authorship, including
153
+ the original version of the Work and any modifications or additions
154
+ to that Work or Derivative Works thereof, that is intentionally
155
+ submitted to Licensor for inclusion in the Work by the copyright owner
156
+ or by an individual or Legal Entity authorized to submit on behalf of
157
+ the copyright owner. For the purposes of this definition, "submitted"
158
+ means any form of electronic, verbal, or written communication sent
159
+ to the Licensor or its representatives, including but not limited to
160
+ communication on electronic mailing lists, source code control systems,
161
+ and issue tracking systems that are managed by, or on behalf of, the
162
+ Licensor for the purpose of discussing and improving the Work, but
163
+ excluding communication that is conspicuously marked or otherwise
164
+ designated in writing by the copyright owner as "Not a Contribution."
165
+
166
+ "Contributor" shall mean Licensor and any individual or Legal Entity
167
+ on behalf of whom a Contribution has been received by Licensor and
168
+ subsequently incorporated within the Work.
169
+
170
+ 2. Grant of Copyright License. Subject to the terms and conditions of
171
+ this License, each Contributor hereby grants to You a perpetual,
172
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
173
+ copyright license to reproduce, prepare Derivative Works of,
174
+ publicly display, publicly perform, sublicense, and distribute the
175
+ Work and such Derivative Works in Source or Object form.
176
+
177
+ 3. Grant of Patent License. Subject to the terms and conditions of
178
+ this License, each Contributor hereby grants to You a perpetual,
179
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
180
+ (except as stated in this section) patent license to make, have made,
181
+ use, offer to sell, sell, import, and otherwise transfer the Work,
182
+ where such license applies only to those patent claims licensable
183
+ by such Contributor that are necessarily infringed by their
184
+ Contribution(s) alone or by combination of their Contribution(s)
185
+ with the Work to which such Contribution(s) was submitted. If You
186
+ institute patent litigation against any entity (including a
187
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
188
+ or a Contribution incorporated within the Work constitutes direct
189
+ or contributory patent infringement, then any patent licenses
190
+ granted to You under this License for that Work shall terminate
191
+ as of the date such litigation is filed.
192
+
193
+ 4. Redistribution. You may reproduce and distribute copies of the
194
+ Work or Derivative Works thereof in any medium, with or without
195
+ modifications, and in Source or Object form, provided that You
196
+ meet the following conditions:
197
+
198
+ (a) You must give any other recipients of the Work or
199
+ Derivative Works a copy of this License; and
200
+
201
+ (b) You must cause any modified files to carry prominent notices
202
+ stating that You changed the files; and
203
+
204
+ (c) You must retain, in the Source form of any Derivative Works
205
+ that You distribute, all copyright, patent, trademark, and
206
+ attribution notices from the Source form of the Work,
207
+ excluding those notices that do not pertain to any part of
208
+ the Derivative Works; and
209
+
210
+ (d) If the Work includes a "NOTICE" text file as part of its
211
+ distribution, then any Derivative Works that You distribute must
212
+ include a readable copy of the attribution notices contained
213
+ within such NOTICE file, excluding those notices that do not
214
+ pertain to any part of the Derivative Works, in at least one
215
+ of the following places: within a NOTICE text file distributed
216
+ as part of the Derivative Works; within the Source form or
217
+ documentation, if provided along with the Derivative Works; or,
218
+ within a display generated by the Derivative Works, if and
219
+ wherever such third-party notices normally appear. The contents
220
+ of the NOTICE file are for informational purposes only and
221
+ do not modify the License. You may add Your own attribution
222
+ notices within Derivative Works that You distribute, alongside
223
+ or as an addendum to the NOTICE text from the Work, provided
224
+ that such additional attribution notices cannot be construed
225
+ as modifying the License.
226
+
227
+ You may add Your own copyright statement to Your modifications and
228
+ may provide additional or different license terms and conditions
229
+ for use, reproduction, or distribution of Your modifications, or
230
+ for any such Derivative Works as a whole, provided Your use,
231
+ reproduction, and distribution of the Work otherwise complies with
232
+ the conditions stated in this License.
233
+
234
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
235
+ any Contribution intentionally submitted for inclusion in the Work
236
+ by You to the Licensor shall be under the terms and conditions of
237
+ this License, without any additional terms or conditions.
238
+ Notwithstanding the above, nothing herein shall supersede or modify
239
+ the terms of any separate license agreement you may have executed
240
+ with Licensor regarding such Contributions.
241
+
242
+ 6. Trademarks. This License does not grant permission to use the trade
243
+ names, trademarks, service marks, or product names of the Licensor,
244
+ except as required for reasonable and customary use in describing the
245
+ origin of the Work and reproducing the content of the NOTICE file.
246
+
247
+ 7. Disclaimer of Warranty. Unless required by applicable law or
248
+ agreed to in writing, Licensor provides the Work (and each
249
+ Contributor provides its Contributions) on an "AS IS" BASIS,
250
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
251
+ implied, including, without limitation, any warranties or conditions
252
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
253
+ PARTICULAR PURPOSE. You are solely responsible for determining the
254
+ appropriateness of using or redistributing the Work and assume any
255
+ risks associated with Your exercise of permissions under this License.
256
+
257
+ 8. Limitation of Liability. In no event and under no legal theory,
258
+ whether in tort (including negligence), contract, or otherwise,
259
+ unless required by applicable law (such as deliberate and grossly
260
+ negligent acts) or agreed to in writing, shall any Contributor be
261
+ liable to You for damages, including any direct, indirect, special,
262
+ incidental, or consequential damages of any character arising as a
263
+ result of this License or out of the use or inability to use the
264
+ Work (including but not limited to damages for loss of goodwill,
265
+ work stoppage, computer failure or malfunction, or any and all
266
+ other commercial damages or losses), even if such Contributor
267
+ has been advised of the possibility of such damages.
268
+
269
+ 9. Accepting Warranty or Additional Liability. While redistributing
270
+ the Work or Derivative Works thereof, You may choose to offer,
271
+ and charge a fee for, acceptance of support, warranty, indemnity,
272
+ or other liability obligations and/or rights consistent with this
273
+ License. However, in accepting such obligations, You may act only
274
+ on Your own behalf and on Your sole responsibility, not on behalf
275
+ of any other Contributor, and only if You agree to indemnify,
276
+ defend, and hold each Contributor harmless for any liability
277
+ incurred by, or claims asserted against, such Contributor by reason
278
+ of your accepting any such warranty or additional liability.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ APPENDIX: How to apply the Apache License to your work.
283
+
284
+ To apply the Apache License to your work, attach the following
285
+ boilerplate notice, with the fields enclosed by brackets "[]"
286
+ replaced with your own identifying information. (Don't include
287
+ the brackets!) The text should be enclosed in the appropriate
288
+ comment syntax for the file format. We also recommend that a
289
+ file or class name and description of purpose be included on the
290
+ same "printed page" as the copyright notice for easier
291
+ identification within third-party archives.
292
+
293
+ Copyright 2025-present Datadog, Inc.
294
+
295
+ Licensed under the Apache License, Version 2.0 (the "License");
296
+ you may not use this file except in compliance with the License.
297
+ You may obtain a copy of the License at
298
+
299
+ http://www.apache.org/licenses/LICENSE-2.0
300
+
301
+ Unless required by applicable law or agreed to in writing, software
302
+ distributed under the License is distributed on an "AS IS" BASIS,
303
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
304
+ See the License for the specific language governing permissions and
305
+ limitations under the License.
306
+
307
+ ```
308
+
98
309
  ### @grpc/grpc-js
99
310
 
100
311
  This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.13.4](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.13.4)), distributed under the [Apache-2.0 License](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.13.4/LICENSE):
@@ -515,7 +726,7 @@ This product includes source derived from [@grpc/proto-loader](https://github.co
515
726
 
516
727
  ### @newrelic/security-agent
517
728
 
518
- This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v2.4.2](https://github.com/newrelic/csec-node-agent/tree/v2.4.2)), distributed under the [UNKNOWN License](https://github.com/newrelic/csec-node-agent/blob/v2.4.2/LICENSE):
729
+ This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v2.4.3](https://github.com/newrelic/csec-node-agent/tree/v2.4.3)), distributed under the [UNKNOWN License](https://github.com/newrelic/csec-node-agent/blob/v2.4.3/LICENSE):
519
730
 
520
731
  ```
521
732
  ## New Relic Software License v1.0
@@ -2322,7 +2533,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2322
2533
 
2323
2534
  ### import-in-the-middle
2324
2535
 
2325
- This product includes source derived from [import-in-the-middle](https://github.com/nodejs/import-in-the-middle) ([v1.14.0](https://github.com/nodejs/import-in-the-middle/tree/v1.14.0)), distributed under the [Apache-2.0 License](https://github.com/nodejs/import-in-the-middle/blob/v1.14.0/LICENSE):
2536
+ This product includes source derived from [import-in-the-middle](https://github.com/nodejs/import-in-the-middle) ([v1.14.2](https://github.com/nodejs/import-in-the-middle/tree/v1.14.2)), distributed under the [Apache-2.0 License](https://github.com/nodejs/import-in-the-middle/blob/v1.14.2/LICENSE):
2326
2537
 
2327
2538
  ```
2328
2539
  Apache License
@@ -2753,7 +2964,7 @@ SOFTWARE.
2753
2964
 
2754
2965
  ### @aws-sdk/client-s3
2755
2966
 
2756
- This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.821.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.821.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.821.0/LICENSE):
2967
+ This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.872.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.872.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.872.0/LICENSE):
2757
2968
 
2758
2969
  ```
2759
2970
  Apache License
@@ -2962,7 +3173,7 @@ This product includes source derived from [@aws-sdk/client-s3](https://github.co
2962
3173
 
2963
3174
  ### @aws-sdk/s3-request-presigner
2964
3175
 
2965
- This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.821.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.821.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.821.0/LICENSE):
3176
+ This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.872.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.872.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.872.0/LICENSE):
2966
3177
 
2967
3178
  ```
2968
3179
  Apache License
@@ -3229,7 +3440,7 @@ SOFTWARE.
3229
3440
 
3230
3441
  ### @newrelic/eslint-config
3231
3442
 
3232
- This product includes source derived from [@newrelic/eslint-config](https://github.com/newrelic/eslint-config-newrelic) ([v0.5.0](https://github.com/newrelic/eslint-config-newrelic/tree/v0.5.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/eslint-config-newrelic/blob/v0.5.0/LICENSE):
3443
+ This product includes source derived from [@newrelic/eslint-config](https://github.com/newrelic/eslint-config-newrelic) ([v0.6.0](https://github.com/newrelic/eslint-config-newrelic/tree/v0.6.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/eslint-config-newrelic/blob/v0.6.0/LICENSE):
3233
3444
 
3234
3445
  ```
3235
3446
  Apache License
@@ -3646,7 +3857,7 @@ This product includes source derived from [@newrelic/newrelic-oss-cli](https://g
3646
3857
 
3647
3858
  ### @newrelic/test-utilities
3648
3859
 
3649
- This product includes source derived from [@newrelic/test-utilities](https://github.com/newrelic/node-test-utilities) ([v9.1.0](https://github.com/newrelic/node-test-utilities/tree/v9.1.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-test-utilities/blob/v9.1.0/LICENSE):
3860
+ This product includes source derived from [@newrelic/test-utilities](https://github.com/newrelic/node-test-utilities) ([v10.0.0](https://github.com/newrelic/node-test-utilities/tree/v10.0.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-test-utilities/blob/v10.0.0/LICENSE):
3650
3861
 
3651
3862
  ```
3652
3863
  Apache License
@@ -4790,7 +5001,7 @@ SOFTWARE.
4790
5001
 
4791
5002
  ### eslint-plugin-jsdoc
4792
5003
 
4793
- This product includes source derived from [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) ([v50.7.1](https://github.com/gajus/eslint-plugin-jsdoc/tree/v50.7.1)), distributed under the [BSD-3-Clause License](https://github.com/gajus/eslint-plugin-jsdoc/blob/v50.7.1/LICENSE):
5004
+ This product includes source derived from [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) ([v50.8.0](https://github.com/gajus/eslint-plugin-jsdoc/tree/v50.8.0)), distributed under the [BSD-3-Clause License](https://github.com/gajus/eslint-plugin-jsdoc/blob/v50.8.0/LICENSE):
4794
5005
 
4795
5006
  ```
4796
5007
  Copyright (c) 2018, Gajus Kuizinas (http://gajus.com/)
@@ -4822,7 +5033,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4822
5033
 
4823
5034
  ### eslint
4824
5035
 
4825
- This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v9.28.0](https://github.com/eslint/eslint/tree/v9.28.0)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v9.28.0/LICENSE):
5036
+ This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v9.33.0](https://github.com/eslint/eslint/tree/v9.33.0)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v9.33.0/LICENSE):
4826
5037
 
4827
5038
  ```
4828
5039
  Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
@@ -5149,7 +5360,7 @@ THE SOFTWARE.
5149
5360
 
5150
5361
  ### koa
5151
5362
 
5152
- This product includes source derived from [koa](https://github.com/koajs/koa) ([v2.16.1](https://github.com/koajs/koa/tree/v2.16.1)), distributed under the [MIT License](https://github.com/koajs/koa/blob/v2.16.1/LICENSE):
5363
+ This product includes source derived from [koa](https://github.com/koajs/koa) ([v2.16.2](https://github.com/koajs/koa/tree/v2.16.2)), distributed under the [MIT License](https://github.com/koajs/koa/blob/v2.16.2/LICENSE):
5153
5364
 
5154
5365
  ```
5155
5366
  (The MIT License)
@@ -5435,7 +5646,7 @@ SOFTWARE.
5435
5646
 
5436
5647
  ### protobufjs
5437
5648
 
5438
- This product includes source derived from [protobufjs](https://github.com/protobufjs/protobuf.js) ([v7.5.3](https://github.com/protobufjs/protobuf.js/tree/v7.5.3)), distributed under the [BSD-3-Clause License](https://github.com/protobufjs/protobuf.js/blob/v7.5.3/LICENSE):
5649
+ This product includes source derived from [protobufjs](https://github.com/protobufjs/protobuf.js) ([v7.5.4](https://github.com/protobufjs/protobuf.js/tree/v7.5.4)), distributed under the [BSD-3-Clause License](https://github.com/protobufjs/protobuf.js/blob/v7.5.4/LICENSE):
5439
5650
 
5440
5651
  ```
5441
5652
  This license applies to all parts of protobuf.js except those files
@@ -5683,7 +5894,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5683
5894
 
5684
5895
  ### @newrelic/native-metrics
5685
5896
 
5686
- This product includes source derived from [@newrelic/native-metrics](https://github.com/newrelic/node-native-metrics) ([v11.1.0](https://github.com/newrelic/node-native-metrics/tree/v11.1.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-native-metrics/blob/v11.1.0/LICENSE):
5897
+ This product includes source derived from [@newrelic/native-metrics](https://github.com/newrelic/node-native-metrics) ([v12.0.0](https://github.com/newrelic/node-native-metrics/tree/v12.0.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-native-metrics/blob/v12.0.0/LICENSE):
5687
5898
 
5688
5899
  ```
5689
5900
  Apache License
package/esm-loader.mjs CHANGED
@@ -3,4 +3,17 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
 
6
- export * from 'import-in-the-middle/hook.mjs'
6
+ // eslint-disable-next-line n/no-unsupported-features/node-builtins
7
+ import { register } from 'node:module'
8
+ import subscriptions from './lib/subscriber-configs.js'
9
+ import createSubscriberConfigs from './lib/subscribers/create-config.js'
10
+ // Exclusions must be regexes
11
+ const exclusions = [/@openai\/agents.*/]
12
+ const { packages, instrumentations } = createSubscriberConfigs(subscriptions)
13
+
14
+ register('@apm-js-collab/tracing-hooks/hook.mjs', import.meta.url, {
15
+ data: { instrumentations, packages }
16
+ })
17
+ register('import-in-the-middle/hook.mjs', import.meta.url, {
18
+ data: { exclude: exclusions }
19
+ })
package/index.js CHANGED
@@ -28,7 +28,7 @@ logger.info(
28
28
  )
29
29
  const path = require('node:path')
30
30
  const Module = require('node:module')
31
- const otelPackages = Object.keys(pkgJSON.dependencies).filter(d => d.startsWith('@opentelemetry'))
31
+ const otelPackages = Object.keys(pkgJSON.dependencies).filter((d) => d.startsWith('@opentelemetry'))
32
32
  const otelRequire = Module.createRequire(path.join(__dirname, __filename))
33
33
 
34
34
  if (require.cache.__NR_cache) {
@@ -293,7 +293,7 @@ function otelBridgeAvailable() {
293
293
  try {
294
294
  otelRequire.resolve(p)
295
295
  } catch (error) {
296
- if (error.code === 'ERR_MODULE_NOT_FOUND') {
296
+ if (error.code.includes('MODULE_NOT_FOUND')) {
297
297
  return false
298
298
  }
299
299
  }
package/lib/agent.js CHANGED
@@ -267,8 +267,7 @@ function Agent(config) {
267
267
  periodMs: config.event_harvest_config.report_period_ms,
268
268
  limit: config.event_harvest_config.harvest_limits.log_event_data,
269
269
  config,
270
- enabled: (config) =>
271
- config.application_logging.enabled && config.application_logging.forwarding.enabled
270
+ enabled: (config) => config.application_logging.enabled && config.application_logging.forwarding.enabled
272
271
  },
273
272
  this
274
273
  )
@@ -9,6 +9,9 @@ const instrumentedLibraries = require('../instrumentations')()
9
9
  const pkgNames = Object.keys(instrumentedLibraries)
10
10
  const coreLibraries = require('../core-instrumentation')
11
11
  const corePkgs = Object.keys(coreLibraries)
12
+ const subscriptions = require('../subscriber-configs')
13
+ const subscribers = Object.keys(subscriptions)
14
+ pkgNames.push(...subscribers)
12
15
  // Manually adding undici as it is registered separately in shimmer
13
16
  corePkgs.push('undici')
14
17
  // Manually adding domain as it is registered separately in shimmer