newrelic 9.12.0 → 9.13.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 +18 -1
- package/README.md +1 -1
- package/THIRD_PARTY_NOTICES.md +215 -5
- package/api.js +23 -0
- package/lib/config/default.js +62 -0
- package/lib/instrumentation/core/http-outbound.js +6 -4
- package/package.json +3 -3
package/NEWS.md
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
1
|
-
### v9.
|
|
1
|
+
### v9.13.0 (2023-03-20)
|
|
2
|
+
|
|
3
|
+
* Updated http instrumentation to no longer remove the `x-new-relic-disable-dt` header when using AWS SDK v3. This was done to prevent the "The request signature we calculated does not match the signature you provided. Check your key and signing method." error from AWS SDK.
|
|
4
|
+
|
|
5
|
+
* Added an API method `setUserID` to provide an ability to associate a unique identifier with a transaction event, transaction trace and errors within transaction. The attribute will be `enduser.id`.
|
|
6
|
+
|
|
7
|
+
* Added default configuration for security agent.
|
|
8
|
+
|
|
9
|
+
### v9.12.1 (2023-03-15)
|
|
10
|
+
|
|
2
11
|
* Added ability to mark errors as expected when using `newrelic.noticeError`, by adding an optional boolean:
|
|
3
12
|
* `newrelic.noticeError(error, {customAttributes}, true|false)` when there are custom error attributes.
|
|
4
13
|
* `newrelic.noticeError(error, true|false)` if there are no custom error attributes.
|
|
5
14
|
* `expected` errors do not affect error metrics or Apdex.
|
|
15
|
+
|
|
16
|
+
* Added ability to disable distributed tracing for aws-sdk >= 3.290.0.
|
|
17
|
+
|
|
18
|
+
* Updated README header image to latest OSS office required images
|
|
19
|
+
|
|
6
20
|
* updated @grpc/grpc-js from 1.8.8 to 1.8.9
|
|
7
21
|
|
|
22
|
+
### v9.12.0 (2023-03-13)
|
|
23
|
+
* Release pipeline did not complete.
|
|
24
|
+
|
|
8
25
|
### v9.11.0 (2023-03-08)
|
|
9
26
|
* Added instrumentation for Prisma(`@prisma/client`).
|
|
10
27
|
* Miniumum supported version of `@prisma/client` is 4.0.0.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
<a href="https://opensource.newrelic.com/oss-category/#community-plus"><picture><source media="(prefers-color-scheme: dark)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/dark/Community_Plus.png"><source media="(prefers-color-scheme: light)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Plus.png"><img alt="New Relic Open Source community plus project banner." src="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Plus.png"></picture></a>
|
|
2
2
|
|
|
3
3
|
# New Relic's Node.js agent
|
|
4
4
|
[![npm status badge][1]][2] [![Server Smoke Tests][3]][4] [![Node Agent CI][5]][6] [![codecov][7]][8]
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -74,6 +74,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
74
74
|
**[optionalDependencies](#optionalDependencies)**
|
|
75
75
|
|
|
76
76
|
* [@contrast/fn-inspect](#contrastfn-inspect)
|
|
77
|
+
* [@newrelic/native-metrics](#newrelicnative-metrics)
|
|
77
78
|
|
|
78
79
|
**[Additional Licenses](#additional-licenses)**
|
|
79
80
|
|
|
@@ -84,7 +85,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
84
85
|
|
|
85
86
|
### @grpc/grpc-js
|
|
86
87
|
|
|
87
|
-
This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.
|
|
88
|
+
This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.8.12](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.8.12)), distributed under the [Apache-2.0 License](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.8.12/LICENSE):
|
|
88
89
|
|
|
89
90
|
```
|
|
90
91
|
Apache License
|
|
@@ -293,7 +294,7 @@ This product includes source derived from [@grpc/grpc-js](https://github.com/grp
|
|
|
293
294
|
|
|
294
295
|
### @grpc/proto-loader
|
|
295
296
|
|
|
296
|
-
This product includes source derived from [@grpc/proto-loader](https://github.com/grpc/grpc-node) ([v0.7.
|
|
297
|
+
This product includes source derived from [@grpc/proto-loader](https://github.com/grpc/grpc-node) ([v0.7.5](https://github.com/grpc/grpc-node/tree/v0.7.5)), distributed under the [Apache-2.0 License](https://github.com/grpc/grpc-node/blob/v0.7.5/LICENSE):
|
|
297
298
|
|
|
298
299
|
```
|
|
299
300
|
Apache License
|
|
@@ -502,7 +503,7 @@ This product includes source derived from [@grpc/proto-loader](https://github.co
|
|
|
502
503
|
|
|
503
504
|
### @newrelic/aws-sdk
|
|
504
505
|
|
|
505
|
-
This product includes source derived from [@newrelic/aws-sdk](https://github.com/newrelic/node-newrelic-aws-sdk) ([v5.0.
|
|
506
|
+
This product includes source derived from [@newrelic/aws-sdk](https://github.com/newrelic/node-newrelic-aws-sdk) ([v5.0.2](https://github.com/newrelic/node-newrelic-aws-sdk/tree/v5.0.2)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-newrelic-aws-sdk/blob/v5.0.2/LICENSE):
|
|
506
507
|
|
|
507
508
|
```
|
|
508
509
|
Apache License
|
|
@@ -710,7 +711,7 @@ This product includes source derived from [@newrelic/aws-sdk](https://github.com
|
|
|
710
711
|
|
|
711
712
|
### @newrelic/koa
|
|
712
713
|
|
|
713
|
-
This product includes source derived from [@newrelic/koa](https://github.com/newrelic/node-newrelic-koa) ([v7.
|
|
714
|
+
This product includes source derived from [@newrelic/koa](https://github.com/newrelic/node-newrelic-koa) ([v7.1.1](https://github.com/newrelic/node-newrelic-koa/tree/v7.1.1)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-newrelic-koa/blob/v7.1.1/LICENSE):
|
|
714
715
|
|
|
715
716
|
```
|
|
716
717
|
Apache License
|
|
@@ -1255,7 +1256,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
1255
1256
|
|
|
1256
1257
|
### readable-stream
|
|
1257
1258
|
|
|
1258
|
-
This product includes source derived from [readable-stream](https://github.com/nodejs/readable-stream) ([v3.6.
|
|
1259
|
+
This product includes source derived from [readable-stream](https://github.com/nodejs/readable-stream) ([v3.6.2](https://github.com/nodejs/readable-stream/tree/v3.6.2)), distributed under the [MIT License](https://github.com/nodejs/readable-stream/blob/v3.6.2/LICENSE):
|
|
1259
1260
|
|
|
1260
1261
|
```
|
|
1261
1262
|
Node.js is licensed for use as follows:
|
|
@@ -9452,6 +9453,215 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
9452
9453
|
|
|
9453
9454
|
```
|
|
9454
9455
|
|
|
9456
|
+
### @newrelic/native-metrics
|
|
9457
|
+
|
|
9458
|
+
This product includes source derived from [@newrelic/native-metrics](https://github.com/newrelic/node-native-metrics) ([v9.0.0](https://github.com/newrelic/node-native-metrics/tree/v9.0.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-native-metrics/blob/v9.0.0/LICENSE):
|
|
9459
|
+
|
|
9460
|
+
```
|
|
9461
|
+
Apache License
|
|
9462
|
+
Version 2.0, January 2004
|
|
9463
|
+
http://www.apache.org/licenses/
|
|
9464
|
+
|
|
9465
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
9466
|
+
|
|
9467
|
+
1. Definitions.
|
|
9468
|
+
|
|
9469
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
9470
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
9471
|
+
|
|
9472
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
9473
|
+
the copyright owner that is granting the License.
|
|
9474
|
+
|
|
9475
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
9476
|
+
other entities that control, are controlled by, or are under common
|
|
9477
|
+
control with that entity. For the purposes of this definition,
|
|
9478
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
9479
|
+
direction or management of such entity, whether by contract or
|
|
9480
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
9481
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
9482
|
+
|
|
9483
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
9484
|
+
exercising permissions granted by this License.
|
|
9485
|
+
|
|
9486
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
9487
|
+
including but not limited to software source code, documentation
|
|
9488
|
+
source, and configuration files.
|
|
9489
|
+
|
|
9490
|
+
"Object" form shall mean any form resulting from mechanical
|
|
9491
|
+
transformation or translation of a Source form, including but
|
|
9492
|
+
not limited to compiled object code, generated documentation,
|
|
9493
|
+
and conversions to other media types.
|
|
9494
|
+
|
|
9495
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
9496
|
+
Object form, made available under the License, as indicated by a
|
|
9497
|
+
copyright notice that is included in or attached to the work
|
|
9498
|
+
(an example is provided in the Appendix below).
|
|
9499
|
+
|
|
9500
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
9501
|
+
form, that is based on (or derived from) the Work and for which the
|
|
9502
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
9503
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
9504
|
+
of this License, Derivative Works shall not include works that remain
|
|
9505
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
9506
|
+
the Work and Derivative Works thereof.
|
|
9507
|
+
|
|
9508
|
+
"Contribution" shall mean any work of authorship, including
|
|
9509
|
+
the original version of the Work and any modifications or additions
|
|
9510
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
9511
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
9512
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
9513
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
9514
|
+
means any form of electronic, verbal, or written communication sent
|
|
9515
|
+
to the Licensor or its representatives, including but not limited to
|
|
9516
|
+
communication on electronic mailing lists, source code control systems,
|
|
9517
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
9518
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
9519
|
+
excluding communication that is conspicuously marked or otherwise
|
|
9520
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
9521
|
+
|
|
9522
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
9523
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
9524
|
+
subsequently incorporated within the Work.
|
|
9525
|
+
|
|
9526
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
9527
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
9528
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
9529
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
9530
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
9531
|
+
Work and such Derivative Works in Source or Object form.
|
|
9532
|
+
|
|
9533
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
9534
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
9535
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
9536
|
+
(except as stated in this section) patent license to make, have made,
|
|
9537
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
9538
|
+
where such license applies only to those patent claims licensable
|
|
9539
|
+
by such Contributor that are necessarily infringed by their
|
|
9540
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
9541
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
9542
|
+
institute patent litigation against any entity (including a
|
|
9543
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
9544
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
9545
|
+
or contributory patent infringement, then any patent licenses
|
|
9546
|
+
granted to You under this License for that Work shall terminate
|
|
9547
|
+
as of the date such litigation is filed.
|
|
9548
|
+
|
|
9549
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
9550
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
9551
|
+
modifications, and in Source or Object form, provided that You
|
|
9552
|
+
meet the following conditions:
|
|
9553
|
+
|
|
9554
|
+
(a) You must give any other recipients of the Work or
|
|
9555
|
+
Derivative Works a copy of this License; and
|
|
9556
|
+
|
|
9557
|
+
(b) You must cause any modified files to carry prominent notices
|
|
9558
|
+
stating that You changed the files; and
|
|
9559
|
+
|
|
9560
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
9561
|
+
that You distribute, all copyright, patent, trademark, and
|
|
9562
|
+
attribution notices from the Source form of the Work,
|
|
9563
|
+
excluding those notices that do not pertain to any part of
|
|
9564
|
+
the Derivative Works; and
|
|
9565
|
+
|
|
9566
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
9567
|
+
distribution, then any Derivative Works that You distribute must
|
|
9568
|
+
include a readable copy of the attribution notices contained
|
|
9569
|
+
within such NOTICE file, excluding those notices that do not
|
|
9570
|
+
pertain to any part of the Derivative Works, in at least one
|
|
9571
|
+
of the following places: within a NOTICE text file distributed
|
|
9572
|
+
as part of the Derivative Works; within the Source form or
|
|
9573
|
+
documentation, if provided along with the Derivative Works; or,
|
|
9574
|
+
within a display generated by the Derivative Works, if and
|
|
9575
|
+
wherever such third-party notices normally appear. The contents
|
|
9576
|
+
of the NOTICE file are for informational purposes only and
|
|
9577
|
+
do not modify the License. You may add Your own attribution
|
|
9578
|
+
notices within Derivative Works that You distribute, alongside
|
|
9579
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
9580
|
+
that such additional attribution notices cannot be construed
|
|
9581
|
+
as modifying the License.
|
|
9582
|
+
|
|
9583
|
+
You may add Your own copyright statement to Your modifications and
|
|
9584
|
+
may provide additional or different license terms and conditions
|
|
9585
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
9586
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
9587
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
9588
|
+
the conditions stated in this License.
|
|
9589
|
+
|
|
9590
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
9591
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
9592
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
9593
|
+
this License, without any additional terms or conditions.
|
|
9594
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
9595
|
+
the terms of any separate license agreement you may have executed
|
|
9596
|
+
with Licensor regarding such Contributions.
|
|
9597
|
+
|
|
9598
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
9599
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
9600
|
+
except as required for reasonable and customary use in describing the
|
|
9601
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
9602
|
+
|
|
9603
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
9604
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
9605
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
9606
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
9607
|
+
implied, including, without limitation, any warranties or conditions
|
|
9608
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
9609
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
9610
|
+
appropriateness of using or redistributing the Work and assume any
|
|
9611
|
+
risks associated with Your exercise of permissions under this License.
|
|
9612
|
+
|
|
9613
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
9614
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
9615
|
+
unless required by applicable law (such as deliberate and grossly
|
|
9616
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
9617
|
+
liable to You for damages, including any direct, indirect, special,
|
|
9618
|
+
incidental, or consequential damages of any character arising as a
|
|
9619
|
+
result of this License or out of the use or inability to use the
|
|
9620
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
9621
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
9622
|
+
other commercial damages or losses), even if such Contributor
|
|
9623
|
+
has been advised of the possibility of such damages.
|
|
9624
|
+
|
|
9625
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
9626
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
9627
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
9628
|
+
or other liability obligations and/or rights consistent with this
|
|
9629
|
+
License. However, in accepting such obligations, You may act only
|
|
9630
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
9631
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
9632
|
+
defend, and hold each Contributor harmless for any liability
|
|
9633
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
9634
|
+
of your accepting any such warranty or additional liability.
|
|
9635
|
+
|
|
9636
|
+
END OF TERMS AND CONDITIONS
|
|
9637
|
+
|
|
9638
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
9639
|
+
|
|
9640
|
+
To apply the Apache License to your work, attach the following
|
|
9641
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
9642
|
+
replaced with your own identifying information. (Don't include
|
|
9643
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
9644
|
+
comment syntax for the file format. We also recommend that a
|
|
9645
|
+
file or class name and description of purpose be included on the
|
|
9646
|
+
same "printed page" as the copyright notice for easier
|
|
9647
|
+
identification within third-party archives.
|
|
9648
|
+
|
|
9649
|
+
Copyright [yyyy] [name of copyright owner]
|
|
9650
|
+
|
|
9651
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
9652
|
+
you may not use this file except in compliance with the License.
|
|
9653
|
+
You may obtain a copy of the License at
|
|
9654
|
+
|
|
9655
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9656
|
+
|
|
9657
|
+
Unless required by applicable law or agreed to in writing, software
|
|
9658
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9659
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9660
|
+
See the License for the specific language governing permissions and
|
|
9661
|
+
limitations under the License.
|
|
9662
|
+
|
|
9663
|
+
```
|
|
9664
|
+
|
|
9455
9665
|
## Additional Licenses
|
|
9456
9666
|
|
|
9457
9667
|
### Symantec
|
package/api.js
CHANGED
|
@@ -28,6 +28,7 @@ const ATTR_DEST = require('./lib/config/attribute-filter').DESTINATIONS
|
|
|
28
28
|
const MODULE_TYPE = require('./lib/shim/constants').MODULE_TYPE
|
|
29
29
|
const NAMES = require('./lib/metrics/names')
|
|
30
30
|
const obfuscate = require('./lib/util/sql/obfuscate')
|
|
31
|
+
const { DESTINATIONS } = require('./lib/config/attribute-filter')
|
|
31
32
|
|
|
32
33
|
/*
|
|
33
34
|
*
|
|
@@ -1694,6 +1695,28 @@ API.prototype.obfuscateSql = function obfuscateSql(sql, dialect) {
|
|
|
1694
1695
|
return obfuscate(sql, dialect)
|
|
1695
1696
|
}
|
|
1696
1697
|
|
|
1698
|
+
/**
|
|
1699
|
+
* Assigns `enduser.id` attribute on transaction and trace events. It will also
|
|
1700
|
+
* assign the attribute to errors if they occur within a transaction.
|
|
1701
|
+
*
|
|
1702
|
+
* @param {string} id a unique identifier used to set the `enduser.id` attribute
|
|
1703
|
+
*/
|
|
1704
|
+
API.prototype.setUserID = function setUserID(id) {
|
|
1705
|
+
const metric = this.agent.metrics.getOrCreateMetric(NAMES.SUPPORTABILITY.API + '/setUserID')
|
|
1706
|
+
metric.incrementCallCount()
|
|
1707
|
+
|
|
1708
|
+
const transaction = this.agent.tracer.getTransaction()
|
|
1709
|
+
|
|
1710
|
+
if (!(id && transaction)) {
|
|
1711
|
+
logger.warn(
|
|
1712
|
+
'User id is empty or not in a transaction, not assigning `enduser.id` attribute to transaction events, trace events, and/or errors.'
|
|
1713
|
+
)
|
|
1714
|
+
return
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
transaction.trace.attributes.addAttribute(DESTINATIONS.TRANS_COMMON, 'enduser.id', id)
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1697
1720
|
/**
|
|
1698
1721
|
* Function for removing invalid attribute key/value pairs from an object
|
|
1699
1722
|
*
|
package/lib/config/default.js
CHANGED
|
@@ -1256,6 +1256,68 @@ defaultConfig.definition = () => ({
|
|
|
1256
1256
|
default: ''
|
|
1257
1257
|
}
|
|
1258
1258
|
}
|
|
1259
|
+
},
|
|
1260
|
+
/**
|
|
1261
|
+
* Security agent configurations
|
|
1262
|
+
*/
|
|
1263
|
+
security: {
|
|
1264
|
+
/**
|
|
1265
|
+
* Toggles the generation of security events by the security agent.
|
|
1266
|
+
*/
|
|
1267
|
+
enabled: {
|
|
1268
|
+
formatter: boolean,
|
|
1269
|
+
default: false
|
|
1270
|
+
},
|
|
1271
|
+
|
|
1272
|
+
/**
|
|
1273
|
+
* Flag to tell the Node.js agent to load the security agent.
|
|
1274
|
+
* This property is read only once at application start.
|
|
1275
|
+
*/
|
|
1276
|
+
agent: {
|
|
1277
|
+
enabled: {
|
|
1278
|
+
formatter: boolean,
|
|
1279
|
+
default: false
|
|
1280
|
+
}
|
|
1281
|
+
},
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* Security agent provides two modes: IAST and RASP. Default is IAST.
|
|
1285
|
+
*/
|
|
1286
|
+
mode: {
|
|
1287
|
+
formatter: allowList.bind(null, ['IAST', 'RASP']),
|
|
1288
|
+
default: 'IAST'
|
|
1289
|
+
},
|
|
1290
|
+
|
|
1291
|
+
/**
|
|
1292
|
+
* Security agent validator URL. Must be prefixed with wss://.
|
|
1293
|
+
*/
|
|
1294
|
+
validator_service_url: {
|
|
1295
|
+
default: 'wss://csec.nr-data.net'
|
|
1296
|
+
},
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* Provide ability to toggle sending security events for the following rules.
|
|
1300
|
+
*/
|
|
1301
|
+
detection: {
|
|
1302
|
+
rci: {
|
|
1303
|
+
enabled: {
|
|
1304
|
+
formatter: boolean,
|
|
1305
|
+
default: true
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
rxss: {
|
|
1309
|
+
enabled: {
|
|
1310
|
+
formatter: boolean,
|
|
1311
|
+
default: true
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1314
|
+
deserialization: {
|
|
1315
|
+
enabled: {
|
|
1316
|
+
formatter: boolean,
|
|
1317
|
+
default: true
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1259
1321
|
}
|
|
1260
1322
|
})
|
|
1261
1323
|
|
|
@@ -143,7 +143,7 @@ function instrumentRequest(agent, opts, makeRequest, hostname, segment) {
|
|
|
143
143
|
outboundHeaders[NEWRELIC_SYNTHETICS_HEADER] = transaction.syntheticsHeader
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
maybeAddDtCatHeaders(agent, transaction, outboundHeaders,
|
|
146
|
+
maybeAddDtCatHeaders(agent, transaction, outboundHeaders, opts?.headers)
|
|
147
147
|
opts.headers = assignOutgoingHeaders(opts.headers, outboundHeaders)
|
|
148
148
|
|
|
149
149
|
const request = applySegment(opts, makeRequest, hostname, segment)
|
|
@@ -160,13 +160,15 @@ function instrumentRequest(agent, opts, makeRequest, hostname, segment) {
|
|
|
160
160
|
* @param {Agent} agent Node.js agent
|
|
161
161
|
* @param {Transaction} transaction active transaction
|
|
162
162
|
* @param {object} outboundHeaders headers that are getting attached to external http call
|
|
163
|
-
* @param {
|
|
163
|
+
* @param {object} headers headers for http request
|
|
164
164
|
*/
|
|
165
165
|
// TODO: abstract header logic shared with TransactionShim#insertCATRequestHeaders
|
|
166
|
-
function maybeAddDtCatHeaders(agent, transaction, outboundHeaders,
|
|
166
|
+
function maybeAddDtCatHeaders(agent, transaction, outboundHeaders, headers = {}) {
|
|
167
167
|
if (agent.config.distributed_tracing.enabled) {
|
|
168
|
-
if (
|
|
168
|
+
if (!!(headers[symbols.disableDT] || headers['x-new-relic-disable-dt'])) {
|
|
169
169
|
logger.trace('Distributed tracing disabled by instrumentation.')
|
|
170
|
+
// do not try to delete this header because AWS will fail with signature fail
|
|
171
|
+
// See: https://github.com/newrelic/node-newrelic/issues/1549
|
|
170
172
|
} else {
|
|
171
173
|
transaction.insertDistributedTraceHeaders(outboundHeaders)
|
|
172
174
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newrelic",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.13.0",
|
|
4
4
|
"author": "New Relic Node.js agent team <nodejs@newrelic.com>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"contributors": [
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
"newrelic-naming-rules": "./bin/test-naming-rules.js"
|
|
180
180
|
},
|
|
181
181
|
"dependencies": {
|
|
182
|
-
"@grpc/grpc-js": "^1.8.
|
|
182
|
+
"@grpc/grpc-js": "^1.8.10",
|
|
183
183
|
"@grpc/proto-loader": "^0.7.5",
|
|
184
184
|
"@newrelic/aws-sdk": "^5.0.2",
|
|
185
185
|
"@newrelic/koa": "^7.1.1",
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
"https-proxy-agent": "^5.0.0",
|
|
190
190
|
"json-bigint": "^1.0.0",
|
|
191
191
|
"json-stringify-safe": "^5.0.0",
|
|
192
|
-
"readable-stream": "^3.6.
|
|
192
|
+
"readable-stream": "^3.6.1",
|
|
193
193
|
"semver": "^5.3.0",
|
|
194
194
|
"winston-transport": "^4.5.0"
|
|
195
195
|
},
|