newrelic 13.6.6 → 13.8.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 +69 -0
- package/THIRD_PARTY_NOTICES.md +10 -127
- package/index.js +1 -1
- package/lib/agent.js +5 -9
- package/lib/attributes.js +13 -6
- package/lib/config/default.js +1 -2
- package/lib/config/index.js +17 -10
- package/lib/config/samplers.js +114 -59
- package/lib/feature_flags.js +1 -1
- package/lib/instrumentation/aws-sdk/v3/bedrock.js +16 -13
- package/lib/instrumentation/koa/router-instrumentation.js +2 -1
- package/lib/instrumentation/langchain/runnable.js +6 -1
- package/lib/instrumentations.js +0 -2
- package/lib/llm-events/aws-bedrock/index.js +1 -1
- package/lib/llm-events/error-message.js +32 -20
- package/lib/metrics/names.js +6 -1
- package/lib/otel/logs/index.js +1 -1
- package/lib/otel/metrics/index.js +2 -2
- package/lib/otel/{logs/normalize-timestamp.js → normalize-timestamp.js} +32 -6
- package/lib/otel/setup.js +9 -9
- package/lib/otel/traces/segment-synthesis.js +30 -6
- package/lib/otel/traces/segments/index.js +1 -1
- package/lib/otel/traces/span-processor.js +15 -1
- package/lib/otel/traces/utils.js +3 -1
- package/lib/samplers/README.md +79 -0
- package/lib/samplers/adaptive-sampler.js +27 -3
- package/lib/samplers/always-off-sampler.js +16 -0
- package/lib/samplers/always-on-sampler.js +17 -0
- package/lib/samplers/index.js +271 -0
- package/lib/samplers/ratio-based-sampler.js +73 -0
- package/lib/samplers/sampler.js +58 -0
- package/lib/shimmer.js +2 -2
- package/lib/spans/span-event-aggregator.js +28 -3
- package/lib/spans/span-event.js +151 -45
- package/lib/spans/span-link.js +99 -0
- package/lib/spans/streaming-span-event-aggregator.js +4 -0
- package/lib/subscriber-configs.js +2 -0
- package/lib/subscribers/application-logs.js +5 -1
- package/lib/subscribers/bunyan/base.js +24 -0
- package/lib/subscribers/bunyan/config.js +35 -0
- package/lib/subscribers/bunyan/emit.js +31 -0
- package/lib/subscribers/bunyan/index.js +63 -0
- package/lib/subscribers/google-genai/base.js +123 -0
- package/lib/subscribers/google-genai/config.js +84 -0
- package/lib/subscribers/google-genai/embed-content.js +70 -0
- package/lib/subscribers/google-genai/generate-content-stream.js +125 -0
- package/lib/subscribers/google-genai/generate-content.js +55 -0
- package/lib/system-info.js +1 -1
- package/lib/transaction/index.js +20 -109
- package/lib/transaction/trace/index.js +80 -3
- package/lib/transaction/trace/segment.js +6 -9
- package/lib/transaction/tracer/index.js +11 -8
- package/lib/utilization/index.js +46 -17
- package/package.json +1 -5
- package/lib/instrumentation/@google/genai.js +0 -282
- package/lib/instrumentation/bunyan.js +0 -96
- package/lib/llm-events/aws-bedrock/error.js +0 -29
package/NEWS.md
CHANGED
|
@@ -1,3 +1,72 @@
|
|
|
1
|
+
### v13.8.0 (2025-12-11)
|
|
2
|
+
|
|
3
|
+
#### Features
|
|
4
|
+
|
|
5
|
+
* Added support for `@langchain/aws` ([#3563](https://github.com/newrelic/node-newrelic/pull/3563)) ([56c4a78](https://github.com/newrelic/node-newrelic/commit/56c4a782c7e05d94dc78ec0bd5eed19bfcc8a835))
|
|
6
|
+
* Additional support for partial granularity traces (Not available for production use)
|
|
7
|
+
* Added partial granularity tracking metrics ([#3566](https://github.com/newrelic/node-newrelic/pull/3566)) ([061f0fc](https://github.com/newrelic/node-newrelic/commit/061f0fca7e61b24fe08cb55538df4c4326c7dd69))
|
|
8
|
+
* 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))
|
|
9
|
+
* Updated the span generation process ([#3585](https://github.com/newrelic/node-newrelic/pull/3585)) ([74777d5](https://github.com/newrelic/node-newrelic/commit/74777d5f7bfc182f5e36480a9bce1b67db13ce45))
|
|
10
|
+
|
|
11
|
+
#### Code refactoring
|
|
12
|
+
|
|
13
|
+
* 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))
|
|
14
|
+
* 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))
|
|
15
|
+
* 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))
|
|
16
|
+
|
|
17
|
+
#### Documentation
|
|
18
|
+
|
|
19
|
+
* Updated compatibility report ([#3592](https://github.com/newrelic/node-newrelic/pull/3592)) ([7455533](https://github.com/newrelic/node-newrelic/commit/7455533e64d88233adf5aa0246261417049c2122))
|
|
20
|
+
|
|
21
|
+
#### Miscellaneous chores
|
|
22
|
+
|
|
23
|
+
* Refactor span link serialization ([#3574](https://github.com/newrelic/node-newrelic/pull/3574)) ([103044d](https://github.com/newrelic/node-newrelic/commit/103044d25a968649bdb0e39df054757163cd986f))
|
|
24
|
+
|
|
25
|
+
#### Tests
|
|
26
|
+
|
|
27
|
+
* 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))
|
|
28
|
+
|
|
29
|
+
### v13.7.0 (2025-12-08)
|
|
30
|
+
|
|
31
|
+
#### Features
|
|
32
|
+
|
|
33
|
+
* 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))
|
|
34
|
+
* 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))
|
|
35
|
+
* 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> }}`
|
|
36
|
+
* 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`
|
|
37
|
+
* 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))
|
|
38
|
+
* Added support for OTEL span links ([#3528](https://github.com/newrelic/node-newrelic/pull/3528)) ([e840690](https://github.com/newrelic/node-newrelic/commit/e8406903dd0c92cd003fac69770785489e1bba85))
|
|
39
|
+
* 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))
|
|
40
|
+
* Preliminary support for partial granularity traces (Not available for production use)
|
|
41
|
+
* 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))
|
|
42
|
+
* 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))
|
|
43
|
+
* 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))
|
|
44
|
+
* 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))
|
|
45
|
+
* 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))
|
|
46
|
+
* 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))
|
|
47
|
+
* 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))
|
|
48
|
+
* 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))
|
|
49
|
+
* 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))
|
|
50
|
+
|
|
51
|
+
#### Bug fixes
|
|
52
|
+
|
|
53
|
+
* Fixed normalization of OTEL hrtime ([#3564](https://github.com/newrelic/node-newrelic/pull/3564)) ([707fe7d](https://github.com/newrelic/node-newrelic/commit/707fe7d6395f0e15b5e6c6195f93df1c27540423))
|
|
54
|
+
|
|
55
|
+
#### Documentation
|
|
56
|
+
|
|
57
|
+
* Updated compatibility report ([#3551](https://github.com/newrelic/node-newrelic/pull/3551)) ([02268a4](https://github.com/newrelic/node-newrelic/commit/02268a4e3fe7b2f2f5c2fd035bcb337fd7b2bfc2))
|
|
58
|
+
* Added internal doc for attributes ([#3539](https://github.com/newrelic/node-newrelic/pull/3539)) ([68543b6](https://github.com/newrelic/node-newrelic/commit/68543b606fc53e59e9a6fcb08173e423bc6437a9))
|
|
59
|
+
|
|
60
|
+
#### Miscellaneous chores
|
|
61
|
+
|
|
62
|
+
* Improved logging around `preconnect` payload
|
|
63
|
+
* 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))
|
|
64
|
+
* Improved GCP utilization logging ([#3552](https://github.com/newrelic/node-newrelic/pull/3552)) ([e6c4141](https://github.com/newrelic/node-newrelic/commit/e6c4141b55860b5f1fe5cd14049abb9eca9b3859))
|
|
65
|
+
* Utilization resolution is now done concurrently ([#3556](https://github.com/newrelic/node-newrelic/pull/3556)) ([8386360](https://github.com/newrelic/node-newrelic/commit/8386360fe7fb4b7278e001dac8c8293581654069))
|
|
66
|
+
* 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))
|
|
67
|
+
* Improved OTEL hrtime processing ([#3557](https://github.com/newrelic/node-newrelic/pull/3557)) ([8f187b1](https://github.com/newrelic/node-newrelic/commit/8f187b11eac96f78d9743cadb2302001ed94412a))
|
|
68
|
+
* Renamed config `opentelemetry_bridge` to `opentelemetry` ([#3565](https://github.com/newrelic/node-newrelic/pull/3565)) ([c9d156f](https://github.com/newrelic/node-newrelic/commit/c9d156fe302ffb99b262ffd3e256d953301f08f2))
|
|
69
|
+
|
|
1
70
|
### v13.6.6 (2025-11-19)
|
|
2
71
|
|
|
3
72
|
#### Bug fixes
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -42,7 +42,6 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
42
42
|
|
|
43
43
|
* [@aws-sdk/client-s3](#aws-sdkclient-s3)
|
|
44
44
|
* [@aws-sdk/s3-request-presigner](#aws-sdks3-request-presigner)
|
|
45
|
-
* [@koa/router](#koarouter)
|
|
46
45
|
* [@matteo.collina/tspl](#matteocollinatspl)
|
|
47
46
|
* [@newrelic/eslint-config](#newreliceslint-config)
|
|
48
47
|
* [@newrelic/newrelic-oss-cli](#newrelicnewrelic-oss-cli)
|
|
@@ -69,9 +68,6 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
69
68
|
* [got](#got)
|
|
70
69
|
* [husky](#husky)
|
|
71
70
|
* [jsdoc](#jsdoc)
|
|
72
|
-
* [koa-route](#koa-route)
|
|
73
|
-
* [koa-router](#koa-router)
|
|
74
|
-
* [koa](#koa)
|
|
75
71
|
* [lint-staged](#lint-staged)
|
|
76
72
|
* [lockfile-lint](#lockfile-lint)
|
|
77
73
|
* [nock](#nock)
|
|
@@ -1190,7 +1186,7 @@ This product includes source derived from [@opentelemetry/api](https://github.co
|
|
|
1190
1186
|
|
|
1191
1187
|
### @opentelemetry/core
|
|
1192
1188
|
|
|
1193
|
-
This product includes source derived from [@opentelemetry/core](https://github.com/open-telemetry/opentelemetry-js) ([v2.
|
|
1189
|
+
This product includes source derived from [@opentelemetry/core](https://github.com/open-telemetry/opentelemetry-js) ([v2.2.0](https://github.com/open-telemetry/opentelemetry-js/tree/v2.2.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v2.2.0/LICENSE):
|
|
1194
1190
|
|
|
1195
1191
|
```
|
|
1196
1192
|
Apache License
|
|
@@ -1608,7 +1604,7 @@ This product includes source derived from [@opentelemetry/exporter-metrics-otlp-
|
|
|
1608
1604
|
|
|
1609
1605
|
### @opentelemetry/resources
|
|
1610
1606
|
|
|
1611
|
-
This product includes source derived from [@opentelemetry/resources](https://github.com/open-telemetry/opentelemetry-js) ([v2.
|
|
1607
|
+
This product includes source derived from [@opentelemetry/resources](https://github.com/open-telemetry/opentelemetry-js) ([v2.2.0](https://github.com/open-telemetry/opentelemetry-js/tree/v2.2.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v2.2.0/LICENSE):
|
|
1612
1608
|
|
|
1613
1609
|
```
|
|
1614
1610
|
Apache License
|
|
@@ -2026,7 +2022,7 @@ This product includes source derived from [@opentelemetry/sdk-logs](https://gith
|
|
|
2026
2022
|
|
|
2027
2023
|
### @opentelemetry/sdk-metrics
|
|
2028
2024
|
|
|
2029
|
-
This product includes source derived from [@opentelemetry/sdk-metrics](https://github.com/open-telemetry/opentelemetry-js) ([v2.
|
|
2025
|
+
This product includes source derived from [@opentelemetry/sdk-metrics](https://github.com/open-telemetry/opentelemetry-js) ([v2.2.0](https://github.com/open-telemetry/opentelemetry-js/tree/v2.2.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v2.2.0/LICENSE):
|
|
2030
2026
|
|
|
2031
2027
|
```
|
|
2032
2028
|
Apache License
|
|
@@ -2235,7 +2231,7 @@ This product includes source derived from [@opentelemetry/sdk-metrics](https://g
|
|
|
2235
2231
|
|
|
2236
2232
|
### @opentelemetry/sdk-trace-base
|
|
2237
2233
|
|
|
2238
|
-
This product includes source derived from [@opentelemetry/sdk-trace-base](https://github.com/open-telemetry/opentelemetry-js) ([v2.
|
|
2234
|
+
This product includes source derived from [@opentelemetry/sdk-trace-base](https://github.com/open-telemetry/opentelemetry-js) ([v2.2.0](https://github.com/open-telemetry/opentelemetry-js/tree/v2.2.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v2.2.0/LICENSE):
|
|
2239
2235
|
|
|
2240
2236
|
```
|
|
2241
2237
|
Apache License
|
|
@@ -2533,7 +2529,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
2533
2529
|
|
|
2534
2530
|
### import-in-the-middle
|
|
2535
2531
|
|
|
2536
|
-
This product includes source derived from [import-in-the-middle](https://github.com/nodejs/import-in-the-middle) ([v1.
|
|
2532
|
+
This product includes source derived from [import-in-the-middle](https://github.com/nodejs/import-in-the-middle) ([v1.15.0](https://github.com/nodejs/import-in-the-middle/tree/v1.15.0)), distributed under the [Apache-2.0 License](https://github.com/nodejs/import-in-the-middle/blob/v1.15.0/LICENSE):
|
|
2537
2533
|
|
|
2538
2534
|
```
|
|
2539
2535
|
Apache License
|
|
@@ -2908,7 +2904,7 @@ SOFTWARE.
|
|
|
2908
2904
|
|
|
2909
2905
|
### semver
|
|
2910
2906
|
|
|
2911
|
-
This product includes source derived from [semver](https://github.com/npm/node-semver) ([v7.7.
|
|
2907
|
+
This product includes source derived from [semver](https://github.com/npm/node-semver) ([v7.7.3](https://github.com/npm/node-semver/tree/v7.7.3)), distributed under the [ISC License](https://github.com/npm/node-semver/blob/v7.7.3/LICENSE):
|
|
2912
2908
|
|
|
2913
2909
|
```
|
|
2914
2910
|
The ISC License
|
|
@@ -2964,7 +2960,7 @@ SOFTWARE.
|
|
|
2964
2960
|
|
|
2965
2961
|
### @aws-sdk/client-s3
|
|
2966
2962
|
|
|
2967
|
-
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.919.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.919.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.919.0/LICENSE):
|
|
2968
2964
|
|
|
2969
2965
|
```
|
|
2970
2966
|
Apache License
|
|
@@ -3173,7 +3169,7 @@ This product includes source derived from [@aws-sdk/client-s3](https://github.co
|
|
|
3173
3169
|
|
|
3174
3170
|
### @aws-sdk/s3-request-presigner
|
|
3175
3171
|
|
|
3176
|
-
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.919.0](https://github.com/aws/aws-sdk-js-v3/tree/v3.919.0)), distributed under the [Apache-2.0 License](https://github.com/aws/aws-sdk-js-v3/blob/v3.919.0/LICENSE):
|
|
3177
3173
|
|
|
3178
3174
|
```
|
|
3179
3175
|
Apache License
|
|
@@ -3380,35 +3376,6 @@ This product includes source derived from [@aws-sdk/s3-request-presigner](https:
|
|
|
3380
3376
|
|
|
3381
3377
|
```
|
|
3382
3378
|
|
|
3383
|
-
### @koa/router
|
|
3384
|
-
|
|
3385
|
-
This product includes source derived from [@koa/router](https://github.com/koajs/router) ([v12.0.2](https://github.com/koajs/router/tree/v12.0.2)), distributed under the [MIT License](https://github.com/koajs/router/blob/v12.0.2/LICENSE):
|
|
3386
|
-
|
|
3387
|
-
```
|
|
3388
|
-
The MIT License (MIT)
|
|
3389
|
-
|
|
3390
|
-
Copyright (c) 2015 Alexander C. Mingoia and @koajs contributors
|
|
3391
|
-
|
|
3392
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
3393
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
3394
|
-
in the Software without restriction, including without limitation the rights
|
|
3395
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
3396
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
3397
|
-
furnished to do so, subject to the following conditions:
|
|
3398
|
-
|
|
3399
|
-
The above copyright notice and this permission notice shall be included in
|
|
3400
|
-
all copies or substantial portions of the Software.
|
|
3401
|
-
|
|
3402
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
3403
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
3404
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
3405
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
3406
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
3407
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
3408
|
-
THE SOFTWARE.
|
|
3409
|
-
|
|
3410
|
-
```
|
|
3411
|
-
|
|
3412
3379
|
### @matteo.collina/tspl
|
|
3413
3380
|
|
|
3414
3381
|
This product includes source derived from [@matteo.collina/tspl](https://github.com/mcollina/tspl) ([v0.1.1](https://github.com/mcollina/tspl/tree/v0.1.1)), distributed under the [MIT License](https://github.com/mcollina/tspl/blob/v0.1.1/LICENSE):
|
|
@@ -5033,7 +5000,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
5033
5000
|
|
|
5034
5001
|
### eslint
|
|
5035
5002
|
|
|
5036
|
-
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.38.0](https://github.com/eslint/eslint/tree/v9.38.0)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v9.38.0/LICENSE):
|
|
5037
5004
|
|
|
5038
5005
|
```
|
|
5039
5006
|
Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
|
|
@@ -5196,7 +5163,7 @@ SOFTWARE.
|
|
|
5196
5163
|
|
|
5197
5164
|
### jsdoc
|
|
5198
5165
|
|
|
5199
|
-
This product includes source derived from [jsdoc](https://github.com/jsdoc/jsdoc) ([v4.0.
|
|
5166
|
+
This product includes source derived from [jsdoc](https://github.com/jsdoc/jsdoc) ([v4.0.5](https://github.com/jsdoc/jsdoc/tree/v4.0.5)), distributed under the [Apache-2.0 License](https://github.com/jsdoc/jsdoc/blob/v4.0.5/LICENSE.md):
|
|
5200
5167
|
|
|
5201
5168
|
```
|
|
5202
5169
|
# License
|
|
@@ -5304,90 +5271,6 @@ https://github.com/jmblog/color-themes-for-google-code-prettify
|
|
|
5304
5271
|
|
|
5305
5272
|
```
|
|
5306
5273
|
|
|
5307
|
-
### koa-route
|
|
5308
|
-
|
|
5309
|
-
This product includes source derived from [koa-route](https://github.com/koajs/route) ([v4.0.1](https://github.com/koajs/route/tree/v4.0.1)), distributed under the [MIT License](https://github.com/koajs/route/blob/v4.0.1/Readme.md):
|
|
5310
|
-
|
|
5311
|
-
```
|
|
5312
|
-
MIT License
|
|
5313
|
-
|
|
5314
|
-
Copyright (c) <year> <copyright holders>
|
|
5315
|
-
|
|
5316
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
5317
|
-
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
|
5318
|
-
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
5319
|
-
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
|
5320
|
-
following conditions:
|
|
5321
|
-
|
|
5322
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
5323
|
-
portions of the Software.
|
|
5324
|
-
|
|
5325
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
5326
|
-
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
5327
|
-
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
5328
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
5329
|
-
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
5330
|
-
```
|
|
5331
|
-
|
|
5332
|
-
### koa-router
|
|
5333
|
-
|
|
5334
|
-
This product includes source derived from [koa-router](https://github.com/koajs/router) ([v12.0.1](https://github.com/koajs/router/tree/v12.0.1)), distributed under the [MIT License](https://github.com/koajs/router/blob/v12.0.1/LICENSE):
|
|
5335
|
-
|
|
5336
|
-
```
|
|
5337
|
-
The MIT License (MIT)
|
|
5338
|
-
|
|
5339
|
-
Copyright (c) 2015 Alexander C. Mingoia and @koajs contributors
|
|
5340
|
-
|
|
5341
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5342
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
5343
|
-
in the Software without restriction, including without limitation the rights
|
|
5344
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
5345
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
5346
|
-
furnished to do so, subject to the following conditions:
|
|
5347
|
-
|
|
5348
|
-
The above copyright notice and this permission notice shall be included in
|
|
5349
|
-
all copies or substantial portions of the Software.
|
|
5350
|
-
|
|
5351
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
5352
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
5353
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
5354
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
5355
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
5356
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
5357
|
-
THE SOFTWARE.
|
|
5358
|
-
|
|
5359
|
-
```
|
|
5360
|
-
|
|
5361
|
-
### koa
|
|
5362
|
-
|
|
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):
|
|
5364
|
-
|
|
5365
|
-
```
|
|
5366
|
-
(The MIT License)
|
|
5367
|
-
|
|
5368
|
-
Copyright (c) 2019 Koa contributors
|
|
5369
|
-
|
|
5370
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
5371
|
-
a copy of this software and associated documentation files (the
|
|
5372
|
-
'Software'), to deal in the Software without restriction, including
|
|
5373
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
5374
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
5375
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
5376
|
-
the following conditions:
|
|
5377
|
-
|
|
5378
|
-
The above copyright notice and this permission notice shall be
|
|
5379
|
-
included in all copies or substantial portions of the Software.
|
|
5380
|
-
|
|
5381
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
5382
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
5383
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
5384
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
5385
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
5386
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
5387
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
5388
|
-
|
|
5389
|
-
```
|
|
5390
|
-
|
|
5391
5274
|
### lint-staged
|
|
5392
5275
|
|
|
5393
5276
|
This product includes source derived from [lint-staged](https://github.com/okonet/lint-staged) ([v11.2.6](https://github.com/okonet/lint-staged/tree/v11.2.6)), distributed under the [MIT License](https://github.com/okonet/lint-staged/blob/v11.2.6/LICENSE):
|
package/index.js
CHANGED
|
@@ -102,7 +102,7 @@ function initialize() {
|
|
|
102
102
|
logger.warn(
|
|
103
103
|
'New Relic for Node.js in worker_threads is not officially supported. Not starting! To bypass this, set `config.worker_threads.enabled` to true in configuration.'
|
|
104
104
|
)
|
|
105
|
-
} else if (config.
|
|
105
|
+
} else if (config.opentelemetry.enabled === true && otelBridgeAvailable() === false) {
|
|
106
106
|
logger.warn(
|
|
107
107
|
'OpenTelemetry bridge enabled, but packages are missing. Not starting!'
|
|
108
108
|
)
|
package/lib/agent.js
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
'use strict'
|
|
7
7
|
|
|
8
|
-
const AdaptiveSampler = require('./samplers/adaptive-sampler')
|
|
9
8
|
const CollectorAPI = require('./collector/api')
|
|
10
9
|
const ServerlessCollector = require('./collector/serverless')
|
|
11
10
|
const DESTINATIONS = require('./config/attribute-filter').DESTINATIONS
|
|
@@ -41,6 +40,7 @@ const synthetics = require('./synthetics')
|
|
|
41
40
|
const Harvester = require('./harvester')
|
|
42
41
|
const { createFeatureUsageMetrics } = require('./util/application-logging')
|
|
43
42
|
const HealthReporter = require('./health-reporter')
|
|
43
|
+
const Samplers = require('./samplers')
|
|
44
44
|
|
|
45
45
|
// Map of valid states to whether or not data collection is valid
|
|
46
46
|
const STATES = {
|
|
@@ -287,12 +287,8 @@ function Agent(config) {
|
|
|
287
287
|
this.collector,
|
|
288
288
|
this.harvester
|
|
289
289
|
)
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
serverless: config.serverless_mode.enabled,
|
|
293
|
-
period: config.sampling_target_period_in_seconds * 1000,
|
|
294
|
-
target: config.sampling_target
|
|
295
|
-
})
|
|
290
|
+
|
|
291
|
+
this.samplers = new Samplers(this)
|
|
296
292
|
|
|
297
293
|
this.queries = new QueryTraceAggregator(
|
|
298
294
|
{
|
|
@@ -848,10 +844,10 @@ Agent.prototype._listenForConfigChanges = function _listenForConfigChanges() {
|
|
|
848
844
|
self.txSegmentNormalizer.load.apply(self.txSegmentNormalizer, arguments)
|
|
849
845
|
})
|
|
850
846
|
this.config.on('sampling_target', function updateSamplingTarget(target) {
|
|
851
|
-
self.
|
|
847
|
+
self.samplers.updateAdaptiveTarget(target)
|
|
852
848
|
})
|
|
853
849
|
this.config.on('sampling_target_period_in_seconds', function updateSamplePeriod(period) {
|
|
854
|
-
self.
|
|
850
|
+
self.samplers.updateAdaptivePeriod(period)
|
|
855
851
|
})
|
|
856
852
|
this.config.on('event_harvest_config', function onHarvestConfigReceived(harvestConfig) {
|
|
857
853
|
if (harvestConfig) {
|
package/lib/attributes.js
CHANGED
|
@@ -19,6 +19,9 @@ const MAXIMUM_ATTR_VALUE_LENGTH = 4_096
|
|
|
19
19
|
* @private
|
|
20
20
|
*/
|
|
21
21
|
class Attributes {
|
|
22
|
+
static SCOPE_TRANSACTION = 'transaction'
|
|
23
|
+
static SCOPE_SEGMENT = 'segment'
|
|
24
|
+
|
|
22
25
|
/**
|
|
23
26
|
* @param {object} params Constructor parameters.
|
|
24
27
|
* @param {string} params.scope
|
|
@@ -125,8 +128,8 @@ class Attributes {
|
|
|
125
128
|
|
|
126
129
|
if (!isValidType(value)) {
|
|
127
130
|
return logger.debug(
|
|
128
|
-
'Not adding attribute %s with %s value type. This is expected for undefined' +
|
|
129
|
-
'attributes and only an issue if an attribute is not expected to be undefined' +
|
|
131
|
+
'Not adding attribute %s with %s value type. This is expected for undefined ' +
|
|
132
|
+
'attributes and only an issue if an attribute is not expected to be undefined ' +
|
|
130
133
|
'or not of the type expected.',
|
|
131
134
|
key,
|
|
132
135
|
typeof value
|
|
@@ -181,10 +184,14 @@ class Attributes {
|
|
|
181
184
|
*/
|
|
182
185
|
function makeFilter(scope) {
|
|
183
186
|
const { attributeFilter } = Config.getInstance()
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
switch (scope) {
|
|
188
|
+
case Attributes.SCOPE_TRANSACTION: {
|
|
189
|
+
return (d, k) => attributeFilter.filterTransaction(d, k)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
case Attributes.SCOPE_SEGMENT: {
|
|
193
|
+
return (d, k) => attributeFilter.filterSegment(d, k)
|
|
194
|
+
}
|
|
188
195
|
}
|
|
189
196
|
}
|
|
190
197
|
|
package/lib/config/default.js
CHANGED
|
@@ -1173,7 +1173,6 @@ defaultConfig.definition = () => {
|
|
|
1173
1173
|
default: true,
|
|
1174
1174
|
formatter: boolean
|
|
1175
1175
|
},
|
|
1176
|
-
...samplerConfigs
|
|
1177
1176
|
},
|
|
1178
1177
|
partial_granularity: {
|
|
1179
1178
|
enabled: {
|
|
@@ -1707,7 +1706,7 @@ defaultConfig.definition = () => {
|
|
|
1707
1706
|
* NOTICE: this configuration is subject to change while the OTEL
|
|
1708
1707
|
* feature set is in development.
|
|
1709
1708
|
*/
|
|
1710
|
-
|
|
1709
|
+
opentelemetry: {
|
|
1711
1710
|
/**
|
|
1712
1711
|
* Global switch for the whole OpenTelemetry feature. If it is set to
|
|
1713
1712
|
* `false`, any other sub-feature, e.g. `traces`, will not be enabled
|
package/lib/config/index.js
CHANGED
|
@@ -25,7 +25,7 @@ const mergeServerConfig = new MergeServerConfig()
|
|
|
25
25
|
const { boolean: isTruthular } = require('./formatters')
|
|
26
26
|
const configDefinition = definition()
|
|
27
27
|
const parseLabels = require('../util/label-parser')
|
|
28
|
-
const {
|
|
28
|
+
const { buildSamplers, setSamplersFromEnv } = require('./samplers')
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* CONSTANTS -- we gotta lotta 'em
|
|
@@ -125,6 +125,8 @@ function Config(config) {
|
|
|
125
125
|
this.trusted_account_ids = null
|
|
126
126
|
this.trusted_account_key = null
|
|
127
127
|
|
|
128
|
+
// The global sampling target for AdaptiveSamplers that do not
|
|
129
|
+
// specify their own sampling_target
|
|
128
130
|
this.sampling_target = this.distributed_tracing.sampler.adaptive_sampling_target
|
|
129
131
|
this.sampling_target_period_in_seconds = 60
|
|
130
132
|
this.max_payload_size_in_bytes = DEFAULT_MAX_PAYLOAD_SIZE_IN_BYTES
|
|
@@ -999,10 +1001,13 @@ function getHostnameSafe(gcpId = null) {
|
|
|
999
1001
|
// If not applicable, use the os.hostname()
|
|
1000
1002
|
if (config.heroku.use_dyno_names && process.env.DYNO) {
|
|
1001
1003
|
_hostname = process.env.DYNO || os.hostname()
|
|
1004
|
+
logger.info('Using Heroku dyno name for host name: %s', _hostname)
|
|
1002
1005
|
} else if (config.utilization.gcp_use_instance_as_host && process.env.K_SERVICE && gcpId) {
|
|
1003
1006
|
_hostname = gcpId
|
|
1007
|
+
logger.info('Using GCP instance ID for host name: %s', _hostname)
|
|
1004
1008
|
} else {
|
|
1005
1009
|
_hostname = os.hostname()
|
|
1010
|
+
logger.info('Using OS hostname for host name: %s', _hostname)
|
|
1006
1011
|
}
|
|
1007
1012
|
return _hostname
|
|
1008
1013
|
} catch {
|
|
@@ -1010,14 +1015,15 @@ function getHostnameSafe(gcpId = null) {
|
|
|
1010
1015
|
|
|
1011
1016
|
if (this.process_host.ipv_preference === '6' && addresses.ipv6) {
|
|
1012
1017
|
_hostname = addresses.ipv6
|
|
1018
|
+
logger.info('Defaulting to ipv6 address for host name: %s', _hostname)
|
|
1013
1019
|
} else if (addresses.ipv4) {
|
|
1014
|
-
logger.info('Defaulting to ipv4 address for host name')
|
|
1020
|
+
logger.info('Defaulting to ipv4 address for host name: %s', _hostname)
|
|
1015
1021
|
_hostname = addresses.ipv4
|
|
1016
1022
|
} else if (addresses.ipv6) {
|
|
1017
|
-
logger.info('Defaulting to ipv6 address for host name')
|
|
1023
|
+
logger.info('Defaulting to ipv6 address for host name: %s', _hostname)
|
|
1018
1024
|
_hostname = addresses.ipv6
|
|
1019
1025
|
} else {
|
|
1020
|
-
logger.info('No hostname, ipv4, or ipv6 address found for machine')
|
|
1026
|
+
logger.info('No hostname, ipv4, or ipv6 address found for machine using UNKNOWN_BOX')
|
|
1021
1027
|
_hostname = 'UNKNOWN_BOX'
|
|
1022
1028
|
}
|
|
1023
1029
|
|
|
@@ -1065,8 +1071,8 @@ Config.prototype._fromPassed = function _fromPassed(external, internal, arbitrar
|
|
|
1065
1071
|
continue
|
|
1066
1072
|
}
|
|
1067
1073
|
|
|
1068
|
-
// Handle
|
|
1069
|
-
|
|
1074
|
+
// Handle object-based distributed tracing sampler configurations
|
|
1075
|
+
buildSamplers({ config: external, key, configToUpdate: internal, logger })
|
|
1070
1076
|
|
|
1071
1077
|
if (key === 'ssl' && !isTruthular(external.ssl)) {
|
|
1072
1078
|
logger.warn(SSL_WARNING)
|
|
@@ -1207,10 +1213,11 @@ Config.prototype._fromEnvironment = function _fromEnvironment(
|
|
|
1207
1213
|
setFromEnv({ config, key, paths, envVar, formatter: value.formatter })
|
|
1208
1214
|
|
|
1209
1215
|
// Handle custom configuration of the sampler if it's set to trace_id_ratio_based
|
|
1210
|
-
// since sampler was set to a
|
|
1211
|
-
//
|
|
1212
|
-
//
|
|
1213
|
-
|
|
1216
|
+
// or adaptive with adaptive.sampling_target defined, since sampler was set to a
|
|
1217
|
+
// string but now has to be converted to an object.
|
|
1218
|
+
// This is called here because we need to set the sampler to a value first in config
|
|
1219
|
+
// before setting the samplers.
|
|
1220
|
+
setSamplersFromEnv({
|
|
1214
1221
|
key,
|
|
1215
1222
|
config,
|
|
1216
1223
|
paths,
|