newrelic 13.8.0 → 13.9.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 +124 -69
- package/THIRD_PARTY_NOTICES.md +7 -7
- package/lib/config/default.js +0 -13
- package/lib/health-reporter.js +6 -1
- package/lib/instrumentations.js +0 -1
- package/lib/metrics/names.js +39 -12
- package/lib/otel/traces/segment-synthesis.js +6 -30
- package/lib/otel/traces/span-processor.js +80 -18
- package/lib/samplers/adaptive-sampler.js +12 -6
- package/lib/samplers/index.js +37 -1
- package/lib/samplers/ratio-based-sampler.js +1 -2
- package/lib/samplers/sampler.js +4 -2
- package/lib/serverless/aws-lambda.js +18 -12
- package/lib/spans/helpers.js +1 -63
- package/lib/spans/span-event-aggregator.js +10 -13
- package/lib/spans/span-event.js +210 -61
- package/lib/spans/streaming-span-event-aggregator.js +4 -10
- package/lib/spans/streaming-span-event.js +4 -10
- package/lib/spans/timed-event.js +77 -0
- package/lib/subscriber-configs.js +2 -0
- package/lib/subscribers/base.js +9 -2
- package/lib/subscribers/ioredis/index.js +2 -2
- package/lib/subscribers/iovalkey/config.js +21 -0
- package/lib/subscribers/iovalkey/index.js +15 -0
- package/lib/subscribers/langchain/base.js +161 -0
- package/lib/subscribers/langchain/chain-callback-manager.js +14 -0
- package/lib/subscribers/langchain/config.js +163 -0
- package/lib/subscribers/langchain/runnable-stream.js +149 -0
- package/lib/subscribers/langchain/runnable.js +56 -0
- package/lib/subscribers/langchain/tool-callback-manager.js +24 -0
- package/lib/subscribers/langchain/tool.js +115 -0
- package/lib/subscribers/langchain/vectorstore.js +133 -0
- package/lib/subscribers/openai/base.js +1 -1
- package/lib/subscribers/openai/chat.js +8 -0
- package/lib/subscribers/openai/embeddings.js +8 -0
- package/lib/subscribers/undici/index.js +11 -14
- package/lib/symbols.js +2 -0
- package/lib/tracking-packages.js +9 -1
- package/lib/transaction/index.js +18 -2
- package/lib/transaction/trace/index.js +4 -79
- package/lib/transaction/trace/partial-trace.js +243 -0
- package/lib/transaction/trace/segment.js +18 -1
- package/package.json +2 -2
- package/lib/instrumentation/langchain/callback-manager.js +0 -25
- package/lib/instrumentation/langchain/common.js +0 -69
- package/lib/instrumentation/langchain/nr-hooks.js +0 -42
- package/lib/instrumentation/langchain/runnable.js +0 -310
- package/lib/instrumentation/langchain/tools.js +0 -78
- package/lib/instrumentation/langchain/vectorstore.js +0 -141
package/NEWS.md
CHANGED
|
@@ -1,72 +1,125 @@
|
|
|
1
|
-
### v13.
|
|
2
|
-
|
|
3
|
-
#### Features
|
|
4
|
-
|
|
5
|
-
* Added
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
* Added
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
|
|
1
|
+
### v13.9.0 (2026-01-08)
|
|
2
|
+
|
|
3
|
+
#### Features
|
|
4
|
+
|
|
5
|
+
* Added `entity_guid` to Agent Control health file ([#3594](https://github.com/newrelic/node-newrelic/pull/3594)) ([f42a501](https://github.com/newrelic/node-newrelic/commit/f42a501defce8eb246d28d6218db4947aca5bedd))
|
|
6
|
+
* Added instrumentation support for `iovalkey` ([#3612](https://github.com/newrelic/node-newrelic/pull/3612)) ([55f5d6e](https://github.com/newrelic/node-newrelic/commit/55f5d6e8f1c1278845c2ed2a06c4d1d600015bb0))
|
|
7
|
+
* Added support for OTel span events ([#3600](https://github.com/newrelic/node-newrelic/pull/3600)) ([5b7c340](https://github.com/newrelic/node-newrelic/commit/5b7c34013aafd42d9f3e2b11eb31b86f1f4ea461))
|
|
8
|
+
* Additional support for partial granularity traces (Not available for production use)
|
|
9
|
+
* Added `compact` type for partial granularity traces. ([#3608](https://github.com/newrelic/node-newrelic/pull/3608)) ([73b0381](https://github.com/newrelic/node-newrelic/commit/73b038107f2e1fb94e7e7586dcf1d392031eb272))
|
|
10
|
+
* Added core tracing supportability metrics ([#3610](https://github.com/newrelic/node-newrelic/pull/3610)) ([c465f4c](https://github.com/newrelic/node-newrelic/commit/c465f4c540599b0ded7eac1f27e12443b69d7a81))
|
|
11
|
+
* Updated metric names for full and partial traces to consolidate like values ([#3620](https://github.com/newrelic/node-newrelic/pull/3620)) ([b201338](https://github.com/newrelic/node-newrelic/commit/b20133825440876260998eda58eb94b04b864bb2))
|
|
12
|
+
|
|
13
|
+
#### Bug fixes
|
|
14
|
+
|
|
15
|
+
* Account for links added during transaction ([#3606](https://github.com/newrelic/node-newrelic/pull/3606)) ([488b678](https://github.com/newrelic/node-newrelic/commit/488b678278811af7eb6b941eed84e0dafdb86fd5))
|
|
16
|
+
* Updated samplers to properly assign sampling decisions based on appropriate context ([#3641](https://github.com/newrelic/node-newrelic/pull/3641)) ([4bbdddf](https://github.com/newrelic/node-newrelic/commit/4bbdddf7ae845cf349f27cca895a32a748a8327a))
|
|
17
|
+
* Updated `undici` instrumentation to track the active and parent segment as symbols on request to properly end active request ([#3619](https://github.com/newrelic/node-newrelic/pull/3619)) ([9baebe5](https://github.com/newrelic/node-newrelic/commit/9baebe5c6bccba3c69bda5f3f3195d24dce0065b))
|
|
18
|
+
|
|
19
|
+
#### Code refactoring
|
|
20
|
+
|
|
21
|
+
* Removed unused `distributed_tracing.in_process_spans.enabled` logic. Partial granularity tracing replaces it ([#3611](https://github.com/newrelic/node-newrelic/pull/3611)) ([1d5584e](https://github.com/newrelic/node-newrelic/commit/1d5584eacd98b484435e56af455070ed866d246d))
|
|
22
|
+
* Updated `@langchain/core` instrumentation to subscribe to events emitted ([#3493](https://github.com/newrelic/node-newrelic/pull/3493)) ([d1e90e4](https://github.com/newrelic/node-newrelic/commit/d1e90e4d66ac03a07b572a94f58066f2c20e7f25))
|
|
23
|
+
|
|
24
|
+
#### Documentation
|
|
25
|
+
|
|
26
|
+
* Updated compatibility report ([#3635](https://github.com/newrelic/node-newrelic/pull/3635)) ([74ac737](https://github.com/newrelic/node-newrelic/commit/74ac737f90c9a84ddce1c0994a9ecf9665883a86))
|
|
27
|
+
|
|
28
|
+
#### Miscellaneous chores
|
|
29
|
+
|
|
30
|
+
* Changed `Langchain` to `LangChain`, expand version range ([#3629](https://github.com/newrelic/node-newrelic/pull/3629)) ([d77239e](https://github.com/newrelic/node-newrelic/commit/d77239edbff79bb4e73c58a814f7a7d272325e77))
|
|
31
|
+
* Copy OTEL status metadata to segment ([#3613](https://github.com/newrelic/node-newrelic/pull/3613)) ([4057e80](https://github.com/newrelic/node-newrelic/commit/4057e804b74170ba58a0faf0bdeb934eafc4195d))
|
|
32
|
+
* **deps:** Updated `@newrelic/security-agent` to `v3.0.0` ([#3637](https://github.com/newrelic/node-newrelic/pull/3637)) ([a84fa74](https://github.com/newrelic/node-newrelic/commit/a84fa742bbacb607a813de2a99d81113027178bc))
|
|
33
|
+
* Don't create OpenAI segments if `ai_monitoring` is disabled ([#3625](https://github.com/newrelic/node-newrelic/pull/3625)) ([b4f0010](https://github.com/newrelic/node-newrelic/commit/b4f001033684937cbe886ca166d8c71a662b783d))
|
|
34
|
+
* Limit number of span links on segments ([#3621](https://github.com/newrelic/node-newrelic/pull/3621)) ([c923c30](https://github.com/newrelic/node-newrelic/commit/c923c30a094af5f5e197f2e63f5dca652480f76d))
|
|
35
|
+
* Updated Azure publishing with OIDC steps ([#3633](https://github.com/newrelic/node-newrelic/pull/3633)) ([14c41c0](https://github.com/newrelic/node-newrelic/commit/14c41c042847e823360965d815ebff7125973197))
|
|
36
|
+
|
|
37
|
+
#### Tests
|
|
38
|
+
|
|
39
|
+
* Centralized indices for `redis` versioned tests ([#3636](https://github.com/newrelic/node-newrelic/pull/3636)) ([34f6562](https://github.com/newrelic/node-newrelic/commit/34f6562f42c8a8fb02236cdff07832d8c0fb9562))
|
|
40
|
+
* Changed `LangChain` tool test to `>=0.2.0` ([#3631](https://github.com/newrelic/node-newrelic/pull/3631)) ([3a4980f](https://github.com/newrelic/node-newrelic/commit/3a4980faf924a9a334d38e0a3ed73c6d4ad79b8b))
|
|
41
|
+
* Fix `LangChain` test targets ([#3634](https://github.com/newrelic/node-newrelic/pull/3634)) ([6504eb8](https://github.com/newrelic/node-newrelic/commit/6504eb869dc11d9c94bc3bf862a0b6bd308ee01c))
|
|
42
|
+
* Refactored `LangChain` versioned tests ([#3624](https://github.com/newrelic/node-newrelic/pull/3624)) ([12ae601](https://github.com/newrelic/node-newrelic/commit/12ae601befa72d16a9d1b9ca041b1fd825281c28))
|
|
43
|
+
|
|
44
|
+
### v13.8.1 (2025-12-15)
|
|
45
|
+
|
|
46
|
+
#### Bug fixes
|
|
47
|
+
|
|
48
|
+
* Updated AWS Lambda instrumentation to skip wrapping handler callback if not present ([#3602](https://github.com/newrelic/node-newrelic/pull/3602)) ([d56e27d](https://github.com/newrelic/node-newrelic/commit/d56e27d5764b4c0a7d513fffa3310148d7cebea6))
|
|
49
|
+
|
|
50
|
+
#### Documentation
|
|
51
|
+
|
|
52
|
+
* Updated compatibility report ([#3596](https://github.com/newrelic/node-newrelic/pull/3596)) ([ed24527](https://github.com/newrelic/node-newrelic/commit/ed24527cfd2e836de67a769cbeaa63683b207506))
|
|
53
|
+
|
|
54
|
+
### v13.8.0 (2025-12-11)
|
|
55
|
+
|
|
56
|
+
#### Features
|
|
57
|
+
|
|
58
|
+
* Added support for `@langchain/aws` ([#3563](https://github.com/newrelic/node-newrelic/pull/3563)) ([56c4a78](https://github.com/newrelic/node-newrelic/commit/56c4a782c7e05d94dc78ec0bd5eed19bfcc8a835))
|
|
59
|
+
* Additional support for partial granularity traces (Not available for production use)
|
|
60
|
+
* Added partial granularity tracking metrics ([#3566](https://github.com/newrelic/node-newrelic/pull/3566)) ([061f0fc](https://github.com/newrelic/node-newrelic/commit/061f0fca7e61b24fe08cb55538df4c4326c7dd69))
|
|
61
|
+
* updated `AlwaysOn` sampler to set priority to 3 for full trace and 2 for partial trace ([#3577](https://github.com/newrelic/node-newrelic/pull/3577)) ([e7bcff4](https://github.com/newrelic/node-newrelic/commit/e7bcff4364b5ea8a8af7a7ee58ff05e9e2edb977))
|
|
62
|
+
* Updated the span generation process ([#3585](https://github.com/newrelic/node-newrelic/pull/3585)) ([74777d5](https://github.com/newrelic/node-newrelic/commit/74777d5f7bfc182f5e36480a9bce1b67db13ce45))
|
|
63
|
+
|
|
64
|
+
#### Code refactoring
|
|
65
|
+
|
|
66
|
+
* Converted AWS Bedrock's `LlmError` to use `LlmErrorMessage` ([#3567](https://github.com/newrelic/node-newrelic/pull/3567)) ([8b2bb42](https://github.com/newrelic/node-newrelic/commit/8b2bb428eb3830b7cee4fa30e77a9562628fdd01))
|
|
67
|
+
* Updated `@google/genai` instrumentation to subscribe to events emitted ([#3467](https://github.com/newrelic/node-newrelic/pull/3467)) ([e8d9ba1](https://github.com/newrelic/node-newrelic/commit/e8d9ba188b4399604c6410b2fca406f8d7f338b5))
|
|
68
|
+
* Updated `bunyan` instrumentation to subscribe to events emitted ([#3589](https://github.com/newrelic/node-newrelic/pull/3589)) ([f1e5f12](https://github.com/newrelic/node-newrelic/commit/f1e5f129594a4c3acd8075604bae52013555cf52))
|
|
69
|
+
|
|
70
|
+
#### Documentation
|
|
71
|
+
|
|
72
|
+
* Updated compatibility report ([#3592](https://github.com/newrelic/node-newrelic/pull/3592)) ([7455533](https://github.com/newrelic/node-newrelic/commit/7455533e64d88233adf5aa0246261417049c2122))
|
|
73
|
+
|
|
74
|
+
#### Miscellaneous chores
|
|
75
|
+
|
|
76
|
+
* Refactor span link serialization ([#3574](https://github.com/newrelic/node-newrelic/pull/3574)) ([103044d](https://github.com/newrelic/node-newrelic/commit/103044d25a968649bdb0e39df054757163cd986f))
|
|
77
|
+
|
|
78
|
+
#### Tests
|
|
79
|
+
|
|
80
|
+
* Moved mock aws bedrock server creation to `test/lib/aws-server-stubs/index.js` ([#3593](https://github.com/newrelic/node-newrelic/pull/3593)) ([270df81](https://github.com/newrelic/node-newrelic/commit/270df8109a2adbcb3ff405030e2be7104bee6511))
|
|
81
|
+
|
|
82
|
+
### v13.7.0 (2025-12-08)
|
|
83
|
+
|
|
84
|
+
#### Features
|
|
85
|
+
|
|
86
|
+
* Updated `koa` instrumentation to properly wrap `Router` when using `@koa/router@15.0.0`+ ([#3550](https://github.com/newrelic/node-newrelic/pull/3550)) ([f1e08ad](https://github.com/newrelic/node-newrelic/commit/f1e08ad9fe200138ab9ed32e423517f64e41af49))
|
|
87
|
+
* Added ability to configure a ratio based sampler ([#3501](https://github.com/newrelic/node-newrelic/pull/3501)) ([f300bd5](https://github.com/newrelic/node-newrelic/commit/f300bd5eacf9d6509b56484e7ad36d5c0725b497))
|
|
88
|
+
* To assign a ratio based sampler, set `config.distributed_tracing.sampler.root`, `config.distributed_tracing.sampler.remote_parent_sampled`, or `config.distributed_tracing.sampler.remote_parent_not_sampled` to `{ trace_id_ratio_based: { ratio: <float between 0 and 1> }}`
|
|
89
|
+
* To assign via environment variables set `NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_<TYPE>='trace_id_ratio_based'` and `NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_<TYPE>_RATIO=<float between 0 and 1>` where `<TYPE>` is one of `ROOT`, `REMOTE_PARENT_SAMPLED`, or `REMOTE_PARENT_NOT_SAMPLED`
|
|
90
|
+
* Updated configuration to allow `adaptive.sampling_target` to be set for `config.distributed_tracing.sampler.root`, `config.distributed_tracing.sampler.remote_parent_sampled`, and `config.distributed_tracing.sampler.remote_parent_not_sampled` ([#3532](https://github.com/newrelic/node-newrelic/pull/3532)) ([44f51dd](https://github.com/newrelic/node-newrelic/commit/44f51dd5583e74aef1e2d0ee9483d51d5ff786c3))
|
|
91
|
+
* Added support for OTEL span links ([#3528](https://github.com/newrelic/node-newrelic/pull/3528)) ([e840690](https://github.com/newrelic/node-newrelic/commit/e8406903dd0c92cd003fac69770785489e1bba85))
|
|
92
|
+
* Replaced `default` with `adaptive` as the default for samplers ([#3543](https://github.com/newrelic/node-newrelic/pull/3543)) ([3f03162](https://github.com/newrelic/node-newrelic/commit/3f0316285fdde6d3c38ce819aa41221a71bd4fcb))
|
|
93
|
+
* Preliminary support for partial granularity traces (Not available for production use)
|
|
94
|
+
* Added `essential` type for partial granularity traces ([#3547](https://github.com/newrelic/node-newrelic/pull/3547)) ([3d85fb5](https://github.com/newrelic/node-newrelic/commit/3d85fb5fa16d411892eb4a23067e66669461ada0))
|
|
95
|
+
* Added `reduced` type for partial granularity traces. ([#3540](https://github.com/newrelic/node-newrelic/pull/3540)) ([cfa8f41](https://github.com/newrelic/node-newrelic/commit/cfa8f41618595cc5ffb3e3b5574673721c64580c))
|
|
96
|
+
* Added partial granularity samplers and assign transactions with `isPartialTrace` when partial granularity sampling decisions have been made ([#3544](https://github.com/newrelic/node-newrelic/pull/3544)) ([1535a82](https://github.com/newrelic/node-newrelic/commit/1535a82331ce40d7c96e0c6746ec70bcdbd6e4f6))
|
|
97
|
+
* Refactored samplers into classes and store them on `agent.sampler.*` ([#3527](https://github.com/newrelic/node-newrelic/pull/3527)) ([ad63441](https://github.com/newrelic/node-newrelic/commit/ad634411a0d91240c0c16c7a372b00b36651589f))
|
|
98
|
+
* Updated `Samplers` class to normalize logger messages, short circuit when applicable and remove optional chaining checks ([#3546](https://github.com/newrelic/node-newrelic/pull/3546)) ([4f7684c](https://github.com/newrelic/node-newrelic/commit/4f7684cb4c64a89545704c70c110d2fd13815197))
|
|
99
|
+
* Updated samplers to assign priority between 0-1 when DT is disabled or both full and partial granularity are disabled ([#3559](https://github.com/newrelic/node-newrelic/pull/3559)) ([7a1c37e](https://github.com/newrelic/node-newrelic/commit/7a1c37e3e04fef0538a8af15fa690915bce65262))
|
|
100
|
+
* Updated transaction to store partial granularity indicator as `.partialType` ([#3561](https://github.com/newrelic/node-newrelic/pull/3561)) ([a7f20d8](https://github.com/newrelic/node-newrelic/commit/a7f20d8e83b44556434bae90bd3924c54af9f587))
|
|
101
|
+
* Updated when partial granularity rules are applied ([#3553](https://github.com/newrelic/node-newrelic/pull/3553)) ([a4bdf4f](https://github.com/newrelic/node-newrelic/commit/a4bdf4fbbbdac102519020c5ca4d3dc92eeff844))
|
|
102
|
+
* Added `toString` and `get [Symbol.toStringTag]()` to default Sampler class ([#3562](https://github.com/newrelic/node-newrelic/pull/3562)) ([771168d](https://github.com/newrelic/node-newrelic/commit/771168dcd927240b6efc703f238046e9a7f7766b))
|
|
103
|
+
|
|
104
|
+
#### Bug fixes
|
|
105
|
+
|
|
106
|
+
* Fixed normalization of OTEL hrtime ([#3564](https://github.com/newrelic/node-newrelic/pull/3564)) ([707fe7d](https://github.com/newrelic/node-newrelic/commit/707fe7d6395f0e15b5e6c6195f93df1c27540423))
|
|
107
|
+
|
|
108
|
+
#### Documentation
|
|
109
|
+
|
|
110
|
+
* Updated compatibility report ([#3551](https://github.com/newrelic/node-newrelic/pull/3551)) ([02268a4](https://github.com/newrelic/node-newrelic/commit/02268a4e3fe7b2f2f5c2fd035bcb337fd7b2bfc2))
|
|
111
|
+
* Added internal doc for attributes ([#3539](https://github.com/newrelic/node-newrelic/pull/3539)) ([68543b6](https://github.com/newrelic/node-newrelic/commit/68543b606fc53e59e9a6fcb08173e423bc6437a9))
|
|
112
|
+
|
|
113
|
+
#### Miscellaneous chores
|
|
114
|
+
|
|
115
|
+
* Improved logging around `preconnect` payload
|
|
116
|
+
* Added more logging around assigning hostname during `preconnect` ([#3568](https://github.com/newrelic/node-newrelic/pull/3568)) ([3ee4d38](https://github.com/newrelic/node-newrelic/commit/3ee4d383cd7d9e7bf16e9da5e7f130fc2a103ca4))
|
|
117
|
+
* Improved GCP utilization logging ([#3552](https://github.com/newrelic/node-newrelic/pull/3552)) ([e6c4141](https://github.com/newrelic/node-newrelic/commit/e6c4141b55860b5f1fe5cd14049abb9eca9b3859))
|
|
118
|
+
* Utilization resolution is now done concurrently ([#3556](https://github.com/newrelic/node-newrelic/pull/3556)) ([8386360](https://github.com/newrelic/node-newrelic/commit/8386360fe7fb4b7278e001dac8c8293581654069))
|
|
119
|
+
* Collected OTEL instrumentation scope metadata on all OTEL spans. ([#3554](https://github.com/newrelic/node-newrelic/pull/3554)) ([75703c4](https://github.com/newrelic/node-newrelic/commit/75703c41a8db1d204a1500b8b43dff0d04a5b286))
|
|
120
|
+
* Improved OTEL hrtime processing ([#3557](https://github.com/newrelic/node-newrelic/pull/3557)) ([8f187b1](https://github.com/newrelic/node-newrelic/commit/8f187b11eac96f78d9743cadb2302001ed94412a))
|
|
121
|
+
* Renamed config `opentelemetry_bridge` to `opentelemetry` ([#3565](https://github.com/newrelic/node-newrelic/pull/3565)) ([c9d156f](https://github.com/newrelic/node-newrelic/commit/c9d156fe302ffb99b262ffd3e256d953301f08f2))
|
|
122
|
+
|
|
70
123
|
### v13.6.6 (2025-11-19)
|
|
71
124
|
|
|
72
125
|
#### Bug fixes
|
|
@@ -8148,3 +8201,5 @@ Special thanks to Ryan Copley (@RyanCopley) for the contribution.
|
|
|
8148
8201
|
|
|
8149
8202
|
|
|
8150
8203
|
|
|
8204
|
+
|
|
8205
|
+
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -304,7 +304,7 @@ This product includes source derived from [@apm-js-collab/tracing-hooks](https:/
|
|
|
304
304
|
|
|
305
305
|
### @grpc/grpc-js
|
|
306
306
|
|
|
307
|
-
This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.14.
|
|
307
|
+
This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.14.3](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.14.3)), distributed under the [Apache-2.0 License](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.14.3/LICENSE):
|
|
308
308
|
|
|
309
309
|
```
|
|
310
310
|
Apache License
|
|
@@ -722,7 +722,7 @@ This product includes source derived from [@grpc/proto-loader](https://github.co
|
|
|
722
722
|
|
|
723
723
|
### @newrelic/security-agent
|
|
724
724
|
|
|
725
|
-
This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([
|
|
725
|
+
This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v3.0.0](https://github.com/newrelic/csec-node-agent/tree/v3.0.0)), distributed under the [UNKNOWN License](https://github.com/newrelic/csec-node-agent/blob/v3.0.0/LICENSE):
|
|
726
726
|
|
|
727
727
|
```
|
|
728
728
|
## New Relic Software License v1.0
|
|
@@ -2960,7 +2960,7 @@ SOFTWARE.
|
|
|
2960
2960
|
|
|
2961
2961
|
### @aws-sdk/client-s3
|
|
2962
2962
|
|
|
2963
|
-
This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.
|
|
2963
|
+
This product includes source derived from [@aws-sdk/client-s3](https://github.com/aws/aws-sdk-js-v3) ([v3.958.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.958.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.958.0/LICENSE):
|
|
2964
2964
|
|
|
2965
2965
|
```
|
|
2966
2966
|
Apache License
|
|
@@ -3169,7 +3169,7 @@ This product includes source derived from [@aws-sdk/client-s3](https://github.co
|
|
|
3169
3169
|
|
|
3170
3170
|
### @aws-sdk/s3-request-presigner
|
|
3171
3171
|
|
|
3172
|
-
This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.
|
|
3172
|
+
This product includes source derived from [@aws-sdk/s3-request-presigner](https://github.com/aws/aws-sdk-js-v3) ([v3.958.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.958.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.958.0/LICENSE):
|
|
3173
3173
|
|
|
3174
3174
|
```
|
|
3175
3175
|
Apache License
|
|
@@ -4567,7 +4567,7 @@ THE SOFTWARE.
|
|
|
4567
4567
|
|
|
4568
4568
|
### aws-sdk
|
|
4569
4569
|
|
|
4570
|
-
This product includes source derived from [aws-sdk](https://github.com/aws/aws-sdk-js) ([v2.
|
|
4570
|
+
This product includes source derived from [aws-sdk](https://github.com/aws/aws-sdk-js) ([v2.1693.0](https://github.com/aws/aws-sdk-js/tree/v2.1693.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js/blob/v2.1693.0/LICENSE.txt):
|
|
4571
4571
|
|
|
4572
4572
|
```
|
|
4573
4573
|
|
|
@@ -5000,7 +5000,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
5000
5000
|
|
|
5001
5001
|
### eslint
|
|
5002
5002
|
|
|
5003
|
-
This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v9.
|
|
5003
|
+
This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v9.39.2](https://github.com/eslint/eslint/tree/v9.39.2)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v9.39.2/LICENSE):
|
|
5004
5004
|
|
|
5005
5005
|
```
|
|
5006
5006
|
Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
|
|
@@ -5027,7 +5027,7 @@ THE SOFTWARE.
|
|
|
5027
5027
|
|
|
5028
5028
|
### express
|
|
5029
5029
|
|
|
5030
|
-
This product includes source derived from [express](https://github.com/expressjs/express) ([v5.1
|
|
5030
|
+
This product includes source derived from [express](https://github.com/expressjs/express) ([v5.2.1](https://github.com/expressjs/express/tree/v5.2.1)), distributed under the [MIT License](https://github.com/expressjs/express/blob/v5.2.1/LICENSE):
|
|
5031
5031
|
|
|
5032
5032
|
```
|
|
5033
5033
|
(The MIT License)
|
package/lib/config/default.js
CHANGED
|
@@ -1143,19 +1143,6 @@ defaultConfig.definition = () => {
|
|
|
1143
1143
|
default: false
|
|
1144
1144
|
},
|
|
1145
1145
|
|
|
1146
|
-
/**
|
|
1147
|
-
* Controls whether the agent will generate spans for in-process actions.
|
|
1148
|
-
* When disabled, this will only create spans for entry and exit spans.
|
|
1149
|
-
* entry spans - initial actions for web servers and message queue consumption.
|
|
1150
|
-
* exit spans - all outgoing calls to external services(external and database calls)
|
|
1151
|
-
*/
|
|
1152
|
-
in_process_spans: {
|
|
1153
|
-
enabled: {
|
|
1154
|
-
formatter: boolean,
|
|
1155
|
-
default: true
|
|
1156
|
-
}
|
|
1157
|
-
},
|
|
1158
|
-
|
|
1159
1146
|
sampler: {
|
|
1160
1147
|
...samplerConfigs,
|
|
1161
1148
|
/**
|
package/lib/health-reporter.js
CHANGED
|
@@ -36,9 +36,10 @@ function getTime() {
|
|
|
36
36
|
return Date.now() * 1_000_000
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
function writeStatus({ file, healthy = true, code, msg, startTime, callback } = {}) {
|
|
39
|
+
function writeStatus({ file, entityGuid, healthy = true, code, msg, startTime, callback } = {}) {
|
|
40
40
|
const currentTime = getTime()
|
|
41
41
|
const yaml = [
|
|
42
|
+
`entity_guid: ${entityGuid}`,
|
|
42
43
|
`healthy: ${healthy}`,
|
|
43
44
|
`status: '${msg}'`,
|
|
44
45
|
`last_error: ${code}`,
|
|
@@ -64,6 +65,7 @@ function directoryAvailable(dest) {
|
|
|
64
65
|
* by the environment.
|
|
65
66
|
*/
|
|
66
67
|
class HealthReporter {
|
|
68
|
+
#agentConfig = {}
|
|
67
69
|
#enabled = false
|
|
68
70
|
#status = HealthReporter.STATUS_HEALTHY
|
|
69
71
|
#interval
|
|
@@ -120,6 +122,7 @@ class HealthReporter {
|
|
|
120
122
|
logger = defaultLogger,
|
|
121
123
|
setInterval = global.setInterval
|
|
122
124
|
} = {}) {
|
|
125
|
+
this.#agentConfig = agentConfig
|
|
123
126
|
const enabled = agentConfig?.agent_control?.enabled
|
|
124
127
|
const checkInterval = parseInt(agentConfig?.agent_control?.health?.frequency, 10) * 1_000
|
|
125
128
|
let outDir = agentConfig?.agent_control?.health?.delivery_location
|
|
@@ -161,6 +164,7 @@ class HealthReporter {
|
|
|
161
164
|
const healthy = this.#status === HealthReporter.STATUS_HEALTHY
|
|
162
165
|
writeStatus({
|
|
163
166
|
file: this.#destFile,
|
|
167
|
+
entityGuid: this.#agentConfig.entity_guid || '',
|
|
164
168
|
healthy,
|
|
165
169
|
startTime: this.#startTime,
|
|
166
170
|
code: this.#status,
|
|
@@ -241,6 +245,7 @@ class HealthReporter {
|
|
|
241
245
|
|
|
242
246
|
writeStatus({
|
|
243
247
|
file: this.#destFile,
|
|
248
|
+
entityGuid: this.#agentConfig.entity_guid || '',
|
|
244
249
|
startTime: this.#startTime,
|
|
245
250
|
healthy,
|
|
246
251
|
code,
|
package/lib/instrumentations.js
CHANGED
|
@@ -25,7 +25,6 @@ module.exports = function instrumentations() {
|
|
|
25
25
|
'generic-pool': { type: InstrumentationDescriptor.TYPE_GENERIC },
|
|
26
26
|
kafkajs: { type: InstrumentationDescriptor.TYPE_MESSAGE },
|
|
27
27
|
koa: { module: './instrumentation/koa' },
|
|
28
|
-
langchain: { module: './instrumentation/langchain' },
|
|
29
28
|
memcached: { type: InstrumentationDescriptor.TYPE_DATASTORE },
|
|
30
29
|
mongodb: { type: InstrumentationDescriptor.TYPE_DATASTORE },
|
|
31
30
|
next: { module: './instrumentation/nextjs' },
|
package/lib/metrics/names.js
CHANGED
|
@@ -191,12 +191,12 @@ AI.BEDROCK = {
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
AI.LANGCHAIN = {
|
|
194
|
-
TRACKING_PREFIX: `${AI.TRACKING_PREFIX}/
|
|
195
|
-
EMBEDDING: `${AI.EMBEDDING}/
|
|
196
|
-
COMPLETION: `${AI.COMPLETION}/
|
|
197
|
-
TOOL: `${AI.TOOL}/
|
|
198
|
-
CHAIN: `${AI.CHAIN}/
|
|
199
|
-
VECTORSTORE: `${AI.VECTORSTORE}/
|
|
194
|
+
TRACKING_PREFIX: `${AI.TRACKING_PREFIX}/LangChain`,
|
|
195
|
+
EMBEDDING: `${AI.EMBEDDING}/LangChain`,
|
|
196
|
+
COMPLETION: `${AI.COMPLETION}/LangChain`,
|
|
197
|
+
TOOL: `${AI.TOOL}/LangChain`,
|
|
198
|
+
CHAIN: `${AI.CHAIN}/LangChain`,
|
|
199
|
+
VECTORSTORE: `${AI.VECTORSTORE}/LangChain`
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
const MCP = {
|
|
@@ -289,18 +289,43 @@ const DISTRIBUTED_TRACE = {
|
|
|
289
289
|
TRANSPORT: 'TransportDuration'
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
const
|
|
292
|
+
const PARTIAL_GRANULARITY = '/PartialGranularity'
|
|
293
|
+
const DISTRIBUTED_TRACING = 'DistributedTrace'
|
|
294
|
+
|
|
295
|
+
const PARTIAL_TRACE = {
|
|
296
|
+
PREFIX: SUPPORTABILITY.NODEJS + PARTIAL_GRANULARITY,
|
|
297
|
+
SPAN_PREFIX: SUPPORTABILITY.PREFIX + DISTRIBUTED_TRACING + PARTIAL_GRANULARITY,
|
|
298
|
+
INSTRUMENTED: '/Span/Instrumented',
|
|
299
|
+
KEPT: '/Span/Kept',
|
|
300
|
+
DROPPED: SUPPORTABILITY.NODEJS + PARTIAL_GRANULARITY + '/NrIds/Dropped'
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const FULL_TRACE_PREFIX = SUPPORTABILITY.NODEJS + '/FullGranularity'
|
|
304
|
+
|
|
305
|
+
const SAMPLERS = {
|
|
306
|
+
ROOT: '/Root',
|
|
307
|
+
PARENT_SAMPLED: '/RemoteParentSampled',
|
|
308
|
+
PARENT_NOT_SAMPLED: '/RemoteParentNotSampled'
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
SAMPLERS.FULL = {
|
|
312
|
+
ROOT: FULL_TRACE_PREFIX + SAMPLERS.ROOT,
|
|
313
|
+
PARENT_SAMPLED: FULL_TRACE_PREFIX + SAMPLERS.PARENT_SAMPLED,
|
|
314
|
+
PARENT_NOT_SAMPLED: FULL_TRACE_PREFIX + SAMPLERS.PARENT_NOT_SAMPLED
|
|
315
|
+
}
|
|
293
316
|
|
|
294
|
-
|
|
317
|
+
SAMPLERS.PARTIAL = {
|
|
318
|
+
ROOT: PARTIAL_TRACE.PREFIX + SAMPLERS.ROOT,
|
|
319
|
+
PARENT_SAMPLED: PARTIAL_TRACE.PREFIX + SAMPLERS.PARENT_SAMPLED,
|
|
320
|
+
PARENT_NOT_SAMPLED: PARTIAL_TRACE.PREFIX + SAMPLERS.PARENT_NOT_SAMPLED
|
|
321
|
+
}
|
|
295
322
|
|
|
323
|
+
const SPAN_EVENT_PREFIX = 'SpanEvent/'
|
|
296
324
|
const SPAN_EVENTS = {
|
|
297
325
|
SEEN: SUPPORTABILITY.PREFIX + SPAN_EVENT_PREFIX + 'TotalEventsSeen',
|
|
298
326
|
SENT: SUPPORTABILITY.PREFIX + SPAN_EVENT_PREFIX + 'TotalEventsSent',
|
|
299
327
|
DROPPED: SUPPORTABILITY.PREFIX + SPAN_EVENT_PREFIX + 'Discarded',
|
|
300
|
-
LIMIT: SUPPORTABILITY.PREFIX + SPAN_EVENT_PREFIX + 'Limit'
|
|
301
|
-
PARTIAL_PREFIX: SUPPORTABILITY.PREFIX + PARTIAL_GRANULARITY,
|
|
302
|
-
KEPT: '/Span/Kept',
|
|
303
|
-
INSTRUMENTED: '/Span/Instrumented',
|
|
328
|
+
LIMIT: SUPPORTABILITY.PREFIX + SPAN_EVENT_PREFIX + 'Limit'
|
|
304
329
|
}
|
|
305
330
|
|
|
306
331
|
const INFINITE_TRACING = {
|
|
@@ -402,11 +427,13 @@ module.exports = {
|
|
|
402
427
|
NODEJS,
|
|
403
428
|
NORMALIZED: 'NormalizedUri',
|
|
404
429
|
OTHER_TRANSACTION,
|
|
430
|
+
PARTIAL_TRACE,
|
|
405
431
|
POSTGRES,
|
|
406
432
|
PRISMA,
|
|
407
433
|
QUEUETIME: 'WebFrontend/QueueTime',
|
|
408
434
|
REDIS,
|
|
409
435
|
RESTIFY,
|
|
436
|
+
SAMPLERS,
|
|
410
437
|
SPAN_EVENTS,
|
|
411
438
|
SUPPORTABILITY,
|
|
412
439
|
TRANSACTION_ERROR,
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
'use strict'
|
|
7
7
|
|
|
8
8
|
const defaultLogger = require('#agentlib/logger.js').child({ component: 'segment-synthesizer' })
|
|
9
|
-
const SpanLink = require('#agentlib/spans/span-link.js')
|
|
10
|
-
const normalizeTimestamp = require('../normalize-timestamp.js')
|
|
11
9
|
const { RulesEngine } = require('./rules.js')
|
|
12
10
|
const {
|
|
13
11
|
createConsumerSegment,
|
|
@@ -36,57 +34,35 @@ class SegmentSynthesizer {
|
|
|
36
34
|
return
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
let mapResult
|
|
40
37
|
switch (rule.type) {
|
|
41
38
|
case 'consumer': {
|
|
42
|
-
|
|
43
|
-
break
|
|
39
|
+
return createConsumerSegment(this.agent, otelSpan, rule)
|
|
44
40
|
}
|
|
45
41
|
|
|
46
42
|
case 'db': {
|
|
47
|
-
|
|
48
|
-
break
|
|
43
|
+
return createDbSegment(this.agent, otelSpan, rule)
|
|
49
44
|
}
|
|
50
45
|
|
|
51
46
|
case 'external': {
|
|
52
|
-
|
|
53
|
-
break
|
|
47
|
+
return createHttpExternalSegment(this.agent, otelSpan, rule, this.logger)
|
|
54
48
|
}
|
|
55
49
|
|
|
56
50
|
case 'internal': {
|
|
57
|
-
|
|
58
|
-
break
|
|
51
|
+
return createInternalSegment(this.agent, otelSpan, rule)
|
|
59
52
|
}
|
|
60
53
|
|
|
61
54
|
case 'producer': {
|
|
62
|
-
|
|
63
|
-
break
|
|
55
|
+
return createProducerSegment(this.agent, otelSpan, rule)
|
|
64
56
|
}
|
|
65
57
|
|
|
66
58
|
case 'server': {
|
|
67
|
-
|
|
68
|
-
break
|
|
59
|
+
return createServerSegment(this.agent, otelSpan, rule)
|
|
69
60
|
}
|
|
70
61
|
|
|
71
62
|
default: {
|
|
72
63
|
this.logger.debug('Found type: %s, no synthesis rule currently built', rule.type)
|
|
73
|
-
return
|
|
74
64
|
}
|
|
75
65
|
}
|
|
76
|
-
|
|
77
|
-
if (otelSpan.links?.length > 0) {
|
|
78
|
-
// We need to map span link data over to the New Relic segment.
|
|
79
|
-
for (let i = 0; i < otelSpan.links.length; i += 1) {
|
|
80
|
-
const link = new SpanLink({
|
|
81
|
-
link: otelSpan.links.at(i),
|
|
82
|
-
spanContext: otelSpan.spanContext(),
|
|
83
|
-
timestamp: normalizeTimestamp(otelSpan.startTime)
|
|
84
|
-
})
|
|
85
|
-
mapResult.segment.addSpanLink(link)
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return mapResult
|
|
90
66
|
}
|
|
91
67
|
}
|
|
92
68
|
|