newrelic 10.6.1 → 10.6.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 +48 -32
- package/THIRD_PARTY_NOTICES.md +20 -20
- package/lib/aggregators/log-aggregator.js +14 -6
- package/lib/collector/http-agents.js +10 -43
- package/lib/config/index.js +6 -6
- package/lib/instrumentation/pino/pino.js +18 -3
- package/package.json +4 -4
package/NEWS.md
CHANGED
|
@@ -1,35 +1,51 @@
|
|
|
1
|
-
### v10.6.
|
|
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
|
-
|
|
1
|
+
### v10.6.2 (2023-08-07)
|
|
2
|
+
|
|
3
|
+
#### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* added defensive code around JSON.parse in formatting pino log lines because pino can return invalid json ([#1750](https://github.com/newrelic/node-newrelic/pull/1750)) ([8f2e11a](https://github.com/newrelic/node-newrelic/commit/8f2e11ab0d018d2a99b928cd3ec189a74ff8d6d6))
|
|
6
|
+
|
|
7
|
+
#### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
* **deps:** Updated @newrelic/security-agent to v0.2.1 ([#1754](https://github.com/newrelic/node-newrelic/pull/1754)) ([0d04f14](https://github.com/newrelic/node-newrelic/commit/0d04f14f1383d903b4c30a787c4079b3dec01323))
|
|
10
|
+
* Fix smoke tests node 20 ([#1745](https://github.com/newrelic/node-newrelic/pull/1745)) ([8c053e0](https://github.com/newrelic/node-newrelic/commit/8c053e00e289f214105fc3919b206ac160e81a2d))
|
|
11
|
+
* fixed typos in lib/config/index.js comments ([#1749](https://github.com/newrelic/node-newrelic/pull/1749)) ([9000a14](https://github.com/newrelic/node-newrelic/commit/9000a14a48ba6c29ac6b7f0ffeb94eace9d4a37a))
|
|
12
|
+
|
|
13
|
+
#### Tests
|
|
14
|
+
|
|
15
|
+
* Added a full suite of unit tests for the collector/http-agents ([#1748](https://github.com/newrelic/node-newrelic/pull/1748)) ([9d4201b](https://github.com/newrelic/node-newrelic/commit/9d4201b9035dc629bd4f4a1c0ea72a6e14172356))
|
|
16
|
+
|
|
17
|
+
### v10.6.1 (2023-08-01)
|
|
18
|
+
|
|
19
|
+
#### Security Improvements
|
|
20
|
+
|
|
21
|
+
* updated ESM loader to track instrumentation by url in a map instead of in url to avoid remote code execution. ([#1741](https://github.com/newrelic/node-newrelic/pull/1741)) ([c8dc779](https://github.com/newrelic/node-newrelic/commit/c8dc779c7799b234290b6f7eb1d0a4e07d692ef9))
|
|
22
|
+
|
|
23
|
+
### v10.6.0 (2023-07-26)
|
|
24
|
+
|
|
25
|
+
#### Miscellaneous Chores
|
|
26
|
+
|
|
27
|
+
* **deps:** Updated @newrelic/security-agent to v0.2.0 ([#1737](https://github.com/newrelic/node-newrelic/pull/1737)) ([9bf2a01](https://github.com/newrelic/node-newrelic/commit/9bf2a011aed846a024d6445f557eb8eb7d2e5efe))
|
|
28
|
+
* restored engines to >=14 until we actually drop support for Node 14 ([#1738](https://github.com/newrelic/node-newrelic/pull/1738)) ([8d66123](https://github.com/newrelic/node-newrelic/commit/8d66123105d25a3f949f0f5c2db53ecb7e9f2df0))
|
|
29
|
+
|
|
30
|
+
#### Continuous Integration
|
|
31
|
+
|
|
32
|
+
* Add Node.js 20.x to CI and remove 14.x ([#1603](https://github.com/newrelic/node-newrelic/pull/1603)) ([c4b008c](https://github.com/newrelic/node-newrelic/commit/c4b008c98c758ba3e669768a840e40dd8fe3e681))
|
|
33
|
+
* update support statement ([#1733](https://github.com/newrelic/node-newrelic/pull/1733)) ([3013da9](https://github.com/newrelic/node-newrelic/commit/3013da977ed6dae70bef81b1f1cf0dbf4acbb37b))
|
|
34
|
+
|
|
35
|
+
### v10.5.0 (2023-07-20)
|
|
36
|
+
|
|
37
|
+
#### Features
|
|
38
|
+
|
|
39
|
+
* enabled code_level_metrics by default ([#1723](https://github.com/newrelic/node-newrelic/pull/1723)) ([0b96de3](https://github.com/newrelic/node-newrelic/commit/0b96de3fbf8db7be7d3673e29bab706d1d67de42))
|
|
40
|
+
|
|
41
|
+
#### Bug Fixes
|
|
42
|
+
|
|
43
|
+
* prevent ESM loader from loading instrumentation multiple times ([#1729](https://github.com/newrelic/node-newrelic/pull/1729)) ([962d172](https://github.com/newrelic/node-newrelic/commit/962d172aa5a9496041fe40e73ab8d183db94bae7))
|
|
44
|
+
|
|
45
|
+
#### Miscellaneous Chores
|
|
46
|
+
|
|
47
|
+
* **deps-dev:** bump word-wrap from 1.2.3 to 1.2.4 ([#1730](https://github.com/newrelic/node-newrelic/pull/1730)) ([500a69e](https://github.com/newrelic/node-newrelic/commit/500a69e6c9e94e4073805630e6d380f349d91689))
|
|
48
|
+
|
|
33
49
|
### v10.4.2 (2023-07-13)
|
|
34
50
|
|
|
35
51
|
#### Bug Fixes
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -34,7 +34,6 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
34
34
|
|
|
35
35
|
* [@newrelic/eslint-config](#newreliceslint-config)
|
|
36
36
|
* [@newrelic/newrelic-oss-cli](#newrelicnewrelic-oss-cli)
|
|
37
|
-
* [@newrelic/proxy](#newrelicproxy)
|
|
38
37
|
* [@newrelic/test-utilities](#newrelictest-utilities)
|
|
39
38
|
* [@octokit/rest](#octokitrest)
|
|
40
39
|
* [@slack/bolt](#slackbolt)
|
|
@@ -66,6 +65,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
66
65
|
* [memcached](#memcached)
|
|
67
66
|
* [nock](#nock)
|
|
68
67
|
* [prettier](#prettier)
|
|
68
|
+
* [proxy](#proxy)
|
|
69
69
|
* [proxyquire](#proxyquire)
|
|
70
70
|
* [q](#q)
|
|
71
71
|
* [rimraf](#rimraf)
|
|
@@ -953,7 +953,7 @@ Apache License
|
|
|
953
953
|
|
|
954
954
|
### @newrelic/security-agent
|
|
955
955
|
|
|
956
|
-
This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v0.2.
|
|
956
|
+
This product includes source derived from [@newrelic/security-agent](https://github.com/newrelic/csec-node-agent) ([v0.2.1](https://github.com/newrelic/csec-node-agent/tree/v0.2.1)), distributed under the [New Relic Pre-Release License](https://github.com/newrelic/csec-node-agent/blob/v0.2.1/LICENSE):
|
|
957
957
|
|
|
958
958
|
```
|
|
959
959
|
## New Relic Pre-Release Software Notice
|
|
@@ -1273,7 +1273,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
1273
1273
|
|
|
1274
1274
|
### https-proxy-agent
|
|
1275
1275
|
|
|
1276
|
-
This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/
|
|
1276
|
+
This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) ([v7.0.1](https://github.com/TooTallNate/proxy-agents/tree/v7.0.1)), distributed under the [MIT License](https://github.com/TooTallNate/proxy-agents/blob/v7.0.1/README.md):
|
|
1277
1277
|
|
|
1278
1278
|
```
|
|
1279
1279
|
MIT License
|
|
@@ -1395,7 +1395,7 @@ IN THE SOFTWARE.
|
|
|
1395
1395
|
|
|
1396
1396
|
### semver
|
|
1397
1397
|
|
|
1398
|
-
This product includes source derived from [semver](https://github.com/npm/node-semver) ([v7.5.
|
|
1398
|
+
This product includes source derived from [semver](https://github.com/npm/node-semver) ([v7.5.4](https://github.com/npm/node-semver/tree/v7.5.4)), distributed under the [ISC License](https://github.com/npm/node-semver/blob/v7.5.4/LICENSE):
|
|
1399
1399
|
|
|
1400
1400
|
```
|
|
1401
1401
|
The ISC License
|
|
@@ -1866,22 +1866,6 @@ This product includes source derived from [@newrelic/newrelic-oss-cli](https://g
|
|
|
1866
1866
|
limitations under the License.
|
|
1867
1867
|
```
|
|
1868
1868
|
|
|
1869
|
-
### @newrelic/proxy
|
|
1870
|
-
|
|
1871
|
-
This product includes source derived from [@newrelic/proxy](https://github.com/newrelic/proxy) ([v2.0.0](https://github.com/newrelic/proxy/tree/v2.0.0)), distributed under the [MIT License](https://github.com/newrelic/proxy/blob/v2.0.0/README.md):
|
|
1872
|
-
|
|
1873
|
-
```
|
|
1874
|
-
MIT License
|
|
1875
|
-
|
|
1876
|
-
Copyright (c) <year> <copyright holders>
|
|
1877
|
-
|
|
1878
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
1879
|
-
|
|
1880
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
1881
|
-
|
|
1882
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1883
|
-
```
|
|
1884
|
-
|
|
1885
1869
|
### @newrelic/test-utilities
|
|
1886
1870
|
|
|
1887
1871
|
This product includes source derived from [@newrelic/test-utilities](https://github.com/newrelic/node-test-utilities) ([v7.3.2](https://github.com/newrelic/node-test-utilities/tree/v7.3.2)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-test-utilities/blob/v7.3.2/LICENSE):
|
|
@@ -9271,6 +9255,22 @@ By: Ika
|
|
|
9271
9255
|
|
|
9272
9256
|
```
|
|
9273
9257
|
|
|
9258
|
+
### proxy
|
|
9259
|
+
|
|
9260
|
+
This product includes source derived from [proxy](https://github.com/TooTallNate/proxy-agents) ([v2.1.1](https://github.com/TooTallNate/proxy-agents/tree/v2.1.1)), distributed under the [MIT License](https://github.com/TooTallNate/proxy-agents/blob/v2.1.1/README.md):
|
|
9261
|
+
|
|
9262
|
+
```
|
|
9263
|
+
MIT License
|
|
9264
|
+
|
|
9265
|
+
Copyright (c) <year> <copyright holders>
|
|
9266
|
+
|
|
9267
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
9268
|
+
|
|
9269
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9270
|
+
|
|
9271
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
9272
|
+
```
|
|
9273
|
+
|
|
9274
9274
|
### proxyquire
|
|
9275
9275
|
|
|
9276
9276
|
This product includes source derived from [proxyquire](https://github.com/thlorenz/proxyquire) ([v1.8.0](https://github.com/thlorenz/proxyquire/tree/v1.8.0)), distributed under the [MIT License](https://github.com/thlorenz/proxyquire/blob/v1.8.0/LICENSE):
|
|
@@ -41,13 +41,21 @@ class LogAggregator extends EventAggregator {
|
|
|
41
41
|
* some "log lines" are a function that formats the
|
|
42
42
|
* data accordingly into an Object, I know, this sucks.
|
|
43
43
|
*/
|
|
44
|
-
const formattedLogs = logs
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
const formattedLogs = logs
|
|
45
|
+
.map((logLine) => {
|
|
46
|
+
if (typeof logLine === 'function') {
|
|
47
|
+
return logLine()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return logLine
|
|
51
|
+
})
|
|
52
|
+
.filter(Boolean)
|
|
53
|
+
|
|
54
|
+
if (!formattedLogs.length) {
|
|
55
|
+
logger.debug('No log events to send after formatting.')
|
|
56
|
+
return
|
|
57
|
+
}
|
|
48
58
|
|
|
49
|
-
return logLine
|
|
50
|
-
})
|
|
51
59
|
return [{ logs: formattedLogs }]
|
|
52
60
|
}
|
|
53
61
|
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
'use strict'
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
const ProxyAgent = require('https-proxy-agent')
|
|
8
|
+
const { HttpsProxyAgent } = require('https-proxy-agent')
|
|
10
9
|
const logger = require('../logger').child({ component: 'http-agent' })
|
|
11
10
|
const https = require('https')
|
|
12
11
|
|
|
@@ -52,66 +51,34 @@ exports.proxyAgent = function proxyAgent(config) {
|
|
|
52
51
|
if (null !== agentProxyWithKeepAlive) {
|
|
53
52
|
return agentProxyWithKeepAlive
|
|
54
53
|
}
|
|
55
|
-
const
|
|
56
|
-
const proxyUrl = opts.proxy_url
|
|
54
|
+
const proxyUrl = proxyOptions(config)
|
|
57
55
|
|
|
58
56
|
const proxyOpts = {
|
|
59
|
-
host: proxyUrl.host,
|
|
60
|
-
port: proxyUrl.port,
|
|
61
|
-
protocol: proxyUrl.protocol,
|
|
62
57
|
secureEndpoint: config.ssl,
|
|
63
58
|
auth: proxyUrl.auth,
|
|
64
|
-
ca:
|
|
59
|
+
ca: config?.certificates?.length ? config.certificates : [],
|
|
65
60
|
keepAlive: true
|
|
66
61
|
}
|
|
67
62
|
|
|
68
|
-
logger.info(
|
|
69
|
-
|
|
70
|
-
host: proxyOpts.host,
|
|
71
|
-
port: proxyOpts.port,
|
|
72
|
-
auth: !!proxyOpts.auth,
|
|
73
|
-
protocol: proxyUrl.protocol
|
|
74
|
-
},
|
|
75
|
-
'using proxy'
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
agentProxyWithKeepAlive = new ProxyAgent(proxyOpts)
|
|
63
|
+
logger.info(`using proxy: ${proxyUrl}`)
|
|
64
|
+
agentProxyWithKeepAlive = new HttpsProxyAgent(proxyUrl, proxyOpts)
|
|
79
65
|
return agentProxyWithKeepAlive
|
|
80
66
|
}
|
|
81
67
|
|
|
82
68
|
function proxyOptions(config) {
|
|
83
69
|
let proxyUrl
|
|
84
70
|
if (config.proxy) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
proxyUrl = {
|
|
88
|
-
protocol: parsedUrl.protocol || 'https:',
|
|
89
|
-
host: parsedUrl.hostname,
|
|
90
|
-
port: parsedUrl.port || 80,
|
|
91
|
-
auth: parsedUrl.auth
|
|
92
|
-
}
|
|
71
|
+
proxyUrl = config.proxy
|
|
93
72
|
} else {
|
|
73
|
+
proxyUrl = 'https://'
|
|
94
74
|
let proxyAuth = config.proxy_user
|
|
95
75
|
if (config.proxy_pass !== '') {
|
|
96
76
|
proxyAuth += ':' + config.proxy_pass
|
|
77
|
+
proxyUrl += `${proxyAuth}@`
|
|
97
78
|
}
|
|
98
79
|
|
|
99
|
-
|
|
100
|
-
proxyUrl = {
|
|
101
|
-
protocol: 'https:',
|
|
102
|
-
host: config.proxy_host || 'localhost',
|
|
103
|
-
port: config.proxy_port || 80,
|
|
104
|
-
auth: proxyAuth
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const opts = {
|
|
109
|
-
proxy_url: proxyUrl
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (config.certificates && config.certificates.length > 0) {
|
|
113
|
-
opts.certificates = config.certificates
|
|
80
|
+
proxyUrl += `${config.proxy_host || 'localhost'}:${config.proxy_port || 80}`
|
|
114
81
|
}
|
|
115
82
|
|
|
116
|
-
return
|
|
83
|
+
return proxyUrl
|
|
117
84
|
}
|
package/lib/config/index.js
CHANGED
|
@@ -833,7 +833,7 @@ Config.prototype.logUnknown = function logUnknown(json, key) {
|
|
|
833
833
|
/**
|
|
834
834
|
* Gets the user set host display name. If not provided, it returns the default value.
|
|
835
835
|
*
|
|
836
|
-
* This function is written is this strange way
|
|
836
|
+
* This function is written is this strange way because of the use of caching variables.
|
|
837
837
|
* I wanted to cache the DisplayHost, but if I attached the variable to the config object,
|
|
838
838
|
* it sends the extra variable to New Relic, which is not desired.
|
|
839
839
|
*
|
|
@@ -869,9 +869,9 @@ function getDisplayHost() {
|
|
|
869
869
|
|
|
870
870
|
/**
|
|
871
871
|
* Gets the system's host name. If that fails, it just returns ipv4/6 based on the user's
|
|
872
|
-
* process_host.
|
|
872
|
+
* process_host.ipv_preference setting.
|
|
873
873
|
*
|
|
874
|
-
* This function is written is this strange way
|
|
874
|
+
* This function is written is this strange way because of the use of caching variables.
|
|
875
875
|
* I wanted to cache the Hostname, but if I attached the variable to the config object,
|
|
876
876
|
* it sends the extra variable to New Relic, which is not desired.
|
|
877
877
|
*
|
|
@@ -1235,7 +1235,7 @@ Config.prototype._serverlessDT = function _serverlessDT() {
|
|
|
1235
1235
|
/**
|
|
1236
1236
|
* In serverless mode we allow defer auth to the downstream serverless entities.
|
|
1237
1237
|
* This means we set account_id, primary_application_id, and trusted_account_key in configuration.
|
|
1238
|
-
* This function sets all those to null because this.
|
|
1238
|
+
* This function sets all those to null because this.serverless_mode.enabled is falsey.
|
|
1239
1239
|
*
|
|
1240
1240
|
* @returns {void}
|
|
1241
1241
|
*/
|
|
@@ -1654,7 +1654,7 @@ Config.prototype._warnDeprecations = function _warnDeprecations() {
|
|
|
1654
1654
|
* 5. If this module is installed as a dependency, the directory above the
|
|
1655
1655
|
* node_modules folder in which newrelic is installed.
|
|
1656
1656
|
*
|
|
1657
|
-
* When node process environment
|
|
1657
|
+
* When node process environment variables and a config file are used,
|
|
1658
1658
|
* the environment variables will override their corresponding
|
|
1659
1659
|
* configuration file settings.
|
|
1660
1660
|
*
|
|
@@ -1711,7 +1711,7 @@ function initialize(config) {
|
|
|
1711
1711
|
`Unable to read existing configuration file "${filepath}".`,
|
|
1712
1712
|
'To allow reading of the file (if desired),',
|
|
1713
1713
|
'please ensure the application has read access and the file is exporting valid JSON.',
|
|
1714
|
-
'Attempting to start agent using
|
|
1714
|
+
'Attempting to start agent using environment variables.'
|
|
1715
1715
|
].join(' ')
|
|
1716
1716
|
)
|
|
1717
1717
|
}
|
|
@@ -81,7 +81,14 @@ module.exports = function instrument(shim) {
|
|
|
81
81
|
|
|
82
82
|
if (isLogForwardingEnabled(config, agent)) {
|
|
83
83
|
const chindings = this[symbols.chindingsSym]
|
|
84
|
-
const formatLogLine = reformatLogLine({
|
|
84
|
+
const formatLogLine = reformatLogLine({
|
|
85
|
+
msg: args[1],
|
|
86
|
+
logLine,
|
|
87
|
+
agent,
|
|
88
|
+
chindings,
|
|
89
|
+
levelMap,
|
|
90
|
+
logger: shim.logger
|
|
91
|
+
})
|
|
85
92
|
|
|
86
93
|
agent.logs.add(formatLogLine)
|
|
87
94
|
}
|
|
@@ -104,8 +111,9 @@ module.exports = function instrument(shim) {
|
|
|
104
111
|
* @param logLine.chindings
|
|
105
112
|
* @param logLine.msg
|
|
106
113
|
* @param logLine.levelMap
|
|
114
|
+
* @param logLine.logger
|
|
107
115
|
*/
|
|
108
|
-
function reformatLogLine({ logLine, msg, agent, chindings = '', levelMap }) {
|
|
116
|
+
function reformatLogLine({ logLine, msg, agent, chindings = '', levelMap, logger }) {
|
|
109
117
|
const metadata = agent.getLinkingMetadata()
|
|
110
118
|
|
|
111
119
|
/**
|
|
@@ -125,7 +133,14 @@ function reformatLogLine({ logLine, msg, agent, chindings = '', levelMap }) {
|
|
|
125
133
|
* context metadata and rename the time/msg keys to timestamp/message
|
|
126
134
|
*/
|
|
127
135
|
return function formatLogLine() {
|
|
128
|
-
|
|
136
|
+
let formattedLog
|
|
137
|
+
try {
|
|
138
|
+
formattedLog = JSON.parse(logLine)
|
|
139
|
+
} catch (err) {
|
|
140
|
+
logger.error('Failed to parse log line as json: %s', err.message)
|
|
141
|
+
return
|
|
142
|
+
}
|
|
143
|
+
|
|
129
144
|
if (formattedLog.err) {
|
|
130
145
|
reformatError(formattedLog)
|
|
131
146
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newrelic",
|
|
3
|
-
"version": "10.6.
|
|
3
|
+
"version": "10.6.2",
|
|
4
4
|
"author": "New Relic Node.js agent team <nodejs@newrelic.com>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"contributors": [
|
|
@@ -185,11 +185,11 @@
|
|
|
185
185
|
"@mrleebo/prisma-ast": "^0.5.2",
|
|
186
186
|
"@newrelic/aws-sdk": "^6.0.0",
|
|
187
187
|
"@newrelic/koa": "^7.1.1",
|
|
188
|
-
"@newrelic/security-agent": "0.2.
|
|
188
|
+
"@newrelic/security-agent": "0.2.1",
|
|
189
189
|
"@newrelic/superagent": "^6.0.0",
|
|
190
190
|
"@tyriar/fibonacci-heap": "^2.0.7",
|
|
191
191
|
"concat-stream": "^2.0.0",
|
|
192
|
-
"https-proxy-agent": "^
|
|
192
|
+
"https-proxy-agent": "^7.0.1",
|
|
193
193
|
"json-bigint": "^1.0.0",
|
|
194
194
|
"json-stringify-safe": "^5.0.0",
|
|
195
195
|
"readable-stream": "^3.6.1",
|
|
@@ -203,7 +203,6 @@
|
|
|
203
203
|
"devDependencies": {
|
|
204
204
|
"@newrelic/eslint-config": "^0.3.0",
|
|
205
205
|
"@newrelic/newrelic-oss-cli": "^0.1.2",
|
|
206
|
-
"@newrelic/proxy": "^2.0.0",
|
|
207
206
|
"@newrelic/test-utilities": "^7.3.2",
|
|
208
207
|
"@octokit/rest": "^18.0.15",
|
|
209
208
|
"@slack/bolt": "^3.7.0",
|
|
@@ -235,6 +234,7 @@
|
|
|
235
234
|
"memcached": ">=0.2.8",
|
|
236
235
|
"nock": "11.8.0",
|
|
237
236
|
"prettier": "^2.3.2",
|
|
237
|
+
"proxy": "^2.1.1",
|
|
238
238
|
"proxyquire": "^1.8.0",
|
|
239
239
|
"q": "*",
|
|
240
240
|
"rimraf": "^2.6.3",
|