newrelic 10.1.2 → 10.2.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 +79 -59
- package/README.md +1 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/index.js +68 -3
- package/lib/instrumentation/mysql/mysql.js +18 -5
- package/lib/metrics/names.js +5 -0
- package/package.json +2 -2
package/NEWS.md
CHANGED
|
@@ -1,67 +1,87 @@
|
|
|
1
|
-
### v10.
|
|
2
|
-
|
|
3
|
-
####
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
####
|
|
39
|
-
|
|
40
|
-
*
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
### v10.2.0 (2023-06-06)
|
|
2
|
+
|
|
3
|
+
#### Features
|
|
4
|
+
|
|
5
|
+
* Added supportability metrics to indicate how agent was loaded and if source maps were enabled ([#1657](https://github.com/newrelic/node-newrelic/pull/1657)) ([6f6f7e6](https://github.com/newrelic/node-newrelic/commit/6f6f7e68bf382c6082550306aee30a670652347d))
|
|
6
|
+
* `Supportability/Features/CJS/Preload` - recorded if `-r newrelic` was used to load agent
|
|
7
|
+
* `Supportability/Features/CJS/Require` - recorded if `require('newrelic')` was used to load agent
|
|
8
|
+
* `Supportability/Features/EnableSourceMaps` - recorded if `node --enable-source-maps` was present to start application
|
|
9
|
+
|
|
10
|
+
* Added logging of `process.execArgs` at the debug level ([#1654](https://github.com/newrelic/node-newrelic/pull/1654)) ([c85c006](https://github.com/newrelic/node-newrelic/commit/c85c006e722fce1271795b2613e1dd2a96983046))
|
|
11
|
+
|
|
12
|
+
#### Miscellaneous Chores
|
|
13
|
+
|
|
14
|
+
* Updated c8 to merge v8 coverage reports asynchronously to avoid OOM issues ([#1652](https://github.com/newrelic/node-newrelic/pull/1652)) ([34376d7](https://github.com/newrelic/node-newrelic/commit/34376d7d51c0e0d34a5c94b53785d153341f06b8))
|
|
15
|
+
* Updated explorer hub link in readme ([#1656](https://github.com/newrelic/node-newrelic/pull/1656)) ([c1e81a7](https://github.com/newrelic/node-newrelic/commit/c1e81a7d04c113dc3659dad3c777d0ce2dd21162))
|
|
16
|
+
|
|
17
|
+
#### Tests
|
|
18
|
+
|
|
19
|
+
* Added unit tests for MySQL instrumentation ([#1649](https://github.com/newrelic/node-newrelic/pull/1649)) ([b693ba0](https://github.com/newrelic/node-newrelic/commit/b693ba039a42f9034f5206692e6d7a0523e23e51))
|
|
20
|
+
|
|
21
|
+
### v10.1.2 (2023-05-24)
|
|
22
|
+
|
|
23
|
+
#### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* 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))
|
|
26
|
+
* Added instrumentation to `PoolNamespace.prototype.query`
|
|
27
|
+
|
|
28
|
+
#### Continuous Integration
|
|
29
|
+
|
|
30
|
+
* fix minor release note generation bugs ([#1643](https://github.com/newrelic/node-newrelic/pull/1643)) ([dd6ab9a](https://github.com/newrelic/node-newrelic/commit/dd6ab9addb8ee16de92ba9d6602f71c40527b940))
|
|
31
|
+
|
|
32
|
+
### v10.1.1 (2023-05-15)
|
|
33
|
+
|
|
34
|
+
#### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* 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))
|
|
37
|
+
|
|
38
|
+
#### Code Refactoring
|
|
39
|
+
|
|
40
|
+
* **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))
|
|
41
|
+
|
|
42
|
+
#### Documentation
|
|
43
|
+
|
|
44
|
+
* 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))
|
|
45
|
+
|
|
46
|
+
#### Miscellaneous Chores
|
|
47
|
+
|
|
48
|
+
* 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))
|
|
49
|
+
* remove release-please workflow and scripts ([#1624](https://github.com/newrelic/node-newrelic/pull/1624)) ([80f7eb8](https://github.com/newrelic/node-newrelic/commit/80f7eb88a4f71e44b4413e3b39c5766046e9ec8a))
|
|
50
|
+
|
|
51
|
+
#### Tests
|
|
52
|
+
|
|
53
|
+
* 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))
|
|
54
|
+
* **scripts:** fix failing changelog unit test ([#1626](https://github.com/newrelic/node-newrelic/pull/1626)) ([08f48b3](https://github.com/newrelic/node-newrelic/commit/08f48b33ce1c402e4a8c42c9c02e5b22e6cbe02a))
|
|
55
|
+
* **config:** increase test coverage ([#1625](https://github.com/newrelic/node-newrelic/pull/1625)) ([67f39d8](https://github.com/newrelic/node-newrelic/commit/67f39d8dc89e627d27c7fd9a9cee1ac14ab816e3))
|
|
56
|
+
* **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))
|
|
57
|
+
|
|
58
|
+
#### Continuous Integration
|
|
59
|
+
|
|
60
|
+
* 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))
|
|
61
|
+
* add --use-new-release functionality ([#1633](https://github.com/newrelic/node-newrelic/pull/1633)) ([d97b421](https://github.com/newrelic/node-newrelic/commit/d97b421be5acda61f0212fd49a433e58811fc27c))
|
|
62
|
+
* 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))
|
|
63
|
+
* **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))
|
|
64
|
+
* 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))
|
|
65
|
+
* 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))
|
|
66
|
+
* 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))
|
|
67
|
+
|
|
68
|
+
### v10.1.0 (2023-05-04)
|
|
69
|
+
|
|
50
70
|
* Added batching and compression to infinite tracing.
|
|
51
71
|
* These options are on by default.
|
|
52
72
|
* To restore uncompressed spans set `config.infinite_tracing.compression` to `false`.
|
|
53
73
|
* To send single spans vs batches set `config.infinite_tracing.batching` to `false`.
|
|
54
|
-
* The environment variables for these new configurations are: `NEW_RELIC_INFINITE_TRACING_BATCHING` and `NEW_RELIC_INFINITE_TRACING_COMPRESSION`.
|
|
55
|
-
|
|
56
|
-
* Added support to record Nest.js error stack traces.
|
|
57
|
-
* Nest.js is officially supported via underlying instrumentation of express or fastify.
|
|
58
|
-
|
|
59
|
-
* Added job to create a release notes PR in the post-release workflow.
|
|
60
|
-
|
|
61
|
-
* Removed request library and updated helper to use http/https to make requests in tests.
|
|
62
|
-
|
|
74
|
+
* The environment variables for these new configurations are: `NEW_RELIC_INFINITE_TRACING_BATCHING` and `NEW_RELIC_INFINITE_TRACING_COMPRESSION`.
|
|
75
|
+
|
|
76
|
+
* Added support to record Nest.js error stack traces.
|
|
77
|
+
* Nest.js is officially supported via underlying instrumentation of express or fastify.
|
|
78
|
+
|
|
79
|
+
* Added job to create a release notes PR in the post-release workflow.
|
|
80
|
+
|
|
81
|
+
* Removed request library and updated helper to use http/https to make requests in tests.
|
|
82
|
+
|
|
63
83
|
* Reduced cognitive complexity in lib/serverless/aws-lambda.js
|
|
64
|
-
|
|
84
|
+
|
|
65
85
|
### v10.0.0 (2023-04-19)
|
|
66
86
|
|
|
67
87
|
* **BREAKING** - Updated the default of `config.transaction_tracer.record_sql` from `off` to `obfuscated`. This means that sql statements will be captured but obfuscated.
|
package/README.md
CHANGED
|
@@ -219,7 +219,7 @@ If the issue has been confirmed as a bug or is a feature request, please file a
|
|
|
219
219
|
**Support Channels**
|
|
220
220
|
|
|
221
221
|
* [New Relic Documentation](https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/introduction-new-relic-nodejs): Comprehensive guidance for using our platform
|
|
222
|
-
* [New Relic Community](https://
|
|
222
|
+
* [New Relic Community](https://forum.newrelic.com/): The best place to engage in troubleshooting questions
|
|
223
223
|
* [New Relic Developer](https://developer.newrelic.com/): Resources for building a custom observability applications
|
|
224
224
|
* [New Relic University](https://learn.newrelic.com/): A range of online training for New Relic users of every level
|
|
225
225
|
* [New Relic Technical Support](https://support.newrelic.com/) 24/7/365 ticketed support. Read more about our [Technical Support Offerings](https://docs.newrelic.com/docs/licenses/license-information/general-usage-licenses/support-plan).
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -2158,7 +2158,7 @@ THE SOFTWARE.
|
|
|
2158
2158
|
|
|
2159
2159
|
### c8
|
|
2160
2160
|
|
|
2161
|
-
This product includes source derived from [c8](https://github.com/bcoe/c8) ([v7.
|
|
2161
|
+
This product includes source derived from [c8](https://github.com/bcoe/c8) ([v7.14.0](https://github.com/bcoe/c8/tree/v7.14.0)), distributed under the [ISC License](https://github.com/bcoe/c8/blob/v7.14.0/LICENSE.txt):
|
|
2162
2162
|
|
|
2163
2163
|
```
|
|
2164
2164
|
Copyright (c) 2017, Contributors
|
package/index.js
CHANGED
|
@@ -15,6 +15,7 @@ require('./lib/util/unwrapped-core')
|
|
|
15
15
|
const featureFlags = require('./lib/feature_flags').prerelease
|
|
16
16
|
const psemver = require('./lib/util/process-version')
|
|
17
17
|
let logger = require('./lib/logger') // Gets re-loaded after initialization.
|
|
18
|
+
const NAMES = require('./lib/metrics/names')
|
|
18
19
|
|
|
19
20
|
const pkgJSON = require('./package.json')
|
|
20
21
|
logger.info(
|
|
@@ -65,7 +66,12 @@ function initialize() {
|
|
|
65
66
|
|
|
66
67
|
logger.debug('Current working directory at module load is %s.', process.cwd())
|
|
67
68
|
logger.debug('Process title is %s.', process.title)
|
|
68
|
-
|
|
69
|
+
|
|
70
|
+
// execArgv happens before the script name but after the original executable name
|
|
71
|
+
// https://nodejs.org/api/process.html#process_process_execargv
|
|
72
|
+
const cliArgs = [process.argv[0], ...process.execArgv, ...process.argv.slice(1)]
|
|
73
|
+
|
|
74
|
+
logger.debug('Application was invoked as %s', cliArgs.join(' '))
|
|
69
75
|
|
|
70
76
|
const config = require('./lib/config').getOrCreateInstance()
|
|
71
77
|
|
|
@@ -168,10 +174,30 @@ function createAgent(config) {
|
|
|
168
174
|
}
|
|
169
175
|
|
|
170
176
|
function addStartupSupportabilities(agent) {
|
|
171
|
-
|
|
177
|
+
recordLoaderMetric(agent)
|
|
178
|
+
recordNodeVersionMetric(agent)
|
|
179
|
+
recordFeatureFlagMetrics(agent)
|
|
180
|
+
recordSourceMapMetric(agent)
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Records the major version of the Node.js runtime
|
|
185
|
+
* TODO: As new versions come out, make sure to update Angler metrics.
|
|
186
|
+
*
|
|
187
|
+
* @param {Agent} agent active NR agent
|
|
188
|
+
*/
|
|
189
|
+
function recordNodeVersionMetric(agent) {
|
|
172
190
|
const nodeMajor = /^v?(\d+)/.exec(process.version)
|
|
173
|
-
|
|
191
|
+
const version = (nodeMajor && nodeMajor[1]) || 'unknown'
|
|
192
|
+
agent.recordSupportability(`Nodejs/Version/${version}`)
|
|
193
|
+
}
|
|
174
194
|
|
|
195
|
+
/**
|
|
196
|
+
* Records all the feature flags configured and if they are enabled/disabled
|
|
197
|
+
*
|
|
198
|
+
* @param {Agent} agent active NR agent
|
|
199
|
+
*/
|
|
200
|
+
function recordFeatureFlagMetrics(agent) {
|
|
175
201
|
const configFlags = Object.keys(agent.config.feature_flag)
|
|
176
202
|
for (let i = 0; i < configFlags.length; ++i) {
|
|
177
203
|
const flag = configFlags[i]
|
|
@@ -184,3 +210,42 @@ function addStartupSupportabilities(agent) {
|
|
|
184
210
|
}
|
|
185
211
|
}
|
|
186
212
|
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Used to determine how the agent is getting loaded:
|
|
216
|
+
* 1. -r newrelic
|
|
217
|
+
* 2. --loader newrelic/esm-loader.mjs
|
|
218
|
+
* 3. require('newrelic')
|
|
219
|
+
*
|
|
220
|
+
* Then a supportability metric is loaded to decide.
|
|
221
|
+
* Note: We already take care of scenario #2 in newrelic/esm-loader.mjs
|
|
222
|
+
*
|
|
223
|
+
* @param {Agent} agent active NR agent
|
|
224
|
+
*/
|
|
225
|
+
function recordLoaderMetric(agent) {
|
|
226
|
+
const isESM = agent.metrics.getMetric(NAMES.FEATURES.ESM.LOADER)
|
|
227
|
+
let isDashR = false
|
|
228
|
+
|
|
229
|
+
process.execArgv.forEach((arg, index) => {
|
|
230
|
+
if (arg === '-r' && process.execArgv[index + 1] === 'newrelic') {
|
|
231
|
+
agent.metrics.getOrCreateMetric(NAMES.FEATURES.CJS.PRELOAD).incrementCallCount()
|
|
232
|
+
isDashR = true
|
|
233
|
+
}
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
if (!isESM && !isDashR) {
|
|
237
|
+
agent.metrics.getOrCreateMetric(NAMES.FEATURES.CJS.REQUIRE).incrementCallCount()
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Checks to see if `--enable-source-maps` is being used and logs a supportability metric.
|
|
243
|
+
*
|
|
244
|
+
* @param {Agent} agent active NR agent
|
|
245
|
+
*/
|
|
246
|
+
function recordSourceMapMetric(agent) {
|
|
247
|
+
const isSourceMapsEnabled = process.execArgv.includes('--enable-source-maps')
|
|
248
|
+
if (isSourceMapsEnabled) {
|
|
249
|
+
agent.metrics.getOrCreateMetric(NAMES.FEATURES.SOURCE_MAPS).incrementCallCount()
|
|
250
|
+
}
|
|
251
|
+
}
|
|
@@ -9,7 +9,7 @@ const dbutils = require('../../db/utils')
|
|
|
9
9
|
const properties = require('../../util/properties')
|
|
10
10
|
const symbols = require('../../symbols')
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function callbackInitialize(shim, mysql) {
|
|
13
13
|
shim.setDatastore(shim.MYSQL)
|
|
14
14
|
shim[symbols.wrappedPoolConnection] = false
|
|
15
15
|
|
|
@@ -62,10 +62,10 @@ exports.callbackInitialize = function callbackInitialize(shim, mysql) {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
function promiseInitialize(shim) {
|
|
66
66
|
const callbackAPI = shim.require('./index')
|
|
67
67
|
if (callbackAPI && !shim.isWrapped(callbackAPI.createConnection)) {
|
|
68
|
-
|
|
68
|
+
callbackInitialize(shim, callbackAPI)
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -244,11 +244,11 @@ function getInstanceParameters(shim, queryable, query) {
|
|
|
244
244
|
shim.logger.trace('No query config detected, not collecting db instance data')
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
storeDatabaseName(
|
|
247
|
+
storeDatabaseName(queryable, query)
|
|
248
248
|
return parameters
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
function storeDatabaseName(
|
|
251
|
+
function storeDatabaseName(queryable, query) {
|
|
252
252
|
if (queryable[symbols.storeDatabase]) {
|
|
253
253
|
const databaseName = dbutils.extractDatabaseChangeFromUse(query)
|
|
254
254
|
if (databaseName) {
|
|
@@ -256,3 +256,16 @@ function storeDatabaseName(shim, queryable, query) {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
+
|
|
260
|
+
module.exports = {
|
|
261
|
+
callbackInitialize,
|
|
262
|
+
promiseInitialize,
|
|
263
|
+
wrapGetConnection,
|
|
264
|
+
wrapGetConnectionCallback,
|
|
265
|
+
wrapQueryable,
|
|
266
|
+
extractQueryArgs,
|
|
267
|
+
describeQuery,
|
|
268
|
+
describePoolQuery,
|
|
269
|
+
getInstanceParameters,
|
|
270
|
+
storeDatabaseName
|
|
271
|
+
}
|
package/lib/metrics/names.js
CHANGED
|
@@ -275,6 +275,11 @@ const FEATURES = {
|
|
|
275
275
|
UNSUPPORTED_LOADER: `${SUPPORTABILITY.FEATURES}/ESM/UnsupportedLoader`,
|
|
276
276
|
CUSTOM_INSTRUMENTATION: `${SUPPORTABILITY.FEATURES}/ESM/CustomInstrumentation`
|
|
277
277
|
},
|
|
278
|
+
CJS: {
|
|
279
|
+
PRELOAD: `${SUPPORTABILITY.FEATURES}/CJS/Preload`,
|
|
280
|
+
REQUIRE: `${SUPPORTABILITY.FEATURES}/CJS/Require`
|
|
281
|
+
},
|
|
282
|
+
SOURCE_MAPS: `${SUPPORTABILITY.FEATURES}/EnableSourceMaps`,
|
|
278
283
|
CERTIFICATES: SUPPORTABILITY.FEATURES + '/Certificates',
|
|
279
284
|
INSTRUMENTATION: {
|
|
280
285
|
ON_RESOLVED: SUPPORTABILITY.FEATURES + '/Instrumentation/OnResolved',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newrelic",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"author": "New Relic Node.js agent team <nodejs@newrelic.com>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"contributors": [
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
"@slack/bolt": "^3.7.0",
|
|
209
209
|
"ajv": "^6.12.6",
|
|
210
210
|
"async": "^3.2.4",
|
|
211
|
-
"c8": "^7.
|
|
211
|
+
"c8": "^7.14.0",
|
|
212
212
|
"chai": "^4.1.2",
|
|
213
213
|
"clean-jsdoc-theme": "^4.2.4",
|
|
214
214
|
"commander": "^7.0.0",
|