newrelic 12.16.0 → 12.17.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 CHANGED
@@ -1,3 +1,50 @@
1
+ ### v12.17.0 (2025-04-02)
2
+
3
+ #### Features
4
+
5
+ * Azure Function utilization ([#3017](https://github.com/newrelic/node-newrelic/pull/3017)) ([80ab93e](https://github.com/newrelic/node-newrelic/commit/80ab93ee5599800a823e3828f9730d5421b460c2))
6
+ * Support honoring W3C `traceparent` sampled flag ([#3009](https://github.com/newrelic/node-newrelic/pull/3009)) ([d903413](https://github.com/newrelic/node-newrelic/commit/d903413a6216dae2cde3e6b6366c3a390d4ed4cd))
7
+ * By default the agent will not honor the `traceparent` sampled flag.
8
+ * To control how sampling works with `traceparent` set the following in config:
9
+ * `distributed_tracing.sampler.remote_parent_sampled`(when the traceparent sampled flag is `01`)
10
+ * `always_on`: the agent will sample spans
11
+ * `always_off`: the agent will not sample spans
12
+ * `default`: the agent will rely on existing priority sampling to make its decisions
13
+ * `distributed_tracing.sampler.remote_parent_not_sampled`(when the traceparent sampled flag is `00`)
14
+ * `always_on`: the agent will sample spans
15
+ * `always_off`: the agent will not sample spans
16
+ * `default`: the agent will rely on existing priority sampling to make its decisions
17
+
18
+ #### Code refactoring
19
+
20
+ * Updated otel bridge to centralize mapping rules for a given span attribute to accomondate semantic convention spec updates ([#3010](https://github.com/newrelic/node-newrelic/pull/3010)) ([c20c36b](https://github.com/newrelic/node-newrelic/commit/c20c36bbe0f63ab18fbbe85ad4bfaa3b80f1475d))
21
+
22
+ #### Documentation
23
+
24
+ * Updated compatibility report ([#3013](https://github.com/newrelic/node-newrelic/pull/3013)) ([8fab715](https://github.com/newrelic/node-newrelic/commit/8fab715581ccc5da7118884a0080557891329daa))
25
+
26
+ #### Tests
27
+
28
+ * Pinned `openai@4.90.0` to work with `@langchain/openai` ([#3019](https://github.com/newrelic/node-newrelic/pull/3019)) ([eaa3db0](https://github.com/newrelic/node-newrelic/commit/eaa3db0a556a19c44a05926dc339ea7bcbc9cebd))
29
+
30
+ ### v12.16.1 (2025-03-24)
31
+
32
+ #### Features
33
+
34
+ * Assign all attributes on internal spans to segment ([#3000](https://github.com/newrelic/node-newrelic/pull/3000)) ([5403018](https://github.com/newrelic/node-newrelic/commit/54030185ba5630099b76182a52c629276af4d93e))
35
+
36
+ #### Bug fixes
37
+
38
+ * Fixed `tracer.transactionNestProxy` to create a new transaction if there is no transaction or transaction is not active ([#3007](https://github.com/newrelic/node-newrelic/pull/3007)) ([ced9e22](https://github.com/newrelic/node-newrelic/commit/ced9e22a23ddeed860c1fd88f0afb10bb94343cb))
39
+
40
+ #### Documentation
41
+
42
+ * Updated compatibility report ([#2993](https://github.com/newrelic/node-newrelic/pull/2993)) ([cdfa042](https://github.com/newrelic/node-newrelic/commit/cdfa042325a7636e84a7b19a34874b20915dac63))
43
+
44
+ #### Tests
45
+
46
+ * Fixed handling require esm for >20.19.0+ ([#3002](https://github.com/newrelic/node-newrelic/pull/3002)) ([b808e00](https://github.com/newrelic/node-newrelic/commit/b808e00c399d3c924eeeb19f9c6b9fba4695a720))
47
+
1
48
  ### v12.16.0 (2025-03-17)
2
49
 
3
50
  #### Features
@@ -19,7 +19,6 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
19
19
  * [@newrelic/security-agent](#newrelicsecurity-agent)
20
20
  * [@opentelemetry/api](#opentelemetryapi)
21
21
  * [@opentelemetry/core](#opentelemetrycore)
22
- * [@opentelemetry/resources](#opentelemetryresources)
23
22
  * [@opentelemetry/sdk-trace-base](#opentelemetrysdk-trace-base)
24
23
  * [@tyriar/fibonacci-heap](#tyriarfibonacci-heap)
25
24
  * [concat-stream](#concat-stream)
@@ -510,10 +509,48 @@ This product includes source derived from [@grpc/proto-loader](https://github.co
510
509
 
511
510
  ### @newrelic/security-agent
512
511
 
513
- This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v2.3.1](https://github.com/newrelic/csec-node-agent/tree/v2.3.1)), distributed under the [UNKNOWN License](undefined):
512
+ This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v2.3.1](https://github.com/newrelic/csec-node-agent/tree/v2.3.1)), distributed under the [UNKNOWN License](https://github.com/newrelic/csec-node-agent/blob/v2.3.1/LICENSE):
514
513
 
515
514
  ```
516
- undefined
515
+ ## New Relic Software License v1.0
516
+
517
+ ### Acceptance
518
+
519
+ This software license applies to the repositories, directories, or files that it has been associated with (referred to here as “the Software”). In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
520
+
521
+ ### License
522
+
523
+ New Relic grants you a license for the Software to do everything you might do with the Software that would otherwise infringe the New Relic’s copyrights or patent rights, conditional on only using the Software for Permitted Purposes and compliance with all other Restrictions on Use. All other uses are prohibited.
524
+
525
+ ### Permitted Purposes
526
+
527
+ The Software is solely for use with New Relic’s proprietary SaaS service (“New Relic Service”). To use the Software you must have a valid and active subscription agreement to the New Relic Service. You may not use the Software in conjunction with any other similar service.
528
+
529
+ ### Restrictions on Use
530
+
531
+ 1. The use of the Software is limited to you and your organization. You cannot expose the Software to third parties via the network or use the Software on behalf of anyone else.
532
+ 2. You cannot modify the Software. You can compile or link the Software into your programs as described in the New Relic Documentation, but you cannot otherwise make any derivative works of the Software.
533
+ 3. You cannot reverse engineer or decompile the Software.
534
+ 4. You cannot use the Software for competitive analysis, benchmarking, or any purposes that compete with or are intended to compete with New Relic.
535
+ 5. You cannot remove or obscure any proprietary notices in the Software.
536
+ 6. You can only copy the Software to the extent needed to use the Software within your organization. You cannot distribute the Software to any third parties.
537
+ 7. You can only use the New Relic Services and the Software consistent with your subscription agreement with New Relic, New Relic’s product Documentation and Acceptable Use Policy.
538
+
539
+ ### Intellectual Property
540
+
541
+ Any feedback provided to New Relic about the Software, including feedback provided as source code, comments, or other copyrightable or patentable material, is provided to New Relic under the terms of the Apache Software License, version 2. If you do not provide attribution information or a copy of the license with your feedback, you waive the performance of those requirements of the Apache License with respect to New Relic. The license grant regarding any feedback is irrevocable and persists past the termination of this license.
542
+
543
+ ### Termination
544
+
545
+ This license terminates when the Software stops being provided by New Relic or when described by the New Relic subscription agreement, whichever comes first. When this license terminates, you have a commercially reasonable time to either remove the Software from your systems.
546
+
547
+ ### Other Terms
548
+
549
+ 1. The Software is provided “AS IS.” New Relic disclaims all warranties, whether express, implied, statutory or otherwise, including warranties of merchantability, fitness for a particular purpose, title, and noninfringement.
550
+ 2. To the full extent permitted by law, New Relic will have no liability arising from or related to the Software or from this license for any direct, indirect, special, incidental, or consequential damages of any kind, even if advised of their possibility in advance, and regardless of legal theory (whether contract, tort, negligence, strict liability or otherwise).
551
+ 3. The Software may contain third-party software, including open source software (“OSS”). The third party software is governed by its own license and subject to its own terms, disclosed in the provided licensing information associated with the third party components. If a source code disclosure is required under the terms of the license covering any OSS component, the source code can be requested of New Relic by emailing opensource@newrelic.com.
552
+
553
+
517
554
  ```
518
555
 
519
556
  ### @opentelemetry/api
@@ -727,7 +764,7 @@ This product includes source derived from [@opentelemetry/api](https://github.co
727
764
 
728
765
  ### @opentelemetry/core
729
766
 
730
- This product includes source derived from [@opentelemetry/core](https://github.com/open-telemetry/opentelemetry-js) ([v1.30.1](https://github.com/open-telemetry/opentelemetry-js/tree/v1.30.1)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v1.30.1/LICENSE):
767
+ This product includes source derived from [@opentelemetry/core](https://github.com/open-telemetry/opentelemetry-js) ([v2.0.0](https://github.com/open-telemetry/opentelemetry-js/tree/v2.0.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v2.0.0/LICENSE):
731
768
 
732
769
  ```
733
770
  Apache License
@@ -934,9 +971,9 @@ This product includes source derived from [@opentelemetry/core](https://github.c
934
971
 
935
972
  ```
936
973
 
937
- ### @opentelemetry/resources
974
+ ### @opentelemetry/sdk-trace-base
938
975
 
939
- This product includes source derived from [@opentelemetry/resources](https://github.com/open-telemetry/opentelemetry-js) ([v1.30.1](https://github.com/open-telemetry/opentelemetry-js/tree/v1.30.1)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v1.30.1/LICENSE):
976
+ This product includes source derived from [@opentelemetry/sdk-trace-base](https://github.com/open-telemetry/opentelemetry-js) ([v2.0.0](https://github.com/open-telemetry/opentelemetry-js/tree/v2.0.0)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v2.0.0/LICENSE):
940
977
 
941
978
  ```
942
979
  Apache License
@@ -1143,9 +1180,98 @@ This product includes source derived from [@opentelemetry/resources](https://git
1143
1180
 
1144
1181
  ```
1145
1182
 
1146
- ### @opentelemetry/sdk-trace-base
1183
+ ### @tyriar/fibonacci-heap
1184
+
1185
+ This product includes source derived from [@tyriar/fibonacci-heap](https://github.com/gwtw/ts-fibonacci-heap) ([v2.0.9](https://github.com/gwtw/ts-fibonacci-heap/tree/v2.0.9)), distributed under the [MIT License](https://github.com/gwtw/ts-fibonacci-heap/blob/v2.0.9/LICENSE):
1186
+
1187
+ ```
1188
+ The MIT License (MIT)
1189
+
1190
+ Copyright (c) 2014 Daniel Imms, http://www.growingwiththeweb.com
1191
+
1192
+ Permission is hereby granted, free of charge, to any person obtaining a copy
1193
+ of this software and associated documentation files (the "Software"), to deal
1194
+ in the Software without restriction, including without limitation the rights
1195
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1196
+ copies of the Software, and to permit persons to whom the Software is
1197
+ furnished to do so, subject to the following conditions:
1198
+
1199
+ The above copyright notice and this permission notice shall be included in
1200
+ all copies or substantial portions of the Software.
1201
+
1202
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1203
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1204
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1205
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1206
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1207
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1208
+ THE SOFTWARE.
1209
+
1210
+ ```
1211
+
1212
+ ### concat-stream
1213
+
1214
+ This product includes source derived from [concat-stream](https://github.com/maxogden/concat-stream) ([v2.0.0](https://github.com/maxogden/concat-stream/tree/v2.0.0)), distributed under the [MIT License](https://github.com/maxogden/concat-stream/blob/v2.0.0/LICENSE):
1215
+
1216
+ ```
1217
+ The MIT License
1218
+
1219
+ Copyright (c) 2013 Max Ogden
1220
+
1221
+ Permission is hereby granted, free of charge,
1222
+ to any person obtaining a copy of this software and
1223
+ associated documentation files (the "Software"), to
1224
+ deal in the Software without restriction, including
1225
+ without limitation the rights to use, copy, modify,
1226
+ merge, publish, distribute, sublicense, and/or sell
1227
+ copies of the Software, and to permit persons to whom
1228
+ the Software is furnished to do so,
1229
+ subject to the following conditions:
1147
1230
 
1148
- This product includes source derived from [@opentelemetry/sdk-trace-base](https://github.com/open-telemetry/opentelemetry-js) ([v1.30.1](https://github.com/open-telemetry/opentelemetry-js/tree/v1.30.1)), distributed under the [Apache-2.0 License](https://github.com/open-telemetry/opentelemetry-js/blob/v1.30.1/LICENSE):
1231
+ The above copyright notice and this permission notice
1232
+ shall be included in all copies or substantial portions of the Software.
1233
+
1234
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1235
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
1236
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1237
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
1238
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1239
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1240
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1241
+ ```
1242
+
1243
+ ### https-proxy-agent
1244
+
1245
+ This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) ([v7.0.6](https://github.com/TooTallNate/proxy-agents/tree/v7.0.6)), distributed under the [MIT License](https://github.com/TooTallNate/proxy-agents/blob/v7.0.6/LICENSE):
1246
+
1247
+ ```
1248
+ (The MIT License)
1249
+
1250
+ Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
1251
+
1252
+ Permission is hereby granted, free of charge, to any person obtaining
1253
+ a copy of this software and associated documentation files (the
1254
+ 'Software'), to deal in the Software without restriction, including
1255
+ without limitation the rights to use, copy, modify, merge, publish,
1256
+ distribute, sublicense, and/or sell copies of the Software, and to
1257
+ permit persons to whom the Software is furnished to do so, subject to
1258
+ the following conditions:
1259
+
1260
+ The above copyright notice and this permission notice shall be
1261
+ included in all copies or substantial portions of the Software.
1262
+
1263
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
1264
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1265
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1266
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
1267
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1268
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1269
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1270
+ ```
1271
+
1272
+ ### import-in-the-middle
1273
+
1274
+ This product includes source derived from [import-in-the-middle](https://github.com/nodejs/import-in-the-middle) ([v1.13.0](https://github.com/nodejs/import-in-the-middle/tree/v1.13.0)), distributed under the [Apache-2.0 License](https://github.com/nodejs/import-in-the-middle/blob/v1.13.0/LICENSE):
1149
1275
 
1150
1276
  ```
1151
1277
  Apache License
@@ -1352,103 +1478,6 @@ This product includes source derived from [@opentelemetry/sdk-trace-base](https:
1352
1478
 
1353
1479
  ```
1354
1480
 
1355
- ### @tyriar/fibonacci-heap
1356
-
1357
- This product includes source derived from [@tyriar/fibonacci-heap](https://github.com/gwtw/ts-fibonacci-heap) ([v2.0.9](https://github.com/gwtw/ts-fibonacci-heap/tree/v2.0.9)), distributed under the [MIT License](https://github.com/gwtw/ts-fibonacci-heap/blob/v2.0.9/LICENSE):
1358
-
1359
- ```
1360
- The MIT License (MIT)
1361
-
1362
- Copyright (c) 2014 Daniel Imms, http://www.growingwiththeweb.com
1363
-
1364
- Permission is hereby granted, free of charge, to any person obtaining a copy
1365
- of this software and associated documentation files (the "Software"), to deal
1366
- in the Software without restriction, including without limitation the rights
1367
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1368
- copies of the Software, and to permit persons to whom the Software is
1369
- furnished to do so, subject to the following conditions:
1370
-
1371
- The above copyright notice and this permission notice shall be included in
1372
- all copies or substantial portions of the Software.
1373
-
1374
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1375
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1376
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1377
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1378
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1379
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1380
- THE SOFTWARE.
1381
-
1382
- ```
1383
-
1384
- ### concat-stream
1385
-
1386
- This product includes source derived from [concat-stream](https://github.com/maxogden/concat-stream) ([v2.0.0](https://github.com/maxogden/concat-stream/tree/v2.0.0)), distributed under the [MIT License](https://github.com/maxogden/concat-stream/blob/v2.0.0/LICENSE):
1387
-
1388
- ```
1389
- The MIT License
1390
-
1391
- Copyright (c) 2013 Max Ogden
1392
-
1393
- Permission is hereby granted, free of charge,
1394
- to any person obtaining a copy of this software and
1395
- associated documentation files (the "Software"), to
1396
- deal in the Software without restriction, including
1397
- without limitation the rights to use, copy, modify,
1398
- merge, publish, distribute, sublicense, and/or sell
1399
- copies of the Software, and to permit persons to whom
1400
- the Software is furnished to do so,
1401
- subject to the following conditions:
1402
-
1403
- The above copyright notice and this permission notice
1404
- shall be included in all copies or substantial portions of the Software.
1405
-
1406
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1407
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
1408
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1409
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
1410
- ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1411
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1412
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1413
- ```
1414
-
1415
- ### https-proxy-agent
1416
-
1417
- This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) ([v7.0.6](https://github.com/TooTallNate/proxy-agents/tree/v7.0.6)), distributed under the [MIT License](https://github.com/TooTallNate/proxy-agents/blob/v7.0.6/LICENSE):
1418
-
1419
- ```
1420
- (The MIT License)
1421
-
1422
- Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
1423
-
1424
- Permission is hereby granted, free of charge, to any person obtaining
1425
- a copy of this software and associated documentation files (the
1426
- 'Software'), to deal in the Software without restriction, including
1427
- without limitation the rights to use, copy, modify, merge, publish,
1428
- distribute, sublicense, and/or sell copies of the Software, and to
1429
- permit persons to whom the Software is furnished to do so, subject to
1430
- the following conditions:
1431
-
1432
- The above copyright notice and this permission notice shall be
1433
- included in all copies or substantial portions of the Software.
1434
-
1435
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
1436
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1437
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1438
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
1439
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1440
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1441
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1442
- ```
1443
-
1444
- ### import-in-the-middle
1445
-
1446
- This product includes source derived from [import-in-the-middle](https://github.com/nodejs/import-in-the-middle) ([v1.13.0](https://github.com/nodejs/import-in-the-middle/tree/v1.13.0)), distributed under the [Apache-2.0 License](undefined):
1447
-
1448
- ```
1449
- undefined
1450
- ```
1451
-
1452
1481
  ### json-bigint
1453
1482
 
1454
1483
  This product includes source derived from [json-bigint](https://github.com/sidorares/json-bigint) ([v1.0.0](https://github.com/sidorares/json-bigint/tree/v1.0.0)), distributed under the [MIT License](https://github.com/sidorares/json-bigint/blob/v1.0.0/LICENSE):
package/lib/agent.js CHANGED
@@ -303,6 +303,10 @@ function Agent(config) {
303
303
  }
304
304
  util.inherits(Agent, EventEmitter)
305
305
 
306
+ Object.defineProperty(Agent.prototype, Symbol.toStringTag, {
307
+ value: 'Agent'
308
+ })
309
+
306
310
  /**
307
311
  * The agent is meant to only exist once per application, but the singleton is
308
312
  * managed by index.js. An agent will be created even if the agent's disabled by
@@ -492,6 +492,14 @@ defaultConfig.definition = () => ({
492
492
  formatter: boolean,
493
493
  default: true
494
494
  },
495
+ /**
496
+ * This flag dictates whether the agent attempts to read environment variables
497
+ * and invocation context to get info about the Azure Function called.
498
+ */
499
+ detect_azurefunction: {
500
+ formatter: boolean,
501
+ default: true
502
+ },
495
503
  /**
496
504
  * This flag dictates whether the agent attempts to read files
497
505
  * to get info about the container the process is running in.
@@ -1083,6 +1091,7 @@ defaultConfig.definition = () => ({
1083
1091
  }
1084
1092
  }
1085
1093
  },
1094
+
1086
1095
  /**
1087
1096
  * Controls the method of cross agent tracing in the agent.
1088
1097
  * Distributed tracing lets you see the path that a request takes through your
@@ -1109,8 +1118,41 @@ defaultConfig.definition = () => ({
1109
1118
  exclude_newrelic_header: {
1110
1119
  formatter: boolean,
1111
1120
  default: false
1121
+ },
1122
+
1123
+ sampler: {
1124
+ /**
1125
+ * When set to `always_on`, the sampled flag in the `traceparent` header
1126
+ * being set to "true" will result in the local transaction being sampled
1127
+ * with a priority value of "2". When set to `always_off`, the local
1128
+ * transaction will never be sampled. At the default setting, the sampling
1129
+ * decision will be determined according to the normal algorithm.
1130
+ *
1131
+ * This setting takes precedence over the `remote_parent_not_sampled`
1132
+ * setting.
1133
+ */
1134
+ remote_parent_sampled: {
1135
+ formatter: allowList.bind(null, ['always_on', 'always_off', 'default']),
1136
+ default: 'default'
1137
+ },
1138
+
1139
+ /**
1140
+ * When set to `always_on`, the local transaction will be sampled with a
1141
+ * priority of "2".
1142
+ * When set to `always_off`, the local transaction will never be sampled.
1143
+ * At the default setting, the sampling decision will be determined
1144
+ * according to the normal algorithm.
1145
+ *
1146
+ * This setting only affects decisions when the traceparent sampled flag
1147
+ * is set to 0.
1148
+ */
1149
+ remote_parent_not_sampled: {
1150
+ formatter: allowList.bind(null, ['always_on', 'always_off', 'default']),
1151
+ default: 'default'
1152
+ }
1112
1153
  }
1113
1154
  },
1155
+
1114
1156
  /**
1115
1157
  * Controls the use of cross-application tracing.
1116
1158
  *
@@ -0,0 +1,83 @@
1
+ /*
2
+ * Copyright 2025 New Relic Corporation. All rights reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ 'use strict'
7
+
8
+ // These mappings are compliant with v1.24.0 and have mappings with v1.20.0 of semantic conventions
9
+ // https://github.com/open-telemetry/semantic-conventions/blob/v1.24.0/docs/database/database-spans.md
10
+
11
+ const constants = require('../constants')
12
+ const createMapper = require('./utils')
13
+ const attrMappings = {
14
+ dynamoTable: {
15
+ attrs: [constants.ATTR_DYNAMO_TABLE_NAMES]
16
+ },
17
+ name: {
18
+ attrs: [constants.ATTR_DB_NAME],
19
+ mapping({ segment }) {
20
+ return (value) => segment.addAttribute('database_name', value)
21
+ }
22
+ },
23
+ operation: {
24
+ attrs: [constants.ATTR_DB_OPERATION]
25
+ },
26
+ port: {
27
+ attrs: [constants.ATTR_NETWORK_PEER_PORT, constants.ATTR_NET_PEER_PORT],
28
+ mapping({ segment }) {
29
+ return (value) => segment.addAttribute('port_path_or_id', value)
30
+ }
31
+ },
32
+ /*
33
+ * This attribute was collected in `onStart`
34
+ * and was passed to `ParsedStatement`. It adds
35
+ * this segment attribute as `sql` or `sql_obfuscated`
36
+ * and then when the span is built from segment
37
+ * re-assigns to `db.statement`. This needs
38
+ * to be skipped because it will be the raw value.
39
+ */
40
+ query: {
41
+ attrs: [constants.ATTR_DB_STATEMENT],
42
+ mapping() {
43
+ return () => {}
44
+ }
45
+ },
46
+ server: {
47
+ attrs: [constants.ATTR_SERVER_ADDRESS, constants.ATTR_NET_PEER_NAME],
48
+ mapping({ segment }) {
49
+ return (value) => segment.addAttribute('host', value)
50
+ }
51
+ },
52
+ system: {
53
+ attrs: [constants.ATTR_DB_SYSTEM],
54
+ mapping({ segment }) {
55
+ return (value) => segment.addAttribute('product', value)
56
+ }
57
+ },
58
+ table: {
59
+ attrs: [constants.ATTR_DB_SQL_TABLE, constants.ATTR_MONGODB_COLLECTION]
60
+ }
61
+ }
62
+
63
+ const { getAttr: dbAttr, attributesMapper } = createMapper(attrMappings)
64
+
65
+ function dbMapper({ segment }) {
66
+ const dbPortMapping = attributesMapper({ key: 'port', segment })
67
+ const dbServerMapping = attributesMapper({ key: 'server', segment })
68
+ const dbNameMapping = attributesMapper({ key: 'name', segment })
69
+ const dbSystemMapping = attributesMapper({ key: 'system', segment })
70
+ const dbQueryMapping = attributesMapper({ key: 'query' })
71
+ return {
72
+ ...dbPortMapping,
73
+ ...dbServerMapping,
74
+ ...dbNameMapping,
75
+ ...dbSystemMapping,
76
+ ...dbQueryMapping
77
+ }
78
+ }
79
+
80
+ module.exports = {
81
+ dbAttr,
82
+ dbMapper
83
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright 2025 New Relic Corporation. All rights reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ 'use strict'
7
+
8
+ const constants = require('../constants')
9
+ const createMapper = require('./utils')
10
+ const attrMappings = {
11
+ msg: {
12
+ attrs: [constants.EXCEPTION_MESSAGE, constants.EXCEPTION_TYPE]
13
+ },
14
+ stack: {
15
+ attrs: [constants.EXCEPTION_STACKTRACE]
16
+ },
17
+ }
18
+
19
+ const { getAttr: exceptionAttr } = createMapper(attrMappings)
20
+
21
+ module.exports = {
22
+ exceptionAttr
23
+ }
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright 2025 New Relic Corporation. All rights reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ 'use strict'
7
+
8
+ const constants = require('../constants')
9
+ const createMapper = require('./utils')
10
+ const attrMappings = {
11
+ name: {
12
+ attrs: [constants.ATTR_FAAS_INVOKED_NAME]
13
+ },
14
+ provider: {
15
+ attrs: [constants.ATTR_FAAS_INVOKED_PROVIDER]
16
+ },
17
+ region: {
18
+ attrs: [constants.ATTR_FAAS_INVOKED_REGION, constants.ATTR_AWS_REGION]
19
+ }
20
+ }
21
+ const { getAttr: faasAttr } = createMapper(attrMappings)
22
+
23
+ module.exports = {
24
+ faasAttr
25
+ }