newrelic 10.1.0 → 10.1.2
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 +47 -0
- package/THIRD_PARTY_NOTICES.md +144 -1
- package/lib/config/index.js +1 -11
- package/lib/instrumentation/@prisma/client.js +48 -27
- package/lib/instrumentation/mysql/mysql.js +5 -4
- package/package.json +7 -2
package/NEWS.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
+
### v10.1.2 (2023-05-24)
|
|
2
|
+
|
|
3
|
+
#### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* Updated mysql instrumentation to properly wrap the connection pool.getConnection and poolCluster.of ([#1647](https://github.com/newrelic/node-newrelic/pull/1647)) ([4caf1db](https://github.com/newrelic/node-newrelic/commit/4caf1db60b930c7b21307e381c13b5dd572e5cc3))
|
|
6
|
+
* Added instrumentation to `PoolNamespace.prototype.query`
|
|
7
|
+
|
|
8
|
+
#### Continuous Integration
|
|
9
|
+
|
|
10
|
+
* fix minor release note generation bugs ([#1643](https://github.com/newrelic/node-newrelic/pull/1643)) ([dd6ab9a](https://github.com/newrelic/node-newrelic/commit/dd6ab9addb8ee16de92ba9d6602f71c40527b940))
|
|
11
|
+
|
|
12
|
+
### v10.1.1 (2023-05-15)
|
|
13
|
+
|
|
14
|
+
#### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* 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))
|
|
17
|
+
|
|
18
|
+
#### Code Refactoring
|
|
19
|
+
|
|
20
|
+
* **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))
|
|
21
|
+
|
|
22
|
+
#### Documentation
|
|
23
|
+
|
|
24
|
+
* 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))
|
|
25
|
+
|
|
26
|
+
#### Miscellaneous Chores
|
|
27
|
+
|
|
28
|
+
* 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))
|
|
29
|
+
* remove release-please workflow and scripts ([#1624](https://github.com/newrelic/node-newrelic/pull/1624)) ([80f7eb8](https://github.com/newrelic/node-newrelic/commit/80f7eb88a4f71e44b4413e3b39c5766046e9ec8a))
|
|
30
|
+
|
|
31
|
+
#### Tests
|
|
32
|
+
|
|
33
|
+
* 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))
|
|
34
|
+
* **scripts:** fix failing changelog unit test ([#1626](https://github.com/newrelic/node-newrelic/pull/1626)) ([08f48b3](https://github.com/newrelic/node-newrelic/commit/08f48b33ce1c402e4a8c42c9c02e5b22e6cbe02a))
|
|
35
|
+
* **config:** increase test coverage ([#1625](https://github.com/newrelic/node-newrelic/pull/1625)) ([67f39d8](https://github.com/newrelic/node-newrelic/commit/67f39d8dc89e627d27c7fd9a9cee1ac14ab816e3))
|
|
36
|
+
* **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))
|
|
37
|
+
|
|
38
|
+
#### Continuous Integration
|
|
39
|
+
|
|
40
|
+
* 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))
|
|
41
|
+
* add --use-new-release functionality ([#1633](https://github.com/newrelic/node-newrelic/pull/1633)) ([d97b421](https://github.com/newrelic/node-newrelic/commit/d97b421be5acda61f0212fd49a433e58811fc27c))
|
|
42
|
+
* 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))
|
|
43
|
+
* **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))
|
|
44
|
+
* 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))
|
|
45
|
+
* 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))
|
|
46
|
+
* 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))
|
|
47
|
+
|
|
1
48
|
### v10.1.0 (2023-05-04)
|
|
2
49
|
|
|
3
50
|
* Added batching and compression to infinite tracing.
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -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)
|
|
@@ -500,6 +505,34 @@ This product includes source derived from [@grpc/proto-loader](https://github.co
|
|
|
500
505
|
|
|
501
506
|
```
|
|
502
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
|
+
|
|
503
536
|
### @newrelic/aws-sdk
|
|
504
537
|
|
|
505
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):
|
|
@@ -2233,6 +2266,87 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
2233
2266
|
|
|
2234
2267
|
```
|
|
2235
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
|
+
|
|
2236
2350
|
### eslint-config-prettier
|
|
2237
2351
|
|
|
2238
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):
|
|
@@ -2631,6 +2745,35 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
2631
2745
|
|
|
2632
2746
|
```
|
|
2633
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
|
+
|
|
2634
2777
|
### glob
|
|
2635
2778
|
|
|
2636
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):
|
|
@@ -9303,7 +9446,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
9303
9446
|
|
|
9304
9447
|
### testdouble
|
|
9305
9448
|
|
|
9306
|
-
This product includes source derived from [testdouble](https://github.com/testdouble/testdouble.js) ([v3.
|
|
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):
|
|
9307
9450
|
|
|
9308
9451
|
```
|
|
9309
9452
|
The MIT License (MIT)
|
package/lib/config/index.js
CHANGED
|
@@ -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
|
-
|
|
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]
|
|
@@ -13,17 +13,42 @@ const parseSql = require('../../db/query-parsers/sql')
|
|
|
13
13
|
const RAW_COMMANDS = ['executeRaw', 'queryRaw']
|
|
14
14
|
|
|
15
15
|
const semver = require('semver')
|
|
16
|
+
const { getSchema } = require('@mrleebo/prisma-ast')
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
19
|
+
* The library we use to parse the prisma schema retains double quotes around
|
|
20
|
+
* strings, and they need to be stripped
|
|
20
21
|
*
|
|
21
|
-
* @param {string}
|
|
22
|
-
* @returns {string}
|
|
22
|
+
* @param {string} [str=''] string to strip double-quotes from
|
|
23
|
+
* @returns {string} stripped string
|
|
23
24
|
*/
|
|
24
|
-
function
|
|
25
|
-
return
|
|
25
|
+
function trimQuotes(str = '') {
|
|
26
|
+
return str.match(/"(.*)"/)[1]
|
|
26
27
|
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* You can set the connection string in schema as raw string,
|
|
31
|
+
* env var mapping, or an override at client instantiation time.
|
|
32
|
+
*
|
|
33
|
+
* @param {*} url string/object value of url in datsource stanza of schema
|
|
34
|
+
* @param {string} overrideUrl value of url in overrides at client instantiation
|
|
35
|
+
* @returns {string} properly parsed connection url
|
|
36
|
+
*/
|
|
37
|
+
function parseDataModelUrl(url, overrideUrl) {
|
|
38
|
+
let parsedUrl = ''
|
|
39
|
+
|
|
40
|
+
if (overrideUrl) {
|
|
41
|
+
parsedUrl = overrideUrl
|
|
42
|
+
} else if (typeof url === 'string') {
|
|
43
|
+
parsedUrl = trimQuotes(url)
|
|
44
|
+
} else if (url.name && url.name === 'env') {
|
|
45
|
+
const envVar = trimQuotes(url.params[0])
|
|
46
|
+
parsedUrl = process.env[envVar]
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return parsedUrl
|
|
50
|
+
}
|
|
51
|
+
|
|
27
52
|
/**
|
|
28
53
|
* Parses a connection string. Most database engines in prisma are SQL and all
|
|
29
54
|
* have similar engine strings.
|
|
@@ -31,12 +56,10 @@ function extractConnectionString(datasource = {}) {
|
|
|
31
56
|
* **Note**: This will not parse ms sql server, instead will log a warning
|
|
32
57
|
*
|
|
33
58
|
* @param {string} provider prisma provider(i.e. mysql, postgres, mongodb)
|
|
34
|
-
* @param {string}
|
|
59
|
+
* @param {string} connectionUrl connection string to db
|
|
35
60
|
* @returns {object} { host, port, dbName }
|
|
36
61
|
*/
|
|
37
|
-
function parseConnectionString(provider,
|
|
38
|
-
const connectionUrl = extractConnectionString(datasource)
|
|
39
|
-
|
|
62
|
+
function parseConnectionString(provider, connectionUrl) {
|
|
40
63
|
let parameters = {}
|
|
41
64
|
try {
|
|
42
65
|
const parsedUrl = new URL(connectionUrl)
|
|
@@ -124,24 +147,23 @@ function queryParser(query) {
|
|
|
124
147
|
}
|
|
125
148
|
|
|
126
149
|
/**
|
|
127
|
-
* Extracts the prisma connection information from the engine.
|
|
128
|
-
* on
|
|
150
|
+
* Extracts the prisma connection information from the engine. This used to use
|
|
151
|
+
* prisma functions available on engine `getConfig` but that's no longer accessible.
|
|
152
|
+
* Instead we went the route of parsing the schema DSL.
|
|
129
153
|
*
|
|
130
154
|
* @param {object} client prisma client instance
|
|
131
|
-
* @
|
|
132
|
-
* @returns {Promise} returns prisma connection configuration
|
|
155
|
+
* @returns {Promise} returns prisma datasource connection configuration { provider, url }
|
|
133
156
|
*/
|
|
134
|
-
function
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
157
|
+
function extractPrismaDatasource(client) {
|
|
158
|
+
const { datamodel, datasourceOverrides: overrides } = client._engine
|
|
159
|
+
const schema = getSchema(datamodel)
|
|
160
|
+
const datasource = schema.list.filter(({ type }) => type === 'datasource')[0]
|
|
161
|
+
const urlData = datasource.assignments.filter(({ key }) => key === 'url')[0].value
|
|
162
|
+
const url = parseDataModelUrl(urlData, overrides[datasource.name])
|
|
163
|
+
return {
|
|
164
|
+
provider: trimQuotes(datasource.assignments.filter(({ key }) => key === 'provider')[0].value),
|
|
165
|
+
url
|
|
143
166
|
}
|
|
144
|
-
return client._engine.getConfig()
|
|
145
167
|
}
|
|
146
168
|
|
|
147
169
|
/**
|
|
@@ -179,11 +201,10 @@ module.exports = async function initialize(_agent, prisma, _moduleName, shim) {
|
|
|
179
201
|
* Adds the relevant host, port, database_name parameters
|
|
180
202
|
* to the active segment
|
|
181
203
|
*/
|
|
182
|
-
inContext:
|
|
204
|
+
inContext: function inContext() {
|
|
183
205
|
if (!client[prismaConnection]) {
|
|
184
206
|
try {
|
|
185
|
-
const
|
|
186
|
-
const activeDatasource = prismaConfig?.datasources[0]
|
|
207
|
+
const activeDatasource = extractPrismaDatasource(client)
|
|
187
208
|
const dbParams = parseConnectionString(
|
|
188
209
|
activeDatasource?.provider,
|
|
189
210
|
activeDatasource?.url
|
|
@@ -11,7 +11,7 @@ const symbols = require('../../symbols')
|
|
|
11
11
|
|
|
12
12
|
exports.callbackInitialize = function callbackInitialize(shim, mysql) {
|
|
13
13
|
shim.setDatastore(shim.MYSQL)
|
|
14
|
-
shim[symbols.wrappedPoolConnection] =
|
|
14
|
+
shim[symbols.wrappedPoolConnection] = false
|
|
15
15
|
|
|
16
16
|
shim.wrapReturn(mysql, 'createConnection', wrapCreateConnection)
|
|
17
17
|
function wrapCreateConnection(shim, fn, fnName, connection) {
|
|
@@ -46,11 +46,12 @@ exports.callbackInitialize = function callbackInitialize(shim, mysql) {
|
|
|
46
46
|
const proto = Object.getPrototypeOf(poolCluster)
|
|
47
47
|
shim.wrapReturn(proto, 'of', wrapPoolClusterOf)
|
|
48
48
|
function wrapPoolClusterOf(shim, of, _n, poolNamespace) {
|
|
49
|
-
if (
|
|
49
|
+
if (poolNamespace[symbols.clusterOf]) {
|
|
50
50
|
return
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
|
|
53
|
+
if (wrapGetConnection(shim, poolNamespace) && wrapQueryable(shim, poolNamespace, false)) {
|
|
54
|
+
poolNamespace[symbols.clusterOf] = true
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newrelic",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.2",
|
|
4
4
|
"author": "New Relic Node.js agent team <nodejs@newrelic.com>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"contributors": [
|
|
@@ -182,6 +182,7 @@
|
|
|
182
182
|
"dependencies": {
|
|
183
183
|
"@grpc/grpc-js": "^1.8.10",
|
|
184
184
|
"@grpc/proto-loader": "^0.7.5",
|
|
185
|
+
"@mrleebo/prisma-ast": "^0.5.2",
|
|
185
186
|
"@newrelic/aws-sdk": "^5.0.2",
|
|
186
187
|
"@newrelic/koa": "^7.1.1",
|
|
187
188
|
"@newrelic/superagent": "^6.0.0",
|
|
@@ -211,6 +212,9 @@
|
|
|
211
212
|
"chai": "^4.1.2",
|
|
212
213
|
"clean-jsdoc-theme": "^4.2.4",
|
|
213
214
|
"commander": "^7.0.0",
|
|
215
|
+
"conventional-changelog-conventionalcommits": "^5.0.0",
|
|
216
|
+
"conventional-changelog-writer": "^5.0.1",
|
|
217
|
+
"conventional-commits-parser": "^3.2.4",
|
|
214
218
|
"eslint": "^8.24.0",
|
|
215
219
|
"eslint-config-prettier": "^8.3.0",
|
|
216
220
|
"eslint-plugin-disable": "^2.0.1",
|
|
@@ -220,6 +224,7 @@
|
|
|
220
224
|
"eslint-plugin-prettier": "^3.4.0",
|
|
221
225
|
"eslint-plugin-sonarjs": "^0.18.0",
|
|
222
226
|
"express": "*",
|
|
227
|
+
"git-raw-commits": "^2.0.11",
|
|
223
228
|
"glob": "^7.1.2",
|
|
224
229
|
"got": "^11.8.5",
|
|
225
230
|
"husky": "^6.0.0",
|
|
@@ -236,7 +241,7 @@
|
|
|
236
241
|
"sinon": "^4.5.0",
|
|
237
242
|
"tap": "^16.3.4",
|
|
238
243
|
"temp": "^0.8.1",
|
|
239
|
-
"testdouble": "
|
|
244
|
+
"testdouble": "3.17.2",
|
|
240
245
|
"when": "*"
|
|
241
246
|
},
|
|
242
247
|
"repository": {
|