newrelic 13.0.0 → 13.2.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.
Files changed (68) hide show
  1. package/NEWS.md +92 -0
  2. package/README.md +2 -4
  3. package/THIRD_PARTY_NOTICES.md +429 -9
  4. package/esm-loader.mjs +9 -1
  5. package/index.js +38 -3
  6. package/lib/agent.js +8 -2
  7. package/lib/config/build-instrumentation-config.js +3 -0
  8. package/lib/config/default.js +1397 -1383
  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/core/http-outbound.js +11 -26
  17. package/lib/instrumentation/kafkajs/producer.js +13 -19
  18. package/lib/instrumentation/openai.js +2 -2
  19. package/lib/instrumentation/undici.js +48 -40
  20. package/lib/instrumentations.js +14 -5
  21. package/lib/llm-events/aws-bedrock/utils.js +1 -1
  22. package/lib/metrics/names.js +8 -0
  23. package/lib/metrics/normalizer.js +1 -3
  24. package/lib/otel/context.js +18 -14
  25. package/lib/otel/logs/bootstrap-logs.js +84 -0
  26. package/lib/otel/logs/no-op-exporter.js +25 -0
  27. package/lib/otel/logs/normalize-timestamp.js +59 -0
  28. package/lib/otel/logs/proxying-provider.js +46 -0
  29. package/lib/otel/logs/severity-to-string.js +56 -0
  30. package/lib/otel/metrics/bootstrap-metrics.js +1 -1
  31. package/lib/otel/setup.js +21 -8
  32. package/lib/patch-module.js +70 -0
  33. package/lib/serverless/aws-lambda.js +1 -3
  34. package/lib/shim/webframework-shim/middleware-mounter.js +1 -3
  35. package/lib/shimmer.js +56 -8
  36. package/lib/subscriber-configs.js +17 -0
  37. package/lib/subscribers/application-logs.js +55 -0
  38. package/lib/subscribers/base.js +177 -0
  39. package/lib/subscribers/create-config.js +27 -0
  40. package/lib/subscribers/db-operation.js +21 -0
  41. package/lib/subscribers/db-query.js +54 -0
  42. package/lib/subscribers/db.js +57 -0
  43. package/lib/subscribers/elasticsearch/config.js +49 -0
  44. package/lib/subscribers/elasticsearch/elasticsearch.js +42 -0
  45. package/lib/subscribers/elasticsearch/opensearch.js +15 -0
  46. package/lib/subscribers/elasticsearch/transport.js +14 -0
  47. package/lib/subscribers/ioredis/config.js +37 -0
  48. package/lib/subscribers/ioredis/index.js +48 -0
  49. package/lib/subscribers/mcp-sdk/client-prompt.js +23 -0
  50. package/lib/subscribers/mcp-sdk/client-resource.js +24 -0
  51. package/lib/subscribers/mcp-sdk/client-tool.js +23 -0
  52. package/lib/subscribers/mcp-sdk/client.js +29 -0
  53. package/lib/subscribers/mcp-sdk/config.js +104 -0
  54. package/lib/subscribers/pino/config.js +20 -0
  55. package/lib/subscribers/pino/index.js +102 -0
  56. package/lib/transaction/index.js +4 -1
  57. package/lib/transaction/trace/aggregator.js +7 -9
  58. package/lib/util/camel-case.js +1 -3
  59. package/lib/util/get-package-version.js +34 -0
  60. package/lib/util/urltils.js +19 -13
  61. package/lib/w3c/tracestate.js +3 -3
  62. package/newrelic.js +10 -0
  63. package/package.json +9 -5
  64. package/lib/instrumentation/@elastic/elasticsearch.js +0 -62
  65. package/lib/instrumentation/@opensearch-project/opensearch.js +0 -66
  66. package/lib/instrumentation/ioredis.js +0 -50
  67. package/lib/instrumentation/pino/nr-hooks.js +0 -19
  68. package/lib/instrumentation/pino/pino.js +0 -168
package/NEWS.md CHANGED
@@ -1,3 +1,93 @@
1
+ ### v13.2.0 (2025-08-20)
2
+
3
+ #### Features
4
+
5
+ * 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))
6
+ * 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))
7
+ * 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))
8
+
9
+ #### Bug fixes
10
+
11
+ * Fixed logic around detecting OTEL packages ([#3326](https://github.com/newrelic/node-newrelic/pull/3326)) ([4df30e5](https://github.com/newrelic/node-newrelic/commit/4df30e5c2021e0d933e4a77ccd4409405928fa39))
12
+ * 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))
13
+
14
+ #### Code refactoring
15
+
16
+ * 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))
17
+ * 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))
18
+ * Removed `id` parameter from `opensearch` class ([#3312](https://github.com/newrelic/node-newrelic/pull/3312)) ([8be00ce](https://github.com/newrelic/node-newrelic/commit/8be00cef67a2637f7d7a3ab33cccb6824ab34478))
19
+ * 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))
20
+ * 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))
21
+ * 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))
22
+ * 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))
23
+ * 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))
24
+ * 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))
25
+
26
+ #### Documentation
27
+
28
+ * 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))
29
+
30
+ #### Miscellaneous chores
31
+
32
+ * 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))
33
+ * Updated eslint configuration ([#3296](https://github.com/newrelic/node-newrelic/pull/3296)) ([5c168a6](https://github.com/newrelic/node-newrelic/commit/5c168a657cddece16c0b1124307526ffb3588953))
34
+
35
+ #### Tests
36
+
37
+ * 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))
38
+ * 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))
39
+
40
+ #### Continuous integration
41
+
42
+ * 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))
43
+ * 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))
44
+
45
+ ### v13.1.0 (2025-08-13)
46
+
47
+ #### Features
48
+
49
+ * Added support for OTEL logs API ([#3228](https://github.com/newrelic/node-newrelic/pull/3228)) ([19a9c78](https://github.com/newrelic/node-newrelic/commit/19a9c788c27f084618093d94a31b7badd5fcafd9))
50
+ * Added supportability metrics when instrumentation has been disabled for a package ([#3252](https://github.com/newrelic/node-newrelic/pull/3252)) ([6098a5b](https://github.com/newrelic/node-newrelic/commit/6098a5b24497029686f0253d68e2d3138e84a27b))
51
+ * Disabled timers instrumentation by default in the sample configuration ([#3253](https://github.com/newrelic/node-newrelic/pull/3253)) ([72eb8d4](https://github.com/newrelic/node-newrelic/commit/72eb8d4450e2f2eb958d5faf472a94c2b93b0b81))
52
+
53
+ #### Bug fixes
54
+
55
+ * Fixed `transaction.url` obfuscation ([#3280](https://github.com/newrelic/node-newrelic/pull/3280)) ([dc09492](https://github.com/newrelic/node-newrelic/commit/dc09492228e0ddae2598e0edd5403bd01cd3bbcd))
56
+
57
+ #### Code refactoring
58
+
59
+ * Updated `http-outbound` to parse url only once ([#3270](https://github.com/newrelic/node-newrelic/pull/3270)) ([5bb0f8d](https://github.com/newrelic/node-newrelic/commit/5bb0f8d79ab9cf7100d323166302b509edce3ff1))
60
+
61
+ #### Documentation
62
+
63
+ * Updated distributed tracing example target to use the correct repo ([#3254](https://github.com/newrelic/node-newrelic/pull/3254)) ([1fb3859](https://github.com/newrelic/node-newrelic/commit/1fb3859ed905c03d601a5344436037969fcc1256))
64
+ * Updated compatibility report ([#3299](https://github.com/newrelic/node-newrelic/pull/3299)) ([8b85342](https://github.com/newrelic/node-newrelic/commit/8b85342f35c7fe92287b227f48fb2d14079070bf))
65
+ * Updated compatibility report ([#3267](https://github.com/newrelic/node-newrelic/pull/3267)) ([2712c94](https://github.com/newrelic/node-newrelic/commit/2712c94a07c13cea6dd7a488e6df960daba55307))
66
+ * Updated compatibility report ([#3265](https://github.com/newrelic/node-newrelic/pull/3265)) ([daedadd](https://github.com/newrelic/node-newrelic/commit/daedadde1766ddb8b0d94b6d9599bdd246073576))
67
+ * Updated compatibility report ([#3261](https://github.com/newrelic/node-newrelic/pull/3261)) ([bd7d3fa](https://github.com/newrelic/node-newrelic/commit/bd7d3fa1bed4ce312ef7609fc2dd87aa348ed2b6))
68
+ * Updated compatibility report ([#3246](https://github.com/newrelic/node-newrelic/pull/3246)) ([c289fb5](https://github.com/newrelic/node-newrelic/commit/c289fb5d241c85c6ff4d20c5a54222178475ce33))
69
+ * Updated compatibility report ([#3241](https://github.com/newrelic/node-newrelic/pull/3241)) ([64529e1](https://github.com/newrelic/node-newrelic/commit/64529e189e409cfedf552f8c212a36997df408b4))
70
+
71
+ #### Miscellaneous chores
72
+
73
+ * Added guardrail for OTEL bridge ([#3283](https://github.com/newrelic/node-newrelic/pull/3283)) ([ff71865](https://github.com/newrelic/node-newrelic/commit/ff718658754d711b3b837e5ad633a8da4feeba7e))
74
+ * Refactored API bootstrapping ([#3281](https://github.com/newrelic/node-newrelic/pull/3281)) ([97be8f6](https://github.com/newrelic/node-newrelic/commit/97be8f6b67c364a5a720d2889989ce3dfacb2cf5))
75
+
76
+
77
+ #### Tests
78
+
79
+ * Cleaned up engines and version ranges in versioned tests ([#3260](https://github.com/newrelic/node-newrelic/pull/3260)) ([c7fd60e](https://github.com/newrelic/node-newrelic/commit/c7fd60e938aaaf9b13dc4055f6aff02508ae554c))
80
+ * Fixed failing http benchmark test ([#3258](https://github.com/newrelic/node-newrelic/pull/3258)) ([7e8cd48](https://github.com/newrelic/node-newrelic/commit/7e8cd480786f7d971a8c6263c6cc82e92fbc0fe1))
81
+ * Fixed a failing span-event benchmark test ([#3255](https://github.com/newrelic/node-newrelic/pull/3255)) ([05b955f](https://github.com/newrelic/node-newrelic/commit/05b955fb6ff2a470b82436964eeeaed8e93962ae))
82
+ * Fixed CI issues with latest 24 ([#3277](https://github.com/newrelic/node-newrelic/pull/3277)) ([960d169](https://github.com/newrelic/node-newrelic/commit/960d169122fc821a432eb7c200ba713963b66289))
83
+ * Fixed tests that assumed timers instrumentation was always enabled ([#3257](https://github.com/newrelic/node-newrelic/pull/3257)) ([40cfda1](https://github.com/newrelic/node-newrelic/commit/40cfda159a86f7c83bdfc783480ad56183098b45))
84
+ * Forced install of peer deps on nestjs test app ([#3269](https://github.com/newrelic/node-newrelic/pull/3269)) ([4e454ff](https://github.com/newrelic/node-newrelic/commit/4e454ffabef4aa6a731bc07bb730d29e726b4713))
85
+
86
+ #### Continuous integration
87
+
88
+ * Updated CI to fail if benchmark tests fail ([#3256](https://github.com/newrelic/node-newrelic/pull/3256)) ([a6a7a15](https://github.com/newrelic/node-newrelic/commit/a6a7a15d1d8d1241ca88c9d3c33ec537fe5c0164))
89
+ * Added sending benchmark metrics to NR One ([#3285](https://github.com/newrelic/node-newrelic/pull/3285)) ([7fc8e40](https://github.com/newrelic/node-newrelic/commit/7fc8e40e3d9995fd161b85e4e0ef92501aed9369))
90
+
1
91
  ### v13.0.0 (2025-07-23)
2
92
  #### ⚠ BREAKING CHANGES
3
93
 
@@ -7721,3 +7811,5 @@ Special thanks to Ryan Copley (@RyanCopley) for the contribution.
7721
7811
  * The agent reports transaction trace data.
7722
7812
 
7723
7813
  [mdn-async-function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
7814
+
7815
+
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`.