newrelic 10.0.0 → 10.1.1

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,56 @@
1
+ ### v10.1.1 (2023-05-15)
2
+
3
+ #### Bug Fixes
4
+
5
+ * updated prisma instrumentation to properly parse database connection strings that work across all versions of prisma ([#1634](https://github.com/newrelic/node-newrelic/pull/1634)) ([b2101fd](https://github.com/newrelic/node-newrelic/commit/b2101fd606af43093b9caf525dbef9e122f6ca7e))
6
+
7
+ #### Code Refactoring
8
+
9
+ * **run-versioned-tests.sh:** added ability to run versioned tests and skip collecting coverage by passing in `SKIP_C8` env var to the job. ([#1621](https://github.com/newrelic/node-newrelic/pull/1621)) ([0ba9dcb](https://github.com/newrelic/node-newrelic/commit/0ba9dcb38654a8363732c558a0310df7bd032ab1))
10
+
11
+ #### Documentation
12
+
13
+ * update Contribution Guide with Conventional Commit info ([#1635](https://github.com/newrelic/node-newrelic/pull/1635)) ([f1a00e5](https://github.com/newrelic/node-newrelic/commit/f1a00e5cc4c907d046bc1f5205082761f620ecf1))
14
+
15
+ #### Miscellaneous Chores
16
+
17
+ * pin testdobule to 3.17.2 as 3.18.0 no longer works on node 14 ([#1628](https://github.com/newrelic/node-newrelic/pull/1628)) ([d68bd9f](https://github.com/newrelic/node-newrelic/commit/d68bd9fa3f6af974b5c978b61732491294b2e5cf))
18
+ * remove release-please workflow and scripts ([#1624](https://github.com/newrelic/node-newrelic/pull/1624)) ([80f7eb8](https://github.com/newrelic/node-newrelic/commit/80f7eb88a4f71e44b4413e3b39c5766046e9ec8a))
19
+
20
+ #### Tests
21
+
22
+ * pin prisma to 4.14.0 until we fix instrumentation ([#1631](https://github.com/newrelic/node-newrelic/pull/1631)) ([a60659d](https://github.com/newrelic/node-newrelic/commit/a60659d6929be559854d01c83028d5acfbcd3603))
23
+ * **scripts:** fix failing changelog unit test ([#1626](https://github.com/newrelic/node-newrelic/pull/1626)) ([08f48b3](https://github.com/newrelic/node-newrelic/commit/08f48b33ce1c402e4a8c42c9c02e5b22e6cbe02a))
24
+ * **config:** increase test coverage ([#1625](https://github.com/newrelic/node-newrelic/pull/1625)) ([67f39d8](https://github.com/newrelic/node-newrelic/commit/67f39d8dc89e627d27c7fd9a9cee1ac14ab816e3))
25
+ * **config:** revert changes to lib/config/index.js ([#1630](https://github.com/newrelic/node-newrelic/pull/1630)) ([fea1068](https://github.com/newrelic/node-newrelic/commit/fea1068281d9ce8ae966b47923aba6ecef894bc8))
26
+
27
+ #### Continuous Integration
28
+
29
+ * changed versioned tests script to use SKIP_C8 ([#1621](https://github.com/newrelic/node-newrelic/pull/1621)) ([83e95e3](https://github.com/newrelic/node-newrelic/commit/83e95e31365cd4d48c7ee1dbb789b58231841e41))
30
+ * add --use-new-release functionality ([#1633](https://github.com/newrelic/node-newrelic/pull/1633)) ([d97b421](https://github.com/newrelic/node-newrelic/commit/d97b421be5acda61f0212fd49a433e58811fc27c))
31
+ * add ability to generate release notes from conventional commits ([#1623](https://github.com/newrelic/node-newrelic/pull/1623)) ([880a88b](https://github.com/newrelic/node-newrelic/commit/880a88b6e816b8cd2694a16bfe74b37fc42231ab))
32
+ * **create-docs-pr:** Set username/email to machine user by default ([#1627](https://github.com/newrelic/node-newrelic/pull/1627)) ([3870a1f](https://github.com/newrelic/node-newrelic/commit/3870a1ff9979e6afde669c69c443d657f1f37af9))
33
+ * fix issue with missing type in the prep-release ([#1638](https://github.com/newrelic/node-newrelic/pull/1638)) ([9a906e8](https://github.com/newrelic/node-newrelic/commit/9a906e8e833753808ab779fdf4074aa7c90cd1fa))
34
+ * update prep-release to fetch entire history of caller repo ([#1641](https://github.com/newrelic/node-newrelic/pull/1641)) ([428174a](https://github.com/newrelic/node-newrelic/commit/428174afd6cca482382101316b4d03c2f96f9f95))
35
+ * update to conditionally add CLI flag to prep-release ([#1640](https://github.com/newrelic/node-newrelic/pull/1640)) ([b167c93](https://github.com/newrelic/node-newrelic/commit/b167c932659cbba073827a6936b65c0aeee98d8a))
36
+
37
+ ### v10.1.0 (2023-05-04)
38
+
39
+ * Added batching and compression to infinite tracing.
40
+ * These options are on by default.
41
+ * To restore uncompressed spans set `config.infinite_tracing.compression` to `false`.
42
+ * To send single spans vs batches set `config.infinite_tracing.batching` to `false`.
43
+ * The environment variables for these new configurations are: `NEW_RELIC_INFINITE_TRACING_BATCHING` and `NEW_RELIC_INFINITE_TRACING_COMPRESSION`.
44
+
45
+ * Added support to record Nest.js error stack traces.
46
+ * Nest.js is officially supported via underlying instrumentation of express or fastify.
47
+
48
+ * Added job to create a release notes PR in the post-release workflow.
49
+
50
+ * Removed request library and updated helper to use http/https to make requests in tests.
51
+
52
+ * Reduced cognitive complexity in lib/serverless/aws-lambda.js
53
+
1
54
  ### v10.0.0 (2023-04-19)
2
55
 
3
56
  * **BREAKING** - Updated the default of `config.transaction_tracer.record_sql` from `off` to `obfuscated`. This means that sql statements will be captured but obfuscated.
@@ -16,6 +16,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
16
16
 
17
17
  * [@grpc/grpc-js](#grpcgrpc-js)
18
18
  * [@grpc/proto-loader](#grpcproto-loader)
19
+ * [@mrleebo/prisma-ast](#mrleeboprisma-ast)
19
20
  * [@newrelic/aws-sdk](#newrelicaws-sdk)
20
21
  * [@newrelic/koa](#newrelickoa)
21
22
  * [@newrelic/superagent](#newrelicsuperagent)
@@ -42,6 +43,9 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
42
43
  * [chai](#chai)
43
44
  * [clean-jsdoc-theme](#clean-jsdoc-theme)
44
45
  * [commander](#commander)
46
+ * [conventional-changelog-conventionalcommits](#conventional-changelog-conventionalcommits)
47
+ * [conventional-changelog-writer](#conventional-changelog-writer)
48
+ * [conventional-commits-parser](#conventional-commits-parser)
45
49
  * [eslint-config-prettier](#eslint-config-prettier)
46
50
  * [eslint-plugin-disable](#eslint-plugin-disable)
47
51
  * [eslint-plugin-header](#eslint-plugin-header)
@@ -51,6 +55,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
51
55
  * [eslint-plugin-sonarjs](#eslint-plugin-sonarjs)
52
56
  * [eslint](#eslint)
53
57
  * [express](#express)
58
+ * [git-raw-commits](#git-raw-commits)
54
59
  * [glob](#glob)
55
60
  * [got](#got)
56
61
  * [husky](#husky)
@@ -62,7 +67,6 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
62
67
  * [prettier](#prettier)
63
68
  * [proxyquire](#proxyquire)
64
69
  * [q](#q)
65
- * [request](#request)
66
70
  * [rimraf](#rimraf)
67
71
  * [should](#should)
68
72
  * [sinon](#sinon)
@@ -501,6 +505,34 @@ This product includes source derived from [@grpc/proto-loader](https://github.co
501
505
 
502
506
  ```
503
507
 
508
+ ### @mrleebo/prisma-ast
509
+
510
+ This product includes source derived from [@mrleebo/prisma-ast](https://github.com/MrLeebo/prisma-ast) ([v0.5.2](https://github.com/MrLeebo/prisma-ast/tree/v0.5.2)), distributed under the [MIT License](https://github.com/MrLeebo/prisma-ast/blob/v0.5.2/LICENSE):
511
+
512
+ ```
513
+ MIT License
514
+
515
+ Copyright (c) 2021 Jeremy Liberman
516
+
517
+ Permission is hereby granted, free of charge, to any person obtaining a copy
518
+ of this software and associated documentation files (the "Software"), to deal
519
+ in the Software without restriction, including without limitation the rights
520
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
521
+ copies of the Software, and to permit persons to whom the Software is
522
+ furnished to do so, subject to the following conditions:
523
+
524
+ The above copyright notice and this permission notice shall be included in all
525
+ copies or substantial portions of the Software.
526
+
527
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
528
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
529
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
530
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
531
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
532
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
533
+ SOFTWARE.
534
+ ```
535
+
504
536
  ### @newrelic/aws-sdk
505
537
 
506
538
  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):
@@ -2234,6 +2266,87 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2234
2266
 
2235
2267
  ```
2236
2268
 
2269
+ ### conventional-changelog-conventionalcommits
2270
+
2271
+ This product includes source derived from [conventional-changelog-conventionalcommits](https://github.com/conventional-changelog/conventional-changelog) ([v5.0.0](https://github.com/conventional-changelog/conventional-changelog/tree/v5.0.0)), distributed under the [ISC License](https://github.com/conventional-changelog/conventional-changelog/blob/v5.0.0/LICENSE.md):
2272
+
2273
+ ```
2274
+ ### ISC License
2275
+
2276
+ Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
2277
+
2278
+ Permission to use, copy, modify, and/or distribute this software for any
2279
+ purpose with or without fee is hereby granted, provided that the above
2280
+ copyright notice and this permission notice appear in all copies.
2281
+
2282
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2283
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
2284
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2285
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2286
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2287
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2288
+ PERFORMANCE OF THIS SOFTWARE.
2289
+
2290
+ ```
2291
+
2292
+ ### conventional-changelog-writer
2293
+
2294
+ This product includes source derived from [conventional-changelog-writer](https://github.com/conventional-changelog/conventional-changelog) ([v5.0.1](https://github.com/conventional-changelog/conventional-changelog/tree/v5.0.1)), distributed under the [MIT License](https://github.com/conventional-changelog/conventional-changelog/blob/v5.0.1/LICENSE.md):
2295
+
2296
+ ```
2297
+ ### MIT License
2298
+
2299
+ Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
2300
+
2301
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
2302
+ this software and associated documentation files (the "Software"), to deal in
2303
+ the Software without restriction, including without limitation the rights to
2304
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
2305
+ of the Software, and to permit persons to whom the Software is furnished to do
2306
+ so, subject to the following conditions:
2307
+
2308
+ The above copyright notice and this permission notice shall be included in all
2309
+ copies or substantial portions of the Software.
2310
+
2311
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2312
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2313
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2314
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2315
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2316
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2317
+ SOFTWARE.
2318
+
2319
+ ```
2320
+
2321
+ ### conventional-commits-parser
2322
+
2323
+ This product includes source derived from [conventional-commits-parser](https://github.com/conventional-changelog/conventional-changelog) ([v3.2.4](https://github.com/conventional-changelog/conventional-changelog/tree/v3.2.4)), distributed under the [MIT License](https://github.com/conventional-changelog/conventional-changelog/blob/v3.2.4/LICENSE.md):
2324
+
2325
+ ```
2326
+ ### MIT License
2327
+
2328
+ Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
2329
+
2330
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
2331
+ this software and associated documentation files (the "Software"), to deal in
2332
+ the Software without restriction, including without limitation the rights to
2333
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
2334
+ of the Software, and to permit persons to whom the Software is furnished to do
2335
+ so, subject to the following conditions:
2336
+
2337
+ The above copyright notice and this permission notice shall be included in all
2338
+ copies or substantial portions of the Software.
2339
+
2340
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2341
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2342
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2343
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2344
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2345
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2346
+ SOFTWARE.
2347
+
2348
+ ```
2349
+
2237
2350
  ### eslint-config-prettier
2238
2351
 
2239
2352
  This product includes source derived from [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) ([v8.5.0](https://github.com/prettier/eslint-config-prettier/tree/v8.5.0)), distributed under the [MIT License](https://github.com/prettier/eslint-config-prettier/blob/v8.5.0/LICENSE):
@@ -2632,6 +2745,35 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2632
2745
 
2633
2746
  ```
2634
2747
 
2748
+ ### git-raw-commits
2749
+
2750
+ This product includes source derived from [git-raw-commits](https://github.com/conventional-changelog/conventional-changelog) ([v2.0.11](https://github.com/conventional-changelog/conventional-changelog/tree/v2.0.11)), distributed under the [MIT License](https://github.com/conventional-changelog/conventional-changelog/blob/v2.0.11/LICENSE.md):
2751
+
2752
+ ```
2753
+ ### MIT License
2754
+
2755
+ Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
2756
+
2757
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
2758
+ this software and associated documentation files (the "Software"), to deal in
2759
+ the Software without restriction, including without limitation the rights to
2760
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
2761
+ of the Software, and to permit persons to whom the Software is furnished to do
2762
+ so, subject to the following conditions:
2763
+
2764
+ The above copyright notice and this permission notice shall be included in all
2765
+ copies or substantial portions of the Software.
2766
+
2767
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2768
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2769
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2770
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2771
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2772
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2773
+ SOFTWARE.
2774
+
2775
+ ```
2776
+
2635
2777
  ### glob
2636
2778
 
2637
2779
  This product includes source derived from [glob](https://github.com/isaacs/node-glob) ([v7.2.3](https://github.com/isaacs/node-glob/tree/v7.2.3)), distributed under the [ISC License](https://github.com/isaacs/node-glob/blob/v7.2.3/LICENSE):
@@ -9165,68 +9307,6 @@ IN THE SOFTWARE.
9165
9307
 
9166
9308
  ```
9167
9309
 
9168
- ### request
9169
-
9170
- This product includes source derived from [request](https://github.com/request/request) ([v2.88.2](https://github.com/request/request/tree/v2.88.2)), distributed under the [Apache-2.0 License](https://github.com/request/request/blob/v2.88.2/LICENSE):
9171
-
9172
- ```
9173
- Apache License
9174
-
9175
- Version 2.0, January 2004
9176
-
9177
- http://www.apache.org/licenses/
9178
-
9179
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
9180
-
9181
- 1. Definitions.
9182
-
9183
- "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
9184
-
9185
- "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
9186
-
9187
- "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
9188
-
9189
- "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
9190
-
9191
- "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
9192
-
9193
- "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
9194
-
9195
- "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
9196
-
9197
- "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
9198
-
9199
- "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
9200
-
9201
- "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
9202
-
9203
- 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
9204
-
9205
- 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
9206
-
9207
- 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
9208
-
9209
- You must give any other recipients of the Work or Derivative Works a copy of this License; and
9210
-
9211
- You must cause any modified files to carry prominent notices stating that You changed the files; and
9212
-
9213
- You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
9214
-
9215
- If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
9216
-
9217
- 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
9218
-
9219
- 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
9220
-
9221
- 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
9222
-
9223
- 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9224
-
9225
- 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
9226
-
9227
- END OF TERMS AND CONDITIONS
9228
- ```
9229
-
9230
9310
  ### rimraf
9231
9311
 
9232
9312
  This product includes source derived from [rimraf](https://github.com/isaacs/rimraf) ([v2.7.1](https://github.com/isaacs/rimraf/tree/v2.7.1)), distributed under the [ISC License](https://github.com/isaacs/rimraf/blob/v2.7.1/LICENSE):
@@ -9366,7 +9446,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9366
9446
 
9367
9447
  ### testdouble
9368
9448
 
9369
- This product includes source derived from [testdouble](https://github.com/testdouble/testdouble.js) ([v3.16.6](https://github.com/testdouble/testdouble.js/tree/v3.16.6)), distributed under the [MIT License](https://github.com/testdouble/testdouble.js/blob/v3.16.6/LICENSE.txt):
9449
+ This product includes source derived from [testdouble](https://github.com/testdouble/testdouble.js) ([v3.17.2](https://github.com/testdouble/testdouble.js/tree/v3.17.2)), distributed under the [MIT License](https://github.com/testdouble/testdouble.js/blob/v3.17.2/LICENSE.txt):
9370
9450
 
9371
9451
  ```
9372
9452
  The MIT License (MIT)
@@ -23,10 +23,10 @@ class ServerlessCollector {
23
23
  * Constructs a new serverless collector instance with the give agent.
24
24
  *
25
25
  * @class
26
- * @param pipePath
27
26
  * @classdesc
28
27
  * A helper class for wrapping modules with segments
29
28
  * @param {Agent} agent - The agent this collector will use
29
+ * @param {string} pipePath path of the named pipe to the Lambda extension, if it's enabled
30
30
  */
31
31
  constructor(agent, pipePath) {
32
32
  this._agent = agent
@@ -45,7 +45,7 @@ class ServerlessCollector {
45
45
  /**
46
46
  * Sets the ARN to be sent up in the metadata.
47
47
  *
48
- * @param arn
48
+ * @param {string} arn Amazon Resource Name of the function
49
49
  */
50
50
  setLambdaArn(arn) {
51
51
  this.metadata.arn = arn
@@ -54,7 +54,7 @@ class ServerlessCollector {
54
54
  /**
55
55
  * Sets the function_version to be sent up in the metadata.
56
56
  *
57
- * @param function_version
57
+ * @param {string} function_version version indicator for Lambda function
58
58
  */
59
59
  setLambdaFunctionVersion(function_version) {
60
60
  this.metadata.function_version = function_version
@@ -84,7 +84,7 @@ class ServerlessCollector {
84
84
  /**
85
85
  * There is nothing to actually restart for serverless, so we do nothing.
86
86
  *
87
- * @param cb
87
+ * @param {Function} cb callback function, if any
88
88
  */
89
89
  restart(cb) {
90
90
  setImmediate(cb, null, CollectorResponse.success(null))
@@ -216,6 +216,7 @@ class ServerlessCollector {
216
216
  * Constructs, serializes, and prints the final consolidated payload to stdout.
217
217
  *
218
218
  * @param {Function} cb The callback to invoke when finished.
219
+ * @returns {boolean} indicating if callback was defined and successfully executed
219
220
  */
220
221
  flushPayload(cb) {
221
222
  if (!this.enabled) {
@@ -270,7 +271,8 @@ class ServerlessCollector {
270
271
  /**
271
272
  * Writes payload to pipe
272
273
  *
273
- * @param payload
274
+ * @param {string} payload serialized stringified-JSON payload to flush
275
+ * @returns {boolean} whether or not flush was successful
274
276
  */
275
277
  flushToPipeSync(payload) {
276
278
  try {
@@ -1122,6 +1122,14 @@ defaultConfig.definition = () => ({
1122
1122
  formatter: int,
1123
1123
  default: 10000
1124
1124
  }
1125
+ },
1126
+ batching: {
1127
+ formatter: boolean,
1128
+ default: true
1129
+ },
1130
+ compression: {
1131
+ formatter: boolean,
1132
+ default: true
1125
1133
  }
1126
1134
  },
1127
1135
  /**
@@ -30,7 +30,6 @@ const configDefinition = definition()
30
30
  */
31
31
  const AZURE_APP_NAME = 'APP_POOL_ID'
32
32
  const DEFAULT_MAX_PAYLOAD_SIZE_IN_BYTES = 1000000
33
- const DEFAULT_CONFIG_PATH = require.resolve('./default')
34
33
  const BASE_CONFIG_PATH = require.resolve('../../newrelic')
35
34
  const HAS_ARBITRARY_KEYS = new Set(['ignore_messages', 'expected_messages', 'labels'])
36
35
 
@@ -75,11 +74,7 @@ function Config(config) {
75
74
  EventEmitter.call(this)
76
75
 
77
76
  // 1. start by cloning the defaults
78
- try {
79
- Object.assign(this, defaultConfig())
80
- } catch (err) {
81
- logger.warn('Unable to clone the default config, %s: %s', DEFAULT_CONFIG_PATH, err)
82
- }
77
+ Object.assign(this, defaultConfig())
83
78
 
84
79
  // 2. initialize undocumented, internal-only default values
85
80
 
@@ -726,11 +721,6 @@ function _validateThenUpdateErrorMessages(remote, local, remoteKey, localKey) {
726
721
  return
727
722
  }
728
723
 
729
- if (!valueToTest) {
730
- logger.warn('SSC ignore|expect_message is null or undefined, will not merge')
731
- return
732
- }
733
-
734
724
  let valid = true
735
725
  Object.keys(valueToTest).forEach(function validateArray(key) {
736
726
  const arrayToTest = valueToTest[key]
@@ -41,15 +41,17 @@ class GrpcConnection extends EventEmitter {
41
41
  * Standard property setting/initialization, and sets an initial
42
42
  * connection state of disconnected
43
43
  *
44
- * @param {object} traceObserverConfig config item config.infinite_tracing.trace_observer
44
+ * @param {object} infiniteTracingConfig config item config.infinite_tracing
45
45
  * @param {MetricAggregator} metrics metric aggregator, for supportability metrics
46
46
  * @param {number} [reconnectDelayMs=15000] number of milliseconds to wait before reconnecting
47
47
  * for error states that require a reconnect delay.
48
48
  */
49
- constructor(traceObserverConfig, metrics, reconnectDelayMs) {
49
+ constructor(infiniteTracingConfig, metrics, reconnectDelayMs = DEFAULT_RECONNECT_DELAY_MS) {
50
50
  super()
51
+ this._compression = infiniteTracingConfig.compression
52
+ this._method = infiniteTracingConfig.batching ? 'recordSpanBatch' : 'recordSpan'
51
53
 
52
- this._reconnectDelayMs = reconnectDelayMs || DEFAULT_RECONNECT_DELAY_MS
54
+ this._reconnectDelayMs = reconnectDelayMs
53
55
 
54
56
  this._metrics = metrics
55
57
  this._setState(connectionStates.disconnected)
@@ -58,6 +60,7 @@ class GrpcConnection extends EventEmitter {
58
60
  this._runId = null
59
61
  this._requestHeadersMap = null
60
62
 
63
+ const traceObserverConfig = infiniteTracingConfig.trace_observer
61
64
  this._endpoint = this.getTraceObserverEndpoint(traceObserverConfig)
62
65
 
63
66
  this._client = null
@@ -70,18 +73,17 @@ class GrpcConnection extends EventEmitter {
70
73
  * Allows setting of connection details _after_ object constructions
71
74
  * but before the actual connection.
72
75
  *
73
- * @param {string} endpoint the GRPC server's endpoint
74
76
  * @param {string} licenseKey the agent license key
75
77
  * @param {string} runId the current agent run id (also called agent run token)
76
78
  * @param {object} requestHeadersMap request headers map received from server connect.
77
79
  * @param {string} [rootCerts] string of root (ca) certificates to attach to the connection.
80
+ * @returns {GrpcConnection} the instance of grpc connection
78
81
  */
79
82
  setConnectionDetails(licenseKey, runId, requestHeadersMap, rootCerts) {
80
83
  this._licenseKey = licenseKey
81
84
  this._runId = runId
82
85
  this._requestHeadersMap = requestHeadersMap
83
86
  this._rootCerts = rootCerts
84
-
85
87
  return this
86
88
  }
87
89
 
@@ -95,9 +97,8 @@ class GrpcConnection extends EventEmitter {
95
97
  * Used to indicate a transition from one connection state to
96
98
  * the next. Also responsible for emitting the connect state event
97
99
  *
98
- * @param {int} state The connection state (See connectionStates above)
99
- * @param {ClientDuplexStreamImpl} state The GRPC stream, when defined
100
- * @param stream
100
+ * @param {number} state The connection state (See connectionStates above)
101
+ * @param {object} stream duplex stream
101
102
  */
102
103
  _setState(state, stream = null) {
103
104
  this._state = state
@@ -145,10 +146,11 @@ class GrpcConnection extends EventEmitter {
145
146
  /**
146
147
  * Method returns GRPC metadata for initial connection
147
148
  *
148
- * @param {string} licenseKey
149
- * @param {string} runId
150
- * @param requestHeadersMap
151
- * @param env
149
+ * @param {string} licenseKey agent key
150
+ * @param {string} runId agent run id
151
+ * @param {object} requestHeadersMap map of request headers to include
152
+ * @param {object} env process.env
153
+ * @returns {object} grpc metadata
152
154
  */
153
155
  _getMetadata(licenseKey, runId, requestHeadersMap, env) {
154
156
  const metadata = new grpc.Metadata()
@@ -172,8 +174,8 @@ class GrpcConnection extends EventEmitter {
172
174
  * Adds test metadata used to simulate connectivity issues
173
175
  * when appropriate env vars are set
174
176
  *
175
- * @param {Metadata} metadata
176
- * @param env
177
+ * @param {object} metadata metadata to set
178
+ * @param {object} env process.env
177
179
  */
178
180
  _setTestMetadata(metadata, env) {
179
181
  for (const [key, envVar] of Object.entries(GRPC_TEST_META)) {
@@ -236,7 +238,7 @@ class GrpcConnection extends EventEmitter {
236
238
  * Events from the GRPC stream (a ClientDuplexStreamImpl) are the main way
237
239
  * we communicate with the GRPC server.
238
240
  *
239
- * @param {ClientDuplexStreamImpl} stream
241
+ * @param {object} stream duplex stream
240
242
  */
241
243
  _setupSpanStreamObservers(stream) {
242
244
  // Node streams require all data sent by the server to be read before the end
@@ -263,7 +265,7 @@ class GrpcConnection extends EventEmitter {
263
265
  // that the versioned Trace Observer is no longer available. Agents
264
266
  // MUST NOT attempt to reconnect in this case
265
267
  logger.info(
266
- '[UNIMPLEMENTED]: Trace Obserserver is no longer available. Shutting down connection.'
268
+ '[UNIMPLEMENTED]: Trace Observer is no longer available. Shutting down connection.'
267
269
  )
268
270
  this._disconnect()
269
271
  } else if (grpc.status[grpc.status.OK] === grpcStatusName) {
@@ -297,7 +299,8 @@ class GrpcConnection extends EventEmitter {
297
299
  /**
298
300
  * Creates the GRPC credentials needed
299
301
  *
300
- * @param grpcApi
302
+ * @param {object} grpcApi grpc lib
303
+ * @returns {object} ssl credentials
301
304
  */
302
305
  _generateCredentials(grpcApi) {
303
306
  let certBuffer = null
@@ -325,15 +328,17 @@ class GrpcConnection extends EventEmitter {
325
328
  *
326
329
  * Contains the actual logic that connects to the GRPC service.
327
330
  * "Connection" can be a somewhat misleading term here. This method
328
- * invokes the "recordSpan" remote proceduce call. Behind the scenes
331
+ * invokes the either `recordSpan` or `recordSpanBatch` remote procedure call. Behind the scenes
329
332
  * this makes an http2 request with the metadata, and then returns
330
333
  * a stream for further writing.
334
+ *
335
+ * @returns {object} stream duplex stream
331
336
  */
332
337
  _connectSpans() {
333
338
  if (!this._client) {
334
339
  // Only create once to avoid potential memory leak.
335
340
  // We create here (currently) for consistent error handling.
336
- this._client = this._createClient(this._endpoint)
341
+ this._client = this._createClient()
337
342
  }
338
343
 
339
344
  const metadata = this._getMetadata(
@@ -343,7 +348,7 @@ class GrpcConnection extends EventEmitter {
343
348
  process.env
344
349
  )
345
350
 
346
- const stream = this._client.recordSpan(metadata)
351
+ const stream = this._client[this._method](metadata)
347
352
  this._setupSpanStreamObservers(stream)
348
353
 
349
354
  return stream
@@ -357,9 +362,10 @@ class GrpcConnection extends EventEmitter {
357
362
  * the stream is closed and we do not have a handle to the client. Currently
358
363
  * impacting grpc-js@1.2.11 and several earlier versions.
359
364
  *
360
- * @param endpoint
365
+ * @returns {object} protobuf API for IngestService
361
366
  */
362
- _createClient(endpoint) {
367
+ _createClient() {
368
+ const endpoint = this._endpoint
363
369
  logger.trace('Creating gRPC client for: ', endpoint)
364
370
 
365
371
  const packageDefinition = protoLoader.loadSync(PROTO_DEFINITION_PATH, PROTO_OPTIONS)
@@ -369,7 +375,25 @@ class GrpcConnection extends EventEmitter {
369
375
  const traceApi = protoDescriptor.com.newrelic.trace.v1
370
376
 
371
377
  const credentials = this._generateCredentials(grpc)
372
- return new traceApi.IngestService(endpoint, credentials)
378
+
379
+ // If you want to use mock server use insecure creds
380
+ // const credentials = grpc.credentials.createInsecure()
381
+
382
+ const opts = {}
383
+ if (this._compression) {
384
+ // 2 = gzip compression
385
+ // see: https://github.com/grpc/grpc-node/blob/master/packages/grpc-js/src/compression-algorithms.ts#L21
386
+ opts['grpc.default_compression_algorithm'] = 2
387
+ this._metrics
388
+ .getOrCreateMetric(`${NAMES.INFINITE_TRACING.COMPRESSION}/enabled`)
389
+ .incrementCallCount()
390
+ } else {
391
+ this._metrics
392
+ .getOrCreateMetric(`${NAMES.INFINITE_TRACING.COMPRESSION}/disabled`)
393
+ .incrementCallCount()
394
+ }
395
+
396
+ return new traceApi.IngestService(endpoint, credentials, opts)
373
397
  }
374
398
  }
375
399
 
@@ -6,6 +6,15 @@ service IngestService {
6
6
  // Accepts a stream of Span messages, and returns an irregular stream of
7
7
  // RecordStatus messages.
8
8
  rpc RecordSpan(stream Span) returns (stream RecordStatus) {}
9
+
10
+ // Accepts a stream of SpanBatch messages, and returns an irregular
11
+ // stream of RecordStatus messages. This endpoint can be used to improve
12
+ // throughput when Span messages are small
13
+ rpc RecordSpanBatch(stream SpanBatch) returns (stream RecordStatus) {}
14
+ }
15
+
16
+ message SpanBatch {
17
+ repeated Span spans = 1;
9
18
  }
10
19
 
11
20
  message Span {
@@ -27,3 +36,4 @@ message AttributeValue {
27
36
  message RecordStatus {
28
37
  uint64 messages_seen = 1;
29
38
  }
39
+