newrelic 8.5.0 → 8.5.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 +22 -0
- package/README.md +7 -6
- package/THIRD_PARTY_NOTICES.md +33 -2
- package/lib/instrumentation/mongodb/common.js +12 -4
- package/lib/parse-proc-cpuinfo.js +8 -2
- package/lib/parse-proc-meminfo.js +6 -0
- package/package.json +3 -2
package/NEWS.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
### v8.5.1 (2021-11-03)
|
|
2
|
+
|
|
3
|
+
* Fixed bug where failure to retrieve CPU/Memory details for certain Linux distros could result in a crash.
|
|
4
|
+
|
|
5
|
+
`parseProcCPUInfo` and `parseProcMeminfo` now check for `null` input prior to processing.
|
|
6
|
+
|
|
7
|
+
* Updated README to favor using `-r` to load the agent vs `require('newrelic')`.
|
|
8
|
+
|
|
9
|
+
* Updated `@newrelic/test-utilities` to 6.1.1 and applied a global sampling value of 10 for versioned tests.
|
|
10
|
+
|
|
11
|
+
* Migrated utilization unit tests from mocha to tap.
|
|
12
|
+
|
|
13
|
+
* Migrated logger unit tests from mocha to tap.
|
|
14
|
+
|
|
15
|
+
* Cleaned up or added future removal comments for several deprecation warnings.
|
|
16
|
+
|
|
17
|
+
* Added a script and corresponding CI job that will check for PRs that have been merged and not release and notify the team in a private slack channel.
|
|
18
|
+
|
|
19
|
+
* Updated the versioned test runner to always run against minor versions.
|
|
20
|
+
|
|
21
|
+
* Fixed a high severity npm audit failure.
|
|
22
|
+
|
|
1
23
|
### v8.5.0 (2021-10-12)
|
|
2
24
|
|
|
3
25
|
* Added full support for Fastify v2 and v3. Fastify instrumentation is now GA.
|
package/README.md
CHANGED
|
@@ -44,7 +44,13 @@ To use New Relic's Node.js agent entails these three steps, which are described
|
|
|
44
44
|
}
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
4. Finally,
|
|
47
|
+
4. Finally, run your program with the `newrelic` module loaded first by using node's `-r/--require` flag.
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
$ node -r newrelic your-program.js
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
If you cannot control how your program is run, you can load the `newrelic` module _before any other module_ in your program.
|
|
48
54
|
|
|
49
55
|
```js
|
|
50
56
|
const newrelic = require('newrelic')
|
|
@@ -52,11 +58,6 @@ To use New Relic's Node.js agent entails these three steps, which are described
|
|
|
52
58
|
/* ... the rest of your program ... */
|
|
53
59
|
```
|
|
54
60
|
|
|
55
|
-
If you're compiling your JavaScript and can't control the final `require` order, the Node.js agent will work with node's `-r/--require` flag.
|
|
56
|
-
|
|
57
|
-
$ node -r newrelic your-program.js
|
|
58
|
-
$ node --require newrelic your-program.js
|
|
59
|
-
|
|
60
61
|
## Getting Started
|
|
61
62
|
|
|
62
63
|
For more information on getting started, [check the Node.js docs](https://docs.newrelic.com/docs/agents/nodejs-agent/getting-started/introduction-new-relic-nodejs).
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -34,6 +34,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
34
34
|
* [@newrelic/proxy](#newrelicproxy)
|
|
35
35
|
* [@newrelic/test-utilities](#newrelictest-utilities)
|
|
36
36
|
* [@octokit/rest](#octokitrest)
|
|
37
|
+
* [@slack/bolt](#slackbolt)
|
|
37
38
|
* [ajv](#ajv)
|
|
38
39
|
* [architect](#architect)
|
|
39
40
|
* [benchmark](#benchmark)
|
|
@@ -1769,7 +1770,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
1769
1770
|
|
|
1770
1771
|
### @newrelic/test-utilities
|
|
1771
1772
|
|
|
1772
|
-
This product includes source derived from [@newrelic/test-utilities](https://github.com/newrelic/node-test-utilities) ([v6.
|
|
1773
|
+
This product includes source derived from [@newrelic/test-utilities](https://github.com/newrelic/node-test-utilities) ([v6.1.1](https://github.com/newrelic/node-test-utilities/tree/v6.1.1)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-test-utilities/blob/v6.1.1/LICENSE):
|
|
1773
1774
|
|
|
1774
1775
|
```
|
|
1775
1776
|
Apache License
|
|
@@ -2006,6 +2007,36 @@ THE SOFTWARE.
|
|
|
2006
2007
|
|
|
2007
2008
|
```
|
|
2008
2009
|
|
|
2010
|
+
### @slack/bolt
|
|
2011
|
+
|
|
2012
|
+
This product includes source derived from [@slack/bolt](https://github.com/slackapi/bolt) ([v3.7.0](https://github.com/slackapi/bolt/tree/v3.7.0)), distributed under the [MIT License](https://github.com/slackapi/bolt/blob/v3.7.0/LICENSE):
|
|
2013
|
+
|
|
2014
|
+
```
|
|
2015
|
+
The MIT License (MIT)
|
|
2016
|
+
|
|
2017
|
+
Copyright (c) 2016-2018 Robots & Pencils
|
|
2018
|
+
Copyright (c) 2019- Slack Technologies, LLC
|
|
2019
|
+
|
|
2020
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2021
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
2022
|
+
in the Software without restriction, including without limitation the rights
|
|
2023
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
2024
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
2025
|
+
furnished to do so, subject to the following conditions:
|
|
2026
|
+
|
|
2027
|
+
The above copyright notice and this permission notice shall be included in all
|
|
2028
|
+
copies or substantial portions of the Software.
|
|
2029
|
+
|
|
2030
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
2031
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
2032
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
2033
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
2034
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
2035
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
2036
|
+
SOFTWARE.
|
|
2037
|
+
|
|
2038
|
+
```
|
|
2039
|
+
|
|
2009
2040
|
### ajv
|
|
2010
2041
|
|
|
2011
2042
|
This product includes source derived from [ajv](https://github.com/ajv-validator/ajv) ([v6.12.6](https://github.com/ajv-validator/ajv/tree/v6.12.6)), distributed under the [MIT License](https://github.com/ajv-validator/ajv/blob/v6.12.6/LICENSE):
|
|
@@ -3261,7 +3292,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
3261
3292
|
|
|
3262
3293
|
### tap
|
|
3263
3294
|
|
|
3264
|
-
This product includes source derived from [tap](https://github.com/tapjs/node-tap) ([v15.0.
|
|
3295
|
+
This product includes source derived from [tap](https://github.com/tapjs/node-tap) ([v15.0.10](https://github.com/tapjs/node-tap/tree/v15.0.10)), distributed under the [ISC License](https://github.com/tapjs/node-tap/blob/v15.0.10/LICENSE):
|
|
3265
3296
|
|
|
3266
3297
|
```
|
|
3267
3298
|
The ISC License
|
|
@@ -47,9 +47,11 @@ common.instrumentCollection = function instrumentCollection(shim, Collection) {
|
|
|
47
47
|
* Instruments all methods from constants.DB_OPS on
|
|
48
48
|
* the Db class.
|
|
49
49
|
*
|
|
50
|
-
* @param {
|
|
50
|
+
* @param {object} params
|
|
51
51
|
* @param {Shim} params.shim
|
|
52
52
|
* @param {Db} params.Db
|
|
53
|
+
* @param shim
|
|
54
|
+
* @param Db
|
|
53
55
|
*/
|
|
54
56
|
common.instrumentDb = function instrumentDb(shim, Db) {
|
|
55
57
|
if (Db && Db.prototype) {
|
|
@@ -62,6 +64,7 @@ common.instrumentDb = function instrumentDb(shim, Db) {
|
|
|
62
64
|
|
|
63
65
|
/**
|
|
64
66
|
* Sets up the desc for all instrumented query methods
|
|
67
|
+
*
|
|
65
68
|
* @param {Shim} shim
|
|
66
69
|
* @param {string} methodName
|
|
67
70
|
*/
|
|
@@ -123,7 +126,7 @@ common.captureAttributesOnStarted = function captureAttributesOnStarted(shim, in
|
|
|
123
126
|
* @param {Shim} shim
|
|
124
127
|
* @param {string} connStr
|
|
125
128
|
* @param {string} db database name
|
|
126
|
-
* @param {
|
|
129
|
+
* @param {object} client mongo client instance
|
|
127
130
|
*/
|
|
128
131
|
function setHostPort(shim, connStr, db, client) {
|
|
129
132
|
const parts = connStr.split(':')
|
|
@@ -153,6 +156,9 @@ function setHostPort(shim, connStr, db, client) {
|
|
|
153
156
|
* for the query segment. v4 refactored where the toplogy is stored.
|
|
154
157
|
* You can now get the details via the client obj that's deeply nested
|
|
155
158
|
* See: https://github.com/mongodb/node-mongodb-native/pull/2594/files#diff-1d214e57ddda9095d296e5700ebce701333bfefcf417e234c584d14091b2f50dR168
|
|
159
|
+
*
|
|
160
|
+
* @param shim
|
|
161
|
+
* @param obj
|
|
156
162
|
*/
|
|
157
163
|
function getInstanceAttributeParameters(shim, obj) {
|
|
158
164
|
if (obj.s && obj.s.db && obj.s.topology) {
|
|
@@ -197,8 +203,10 @@ function getInstanceAttributeParameters(shim, obj) {
|
|
|
197
203
|
}
|
|
198
204
|
|
|
199
205
|
function doCapture(conf, database) {
|
|
200
|
-
|
|
201
|
-
|
|
206
|
+
// in older versions of 3.x the host/port
|
|
207
|
+
// lived directly on the topology.s.options
|
|
208
|
+
let host = conf.host
|
|
209
|
+
let port = conf.port
|
|
202
210
|
|
|
203
211
|
// servers is an array but we will always pull the first for consistency
|
|
204
212
|
if (conf.servers && conf.servers.length) {
|
|
@@ -17,6 +17,12 @@ function parseProcCPUInfo(data) {
|
|
|
17
17
|
packages: null
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
// In some rare cases the OS may be locked down so that you cannot retrieve this info.
|
|
21
|
+
if (!data) {
|
|
22
|
+
logger.debug('No CPU data to parse, returning empty stats.')
|
|
23
|
+
return processorStats
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
// separate the processors
|
|
21
27
|
let splitData = data.split('\n').map(function formatAttribute(attr) {
|
|
22
28
|
return attr.split(':').map(function eliminateExtraWhitespace(s) {
|
|
@@ -34,7 +40,7 @@ function parseProcCPUInfo(data) {
|
|
|
34
40
|
|
|
35
41
|
splitData = collapseMultilineValues(splitData)
|
|
36
42
|
|
|
37
|
-
const processors =
|
|
43
|
+
const processors = separateProcessors(splitData)
|
|
38
44
|
|
|
39
45
|
processorStats = countProcessorStats(processors)
|
|
40
46
|
if (!processorStats.cores) {
|
|
@@ -73,7 +79,7 @@ function collapseMultilineValues(li) {
|
|
|
73
79
|
|
|
74
80
|
// walk through the processed list of key, value pairs and populate
|
|
75
81
|
// objects till you find a collision
|
|
76
|
-
function
|
|
82
|
+
function separateProcessors(processorData) {
|
|
77
83
|
const processors = []
|
|
78
84
|
let processor = Object.create(null)
|
|
79
85
|
for (let i = 0; i < processorData.length; ++i) {
|
|
@@ -10,6 +10,12 @@ const logger = require('./logger.js').child({ component: 'proc-meminfo' })
|
|
|
10
10
|
module.exports = parseProcMeminfo
|
|
11
11
|
|
|
12
12
|
function parseProcMeminfo(data) {
|
|
13
|
+
// In some rare cases the OS may be locked down so that you cannot retrieve this info.
|
|
14
|
+
if (!data) {
|
|
15
|
+
logger.debug('No memory data to parse.')
|
|
16
|
+
return null
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
const memTotal = parseInt(data.replace(/MemTotal:\s*(\d*)\skB/, '$1'), 10)
|
|
14
20
|
|
|
15
21
|
if (memTotal) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newrelic",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.1",
|
|
4
4
|
"author": "New Relic Node.js agent team <nodejs@newrelic.com>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"contributors": [
|
|
@@ -177,8 +177,9 @@
|
|
|
177
177
|
"@newrelic/eslint-config": "^0.0.3",
|
|
178
178
|
"@newrelic/newrelic-oss-cli": "^0.1.2",
|
|
179
179
|
"@newrelic/proxy": "^2.0.0",
|
|
180
|
-
"@newrelic/test-utilities": "^6.
|
|
180
|
+
"@newrelic/test-utilities": "^6.1.1",
|
|
181
181
|
"@octokit/rest": "^18.0.15",
|
|
182
|
+
"@slack/bolt": "^3.7.0",
|
|
182
183
|
"ajv": "^6.12.6",
|
|
183
184
|
"architect": "*",
|
|
184
185
|
"benchmark": "^2.1.4",
|