newrelic 7.0.0 → 7.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 +35 -5
- package/ROADMAP_Node.md +1 -1
- package/THIRD_PARTY_NOTICES.md +32 -15
- package/bin/generate-release-notes.js +96 -0
- package/bin/github.js +106 -0
- package/bin/update-changelog-version.js +66 -0
- package/index.js +2 -2
- package/lib/collector/api.js +2 -2
- package/lib/collector/http-agents.js +1 -1
- package/lib/collector/remote-method.js +1 -1
- package/lib/config/attribute-filter.js +1 -1
- package/lib/config/default.js +3 -3
- package/lib/config/env.js +3 -1
- package/lib/config/index.js +2 -2
- package/lib/db/parse-sql.js +1 -1
- package/lib/db/query-parsers/sql.js +1 -1
- package/lib/db/slow-query.js +2 -3
- package/lib/grpc/connection.js +2 -2
- package/lib/instrumentation/core/http.js +3 -3
- package/lib/instrumentation/fastify/spec-builders.js +1 -1
- package/lib/instrumentation/fastify.js +7 -0
- package/lib/parse-proc-cpuinfo.js +1 -1
- package/lib/proxy/grpc.js +1 -1
- package/lib/serverless/aws-lambda.js +9 -5
- package/lib/shim/promise-shim.js +1 -1
- package/lib/shim/shim.js +3 -3
- package/lib/shim/transaction-shim.js +1 -1
- package/lib/shim/webframework-shim.js +1 -1
- package/lib/shimmer.js +1 -1
- package/lib/spans/create-span-event-aggregator.js +1 -1
- package/lib/spans/span-streamer.js +1 -1
- package/lib/spans/streaming-span-event-aggregator.js +1 -1
- package/lib/timer.js +1 -1
- package/lib/transaction/dt-payload.js +1 -1
- package/lib/transaction/index.js +2 -2
- package/lib/transaction/tracecontext.js +2 -2
- package/lib/util/byte-limit.js +1 -1
- package/lib/utilization/common.js +1 -1
- package/package.json +7 -4
- package/stub_api.js +1 -1
- package/third_party_manifest.json +22 -11
package/NEWS.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
### v7.1.1 (2021-02-01)
|
|
2
|
+
|
|
3
|
+
* Upgrade @grpc/grpc-js to v1.2.5 to fix non-propagation of internal http2 errors
|
|
4
|
+
Now allows minor and patch auto-updates.
|
|
5
|
+
|
|
6
|
+
* Added workflow for publishing to npm when a v* tag is pushed to the repo.
|
|
7
|
+
|
|
8
|
+
* Fixes resolveMx test by using example.com for a valid exchange.
|
|
9
|
+
|
|
10
|
+
### 7.1.0 (2021-01-05):
|
|
11
|
+
|
|
12
|
+
* Fixed SQL traces being generated with invalid ID.
|
|
13
|
+
* Fixed log message for minimum supported Node.js version.
|
|
14
|
+
* Added Fastify v3 support.
|
|
15
|
+
* Fixed empty log message for Infinite Tracing connections.
|
|
16
|
+
* Upgraded grpc version.
|
|
17
|
+
* Fixed bug that prevented users from changing Infinite Tracing queue size.
|
|
18
|
+
|
|
19
|
+
### 7.0.2 (2020-12-01):
|
|
20
|
+
|
|
21
|
+
* Fixed a bug where the `http.statusCode` attribute was not being captured for an async invoked lambda.
|
|
22
|
+
* Fixed typos in code comments, documentation, and debugging logger messages.
|
|
23
|
+
Thank you @TysonAndre for the contribution.
|
|
24
|
+
|
|
25
|
+
### 7.0.1 (2020-11-17):
|
|
26
|
+
|
|
27
|
+
* Fixed a bug where spans queued up during backpressure situations would be improperly formatted and ultimately dropped when sent to an Infinite Tracing trace observer.
|
|
28
|
+
* Updated @grpc/grpc-js to version v1.2.0.
|
|
29
|
+
* Updated tap to clear up npm audit issues around lodash sub-dependency.
|
|
30
|
+
|
|
1
31
|
### 7.0.0 (2020-11-09):
|
|
2
32
|
|
|
3
33
|
* Added official parity support for Node 14
|
|
@@ -330,7 +360,7 @@ Special thanks to Ryan Copley (@RyanCopley) for the contribution.
|
|
|
330
360
|
object from API#getLinkingMetadata().
|
|
331
361
|
|
|
332
362
|
This issue would cause the `@newrelic/winston-enricher` module to crash when
|
|
333
|
-
attempting to inject log
|
|
363
|
+
attempting to inject log metadata.
|
|
334
364
|
|
|
335
365
|
* Reduced logging level of raw `x-queue-start` or `x-request-start` header values
|
|
336
366
|
to avoid logging very large values at default logging levels.
|
|
@@ -3282,7 +3312,7 @@ Special thanks to Ryan Copley (@RyanCopley) for the contribution.
|
|
|
3282
3312
|
|
|
3283
3313
|
* Fixed a bug where custom events weren't being sent.
|
|
3284
3314
|
|
|
3285
|
-
In a refactor of our data collection cycle, we
|
|
3315
|
+
In a refactor of our data collection cycle, we omitted the custom
|
|
3286
3316
|
events from the list of commands, this is now fixed.
|
|
3287
3317
|
|
|
3288
3318
|
* Fixed a very rare bug where the custom event pool could be set to 10
|
|
@@ -3506,7 +3536,7 @@ Special thanks to Ryan Copley (@RyanCopley) for the contribution.
|
|
|
3506
3536
|
ended when the view ended.
|
|
3507
3537
|
|
|
3508
3538
|
* Added a configuration option to completely disable logging. `logger.enabled`
|
|
3509
|
-
defaults to true, if set to false it
|
|
3539
|
+
defaults to true, if set to false it won't try to create the log file.
|
|
3510
3540
|
|
|
3511
3541
|
### v1.16.2 (2015-02-13):
|
|
3512
3542
|
|
|
@@ -4277,7 +4307,7 @@ Special thanks to Ryan Copley (@RyanCopley) for the contribution.
|
|
|
4277
4307
|
too many times. Thanks to José F. Romaniello for confirming the fix.
|
|
4278
4308
|
* Changed how requests handled by Express and Restify routes are named. This
|
|
4279
4309
|
change is being rolled out both in this module and on the New Relic website,
|
|
4280
|
-
so there is a chance you will see the same route (or very
|
|
4310
|
+
so there is a chance you will see the same route (or very similar routes)
|
|
4281
4311
|
show up twice in aggregated metrics.
|
|
4282
4312
|
* Dropped the default apdex tolerating value from 500 milliseconds to 100
|
|
4283
4313
|
milliseconds. This means that transactions slower than 400 milliseconds will
|
|
@@ -4514,7 +4544,7 @@ Special thanks to Ryan Copley (@RyanCopley) for the contribution.
|
|
|
4514
4544
|
crash.
|
|
4515
4545
|
* Some metric normalization rules were not being interpreted correctly, leading
|
|
4516
4546
|
to malformed normalized metric names.
|
|
4517
|
-
* Metric normalization rules that
|
|
4547
|
+
* Metric normalization rules that specified that matching metrics were to be
|
|
4518
4548
|
ignored were not being enforced.
|
|
4519
4549
|
|
|
4520
4550
|
### v0.9.12-91 / beta-12 (2012-12-28):
|
package/ROADMAP_Node.md
CHANGED
|
@@ -15,7 +15,7 @@ This roadmap project is broken down into the following sections:
|
|
|
15
15
|
- **Next**:
|
|
16
16
|
- This section contains work planned within the next three months. These features may still be deprioritized and moved to Future.
|
|
17
17
|
- **Future**:
|
|
18
|
-
- This section is for ideas for future work that is
|
|
18
|
+
- This section is for ideas for future work that is aligned with the product vision and possible opportunities for community contribution. It contains a list of features that anyone can implement. No guarantees can be provided on if or when these features will be completed.
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
**The roadmap project is found [here](https://github.com/orgs/newrelic/projects/11)**
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -35,6 +35,7 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
35
35
|
|
|
36
36
|
* [@newrelic/proxy](#newrelicproxy)
|
|
37
37
|
* [@newrelic/test-utilities](#newrelictest-utilities)
|
|
38
|
+
* [@octokit/rest](#octokitrest)
|
|
38
39
|
* [JSV](#JSV)
|
|
39
40
|
* [architect](#architect)
|
|
40
41
|
* [benchmark](#benchmark)
|
|
@@ -68,15 +69,12 @@ code, the source code can be found at [https://github.com/newrelic/node-newrelic
|
|
|
68
69
|
* [through](#through)
|
|
69
70
|
* [when](#when)
|
|
70
71
|
|
|
71
|
-
**[additional-licenses](#additional-licenses)**
|
|
72
|
-
|
|
73
|
-
* [symantec](#symantec)
|
|
74
72
|
|
|
75
73
|
## dependencies
|
|
76
74
|
|
|
77
75
|
### @grpc/grpc-js
|
|
78
76
|
|
|
79
|
-
This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.
|
|
77
|
+
This product includes source derived from [@grpc/grpc-js](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js) ([v1.2.5](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.2.5)), distributed under the [Apache-2.0 License](https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.2.5/LICENSE):
|
|
80
78
|
|
|
81
79
|
```
|
|
82
80
|
Apache License
|
|
@@ -1755,23 +1753,41 @@ This product includes source derived from [@newrelic/test-utilities](https://git
|
|
|
1755
1753
|
|
|
1756
1754
|
```
|
|
1757
1755
|
|
|
1758
|
-
###
|
|
1756
|
+
### @octokit/rest
|
|
1759
1757
|
|
|
1760
|
-
This product includes source derived from [
|
|
1758
|
+
This product includes source derived from [@octokit/rest](https://github.com/octokit/rest.js) ([v18.0.15](https://github.com/octokit/rest.js/tree/v18.0.15)), distributed under the [MIT License](https://github.com/octokit/rest.js/blob/v18.0.15/LICENSE):
|
|
1761
1759
|
|
|
1762
1760
|
```
|
|
1763
|
-
|
|
1761
|
+
The MIT License
|
|
1762
|
+
|
|
1763
|
+
Copyright (c) 2012 Cloud9 IDE, Inc. (Mike de Boer)
|
|
1764
|
+
Copyright (c) 2017-2018 Octokit contributors
|
|
1765
|
+
|
|
1766
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1767
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
1768
|
+
in the Software without restriction, including without limitation the rights
|
|
1769
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1770
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
1771
|
+
furnished to do so, subject to the following conditions:
|
|
1772
|
+
|
|
1773
|
+
The above copyright notice and this permission notice shall be included in
|
|
1774
|
+
all copies or substantial portions of the Software.
|
|
1775
|
+
|
|
1776
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1777
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1778
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1779
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1780
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1781
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1782
|
+
THE SOFTWARE.
|
|
1764
1783
|
|
|
1765
|
-
|
|
1766
|
-
permitted provided that the following conditions are met:
|
|
1784
|
+
```
|
|
1767
1785
|
|
|
1768
|
-
|
|
1769
|
-
conditions and the following disclaimer.
|
|
1786
|
+
### JSV
|
|
1770
1787
|
|
|
1771
|
-
|
|
1772
|
-
of conditions and the following disclaimer in the documentation and/or other materials
|
|
1773
|
-
provided with the distribution.
|
|
1788
|
+
This product includes source derived from [JSV](https://github.com/garycourt/JSV) ([v4.0.2](https://github.com/garycourt/JSV/tree/v4.0.2)), distributed under the [FreeBSD License](https://github.com/garycourt/JSV/tree/v4.0.2#license):
|
|
1774
1789
|
|
|
1790
|
+
```
|
|
1775
1791
|
THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
1776
1792
|
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
1777
1793
|
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
|
|
@@ -2888,7 +2904,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
2888
2904
|
|
|
2889
2905
|
### tap
|
|
2890
2906
|
|
|
2891
|
-
This product includes source derived from [tap](https://github.com/tapjs/node-tap) ([v14.10.
|
|
2907
|
+
This product includes source derived from [tap](https://github.com/tapjs/node-tap) ([v14.10.8](https://github.com/tapjs/node-tap/tree/v14.10.8)), distributed under the [ISC License](https://github.com/tapjs/node-tap/blob/v14.10.8/LICENSE):
|
|
2892
2908
|
|
|
2893
2909
|
```
|
|
2894
2910
|
The ISC License
|
|
@@ -3000,6 +3016,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
3000
3016
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
3001
3017
|
```
|
|
3002
3018
|
|
|
3019
|
+
|
|
3003
3020
|
## additional-licenses
|
|
3004
3021
|
|
|
3005
3022
|
### symantec
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const fs = require('fs')
|
|
4
|
+
const github = require('./github')
|
|
5
|
+
|
|
6
|
+
const FILE_NAME = 'NEWS.md'
|
|
7
|
+
const PROPOSED_NOTES_HEADER = 'Proposed Release Notes'
|
|
8
|
+
const NEXT_VERSION_HEADER = '### vNext (TBD):'
|
|
9
|
+
|
|
10
|
+
async function generateReleaseNotes() {
|
|
11
|
+
try {
|
|
12
|
+
const latestRelease = await github.getLatestRelease()
|
|
13
|
+
console.log(`The latest release is: ${latestRelease.name} published: ${latestRelease.published_at}`)
|
|
14
|
+
console.log(`Tag: ${latestRelease.tag_name}, Target: ${latestRelease.target_commitish}`)
|
|
15
|
+
|
|
16
|
+
const tag = await github.getTagByName(latestRelease.tag_name)
|
|
17
|
+
console.log('The tag commit sha is: ', tag.commit.sha)
|
|
18
|
+
|
|
19
|
+
const commit = await github.getCommit(tag.commit.sha)
|
|
20
|
+
const commitDate = commit.commit.committer.date
|
|
21
|
+
|
|
22
|
+
console.log(`Finding merged pull requests since: ${commitDate}`)
|
|
23
|
+
|
|
24
|
+
const mergedPullRequests = await github.getMergedPullRequestsSince(commitDate)
|
|
25
|
+
console.log(`Found ${mergedPullRequests.length}`)
|
|
26
|
+
|
|
27
|
+
const releaseNoteData = mergedPullRequests.map((pr) => {
|
|
28
|
+
const parts = pr.body.split(/(?:^|\n)##\s*/g)
|
|
29
|
+
const {1: proposedReleaseNotes} = parts
|
|
30
|
+
|
|
31
|
+
const titleRemoved = proposedReleaseNotes.replace(PROPOSED_NOTES_HEADER, '')
|
|
32
|
+
return {
|
|
33
|
+
notes: titleRemoved,
|
|
34
|
+
url: pr.html_url
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const finalData = releaseNoteData.reduce((result, currentValue) => {
|
|
39
|
+
result.notes += '\n\n' + currentValue.notes.trim()
|
|
40
|
+
result.links += `\n\n* PR: ${currentValue.url}\n`
|
|
41
|
+
return result
|
|
42
|
+
}, {
|
|
43
|
+
notes: '',
|
|
44
|
+
links: ''
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
console.log('Final data: ', JSON.stringify(finalData))
|
|
48
|
+
|
|
49
|
+
await updateReleaseNotes(FILE_NAME, finalData.notes)
|
|
50
|
+
|
|
51
|
+
console.log('*** [SUCCESS] ***')
|
|
52
|
+
} catch(err) {
|
|
53
|
+
console.log('! [FAILURE] !')
|
|
54
|
+
console.error(err)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function updateReleaseNotes(file, newNotes) {
|
|
59
|
+
const promise = new Promise((resolve, reject) => {
|
|
60
|
+
fs.readFile(file, 'utf8', function (err, data) {
|
|
61
|
+
if (err) {
|
|
62
|
+
return reject(err)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (data.startsWith(NEXT_VERSION_HEADER)) {
|
|
66
|
+
const errMessage = [
|
|
67
|
+
`${file} already contains '${NEXT_VERSION_HEADER}'`,
|
|
68
|
+
'Delete existing vNext release notes (if desired) and run again'
|
|
69
|
+
].join('\n')
|
|
70
|
+
|
|
71
|
+
return reject(new Error(errMessage))
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const newContent = [
|
|
75
|
+
NEXT_VERSION_HEADER,
|
|
76
|
+
newNotes,
|
|
77
|
+
'\n\n',
|
|
78
|
+
data
|
|
79
|
+
].join('')
|
|
80
|
+
|
|
81
|
+
fs.writeFile(file, newContent, 'utf8', function (err) {
|
|
82
|
+
if (err) {
|
|
83
|
+
return reject(err)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
console.log(`Added new release notes to ${file} under the ${NEXT_VERSION_HEADER}`)
|
|
87
|
+
|
|
88
|
+
resolve()
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
return promise
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
generateReleaseNotes()
|
package/bin/github.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const { Octokit } = require("@octokit/rest")
|
|
4
|
+
|
|
5
|
+
const repoOwner = 'newrelic'
|
|
6
|
+
const repository = 'node-newrelic'
|
|
7
|
+
|
|
8
|
+
if (!process.env.GITHUB_TOKEN) {
|
|
9
|
+
console.log('GITHUB_TOKEN recommended to be set in ENV')
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const octokit = new Octokit({
|
|
13
|
+
auth: process.env.GITHUB_TOKEN,
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
async function getLatestRelease() {
|
|
17
|
+
const result = await octokit.repos.getLatestRelease({
|
|
18
|
+
owner: repoOwner,
|
|
19
|
+
repo: repository
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
return result.data
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function getTagByName(name) {
|
|
26
|
+
const perPage = 100
|
|
27
|
+
|
|
28
|
+
let pageNum = 1
|
|
29
|
+
|
|
30
|
+
let result = null
|
|
31
|
+
do {
|
|
32
|
+
result = await octokit.repos.listTags({
|
|
33
|
+
owner: repoOwner,
|
|
34
|
+
repo: repository,
|
|
35
|
+
per_page: perPage,
|
|
36
|
+
page: pageNum
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const found = result.data.find((tag) => {
|
|
40
|
+
return tag.name === name
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
if (found) {
|
|
44
|
+
return found
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
pageNum++
|
|
48
|
+
} while (result.data.length === perPage) // there *might* be more data
|
|
49
|
+
|
|
50
|
+
return null
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function getCommit(sha) {
|
|
54
|
+
const result = await octokit.repos.getCommit({
|
|
55
|
+
owner: repoOwner,
|
|
56
|
+
repo: repository,
|
|
57
|
+
ref: sha
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
return result.data
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function getMergedPullRequestsSince(date) {
|
|
64
|
+
const perPage = 50
|
|
65
|
+
|
|
66
|
+
const comparisonDate = new Date(date)
|
|
67
|
+
|
|
68
|
+
let pageNum = 1
|
|
69
|
+
const mergedPullRequests = []
|
|
70
|
+
let result = null
|
|
71
|
+
let hadData = false
|
|
72
|
+
|
|
73
|
+
do {
|
|
74
|
+
result = await octokit.pulls.list({
|
|
75
|
+
owner: repoOwner,
|
|
76
|
+
repo: repository,
|
|
77
|
+
state: 'closed',
|
|
78
|
+
sort: 'updated',
|
|
79
|
+
direction: 'desc',
|
|
80
|
+
per_page: perPage,
|
|
81
|
+
page: pageNum
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
const mergedPrs = result.data.filter((pr) => {
|
|
85
|
+
return pr.merged_at && new Date(pr.merged_at) > comparisonDate
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
mergedPullRequests.push(...mergedPrs)
|
|
89
|
+
// Since we are going by 'updated' on query but merged on filter,
|
|
90
|
+
// there's a chance some boundaries are off. While in super extreme
|
|
91
|
+
// cases we could still miss some it is unlikely given we are grabbing
|
|
92
|
+
// large pages.
|
|
93
|
+
hadData = mergedPrs.length > 0
|
|
94
|
+
|
|
95
|
+
pageNum++
|
|
96
|
+
} while (result.data.length === perPage && hadData) // might be more in next batch
|
|
97
|
+
|
|
98
|
+
return mergedPullRequests
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
module.exports = {
|
|
102
|
+
getLatestRelease,
|
|
103
|
+
getTagByName,
|
|
104
|
+
getCommit,
|
|
105
|
+
getMergedPullRequestsSince
|
|
106
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Executed as a part of the "version" step of npm version.
|
|
5
|
+
* Updates the placeholder release note header with the incremented version
|
|
6
|
+
* from running npm version
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs')
|
|
10
|
+
const packageInfo = require('../package.json')
|
|
11
|
+
|
|
12
|
+
const FILE_NAME = 'NEWS.md'
|
|
13
|
+
const NEXT_VERSION_HEADER = '### vNext (TBD):'
|
|
14
|
+
|
|
15
|
+
const SUCCESS_MSG = '*** [SUCCESS] ***'
|
|
16
|
+
const FAIL_MSG = '! [FAILURE] !'
|
|
17
|
+
|
|
18
|
+
updateChangelogVersion()
|
|
19
|
+
|
|
20
|
+
async function updateChangelogVersion() {
|
|
21
|
+
try {
|
|
22
|
+
await updateHeader(FILE_NAME)
|
|
23
|
+
|
|
24
|
+
console.log(SUCCESS_MSG)
|
|
25
|
+
} catch (err) {
|
|
26
|
+
console.log(FAIL_MSG)
|
|
27
|
+
console.error(err)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function updateHeader(file) {
|
|
32
|
+
const promise = new Promise((resolve, reject) => {
|
|
33
|
+
fs.readFile(file, 'utf8', (err, data) => {
|
|
34
|
+
if (err) {
|
|
35
|
+
return reject(err)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// toISOString() will always return UTC time
|
|
39
|
+
const todayFormatted = new Date().toISOString().split('T')[0]
|
|
40
|
+
const version = `v${packageInfo.version}`
|
|
41
|
+
const newChangelogHeader = `### ${version} (${todayFormatted})`
|
|
42
|
+
|
|
43
|
+
console.log('Updating vNext header to: ', newChangelogHeader)
|
|
44
|
+
|
|
45
|
+
if (!data.startsWith(NEXT_VERSION_HEADER)) {
|
|
46
|
+
const err = new Error(`Failed to find next version header in form: '${NEXT_VERSION_HEADER}'`)
|
|
47
|
+
return reject(err)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const modified = data.replace(
|
|
51
|
+
NEXT_VERSION_HEADER,
|
|
52
|
+
newChangelogHeader
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
fs.writeFile(file, modified, 'utf8', (err) => {
|
|
56
|
+
if (err) {
|
|
57
|
+
return reject (err)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
console.log(SUCCESS_MSG)
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
return promise
|
|
66
|
+
}
|
package/index.js
CHANGED
|
@@ -51,13 +51,13 @@ function initialize() {
|
|
|
51
51
|
// TODO: Update this check when Node v10 is deprecated.
|
|
52
52
|
if (psemver.satisfies('<10.0.0')) {
|
|
53
53
|
message = 'New Relic for Node.js requires a version of Node equal to or\n' +
|
|
54
|
-
'greater than
|
|
54
|
+
'greater than 10.0.0. Not starting!'
|
|
55
55
|
|
|
56
56
|
logger.error(message)
|
|
57
57
|
throw new Error(message)
|
|
58
58
|
|
|
59
59
|
// TODO: Update this check when Node v16 support is added
|
|
60
|
-
} else if (!psemver.satisfies(pkgJSON.engines.node) || psemver.satisfies('>=15.0.0')) {
|
|
60
|
+
} else if (!psemver.satisfies(pkgJSON.engines.node) || psemver.satisfies('>=15.0.0')) {
|
|
61
61
|
logger.warn(
|
|
62
62
|
'New Relic for Node.js %s has not been tested on Node.js %s. Please ' +
|
|
63
63
|
'update the agent or downgrade your version of Node.js',
|
package/lib/collector/api.js
CHANGED
|
@@ -511,12 +511,12 @@ CollectorAPI.prototype._sendData = function _sendData(method, data, callback) {
|
|
|
511
511
|
if (response.agentRun === AGENT_RUN_BEHAVIOR.SHUTDOWN) {
|
|
512
512
|
// TODO: for now, shut handled in _handleResponseCode for consistency
|
|
513
513
|
// either find way to safely change while side-by-side or move
|
|
514
|
-
// once side-by-side gone. Currently, stop is called twice on
|
|
514
|
+
// once side-by-side gone. Currently, stop is called twice on the old code path
|
|
515
515
|
|
|
516
516
|
// TODO: almost seems better to let aggregator finish (cb) then shutdown?
|
|
517
517
|
|
|
518
518
|
// this._agent.stop((err) => {
|
|
519
|
-
// // TODO: agent stop requires a callback. if we don't care to do
|
|
519
|
+
// // TODO: agent stop requires a callback. if we don't care to do anything here
|
|
520
520
|
// // do we loosen that requirement or perhaps have a different "shutdown"
|
|
521
521
|
// // method? Does seem like you'd want to log a shutdown error
|
|
522
522
|
// // but don't really care about that *here*
|
|
@@ -42,7 +42,7 @@ exports.keepAliveAgent = function keepAliveAgent(config) {
|
|
|
42
42
|
* NPM package with configuration suitable for working via
|
|
43
43
|
* the configured newrelic-agent's proxy configuration.
|
|
44
44
|
*
|
|
45
|
-
* Include keep-alive configuration, but
|
|
45
|
+
* Include keep-alive configuration, but ultimately its up
|
|
46
46
|
* to the proxy server as to how its connection is made
|
|
47
47
|
* with New Relic's servers.
|
|
48
48
|
*/
|
|
@@ -190,7 +190,7 @@ RemoteMethod.prototype._safeRequest = function _safeRequest(options) {
|
|
|
190
190
|
throw new Error('Maximum payload size exceeded')
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
// If trace level is not
|
|
193
|
+
// If trace level is not explicitly enabled check to see if the audit log is
|
|
194
194
|
// enabled.
|
|
195
195
|
if (logConfig != null && logConfig.level !== 'trace' && auditLog.enabled) {
|
|
196
196
|
// If the filter property is empty, then always log the event otherwise
|
|
@@ -145,7 +145,7 @@ AttributeFilter.prototype._filter = function _filter(scope, destinations, key) {
|
|
|
145
145
|
var globalInclude = null
|
|
146
146
|
var globalExclude = null
|
|
147
147
|
|
|
148
|
-
// Iterate over each
|
|
148
|
+
// Iterate over each destination and see if the rules apply.
|
|
149
149
|
for (var i = 0; i < scope.length; ++i) {
|
|
150
150
|
var dest = scope[i]
|
|
151
151
|
var destId = dest.id
|
package/lib/config/default.js
CHANGED
|
@@ -231,7 +231,7 @@ exports.config = () => ({
|
|
|
231
231
|
enabled: false,
|
|
232
232
|
|
|
233
233
|
/**
|
|
234
|
-
* Specify which methods are logged. Used in
|
|
234
|
+
* Specify which methods are logged. Used in conjunction with the audit_log flag
|
|
235
235
|
* If audit_log is enabled and this property is empty, all methods will be logged
|
|
236
236
|
* Otherwise, if the audit log is enabled, only the methods specified
|
|
237
237
|
* in the filter will be logged
|
|
@@ -340,7 +340,7 @@ exports.config = () => ({
|
|
|
340
340
|
detect_aws: true,
|
|
341
341
|
/**
|
|
342
342
|
* This flag dictates whether the agent attempts to detect if the
|
|
343
|
-
* the process is running on Pivotal Cloud
|
|
343
|
+
* the process is running on Pivotal Cloud Foundry.
|
|
344
344
|
*
|
|
345
345
|
* @env NEW_RELIC_UTILIZATION_DETECT_PCF
|
|
346
346
|
*/
|
|
@@ -846,7 +846,7 @@ exports.config = () => ({
|
|
|
846
846
|
enabled: false,
|
|
847
847
|
|
|
848
848
|
/**
|
|
849
|
-
*
|
|
849
|
+
* Excludes New Relic format distributed tracing header (`newrelic`) on
|
|
850
850
|
* outbound requests when set to `true`. By default (when false)
|
|
851
851
|
* both W3C TraceContext (`traceparent`, `tracecontext`) and
|
|
852
852
|
* New Relic formats will be sent.
|
package/lib/config/env.js
CHANGED
|
@@ -157,7 +157,9 @@ const ENV_MAPPING = {
|
|
|
157
157
|
host: 'NEW_RELIC_INFINITE_TRACING_TRACE_OBSERVER_HOST',
|
|
158
158
|
port: 'NEW_RELIC_INFINITE_TRACING_TRACE_OBSERVER_PORT'
|
|
159
159
|
},
|
|
160
|
-
|
|
160
|
+
span_events: {
|
|
161
|
+
queue_size: 'NEW_RELIC_INFINITE_TRACING_SPAN_EVENTS_QUEUE_SIZE'
|
|
162
|
+
}
|
|
161
163
|
}
|
|
162
164
|
}
|
|
163
165
|
|
package/lib/config/index.js
CHANGED
|
@@ -1460,7 +1460,7 @@ Config.prototype.applyLasp = function applyLasp(agent, policies) {
|
|
|
1460
1460
|
var localVal = settingBlock[valueName]
|
|
1461
1461
|
|
|
1462
1462
|
// Indexes into "allowed values" based on "enabled" setting
|
|
1463
|
-
// to
|
|
1463
|
+
// to retrieve proper mapping.
|
|
1464
1464
|
var policyValues = localMapping.allowedValues
|
|
1465
1465
|
var policyValue = policyValues[policy.enabled ? 1 : 0]
|
|
1466
1466
|
|
|
@@ -1602,7 +1602,7 @@ Config.prototype.getAggregatorConfig = function getAggregatorConfig(method) {
|
|
|
1602
1602
|
* 5. If this module is installed as a dependency, the directory above the
|
|
1603
1603
|
* node_modules folder in which newrelic is installed.
|
|
1604
1604
|
*
|
|
1605
|
-
* For
|
|
1605
|
+
* For configuration via environment (useful on Joyent, Azure, Heroku, or
|
|
1606
1606
|
* other PaaS offerings), set NEW_RELIC_NO_CONFIG_FILE to something truthy
|
|
1607
1607
|
* and read README.md for details on what configuration variables are
|
|
1608
1608
|
* necessary, as well as a complete enumeration of the other available
|
package/lib/db/parse-sql.js
CHANGED
|
@@ -22,7 +22,7 @@ var OPERATIONS = [
|
|
|
22
22
|
]
|
|
23
23
|
var COMMENT_PATTERN = /\/\\*.*?\\*\//
|
|
24
24
|
|
|
25
|
-
// This must be called
|
|
25
|
+
// This must be called synchronously after the initial db call for backtraces to
|
|
26
26
|
// work correctly
|
|
27
27
|
|
|
28
28
|
module.exports = function parseSql(type, sql) {
|
|
@@ -24,7 +24,7 @@ var OPERATIONS = [
|
|
|
24
24
|
]
|
|
25
25
|
var COMMENT_PATTERN = /\/\\*.*?\\*\//g
|
|
26
26
|
|
|
27
|
-
// This must be called
|
|
27
|
+
// This must be called synchronously after the initial db call for backtraces to
|
|
28
28
|
// work correctly
|
|
29
29
|
|
|
30
30
|
module.exports = function parseSql(sql) {
|
package/lib/db/slow-query.js
CHANGED
|
@@ -22,9 +22,8 @@ function SlowQuery(segment, type, query, trace) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
function normalizedHash(value) {
|
|
25
|
-
// We leverage the last
|
|
26
|
-
|
|
27
|
-
return parseInt(crypto.createHash('sha1').update(value).digest('hex').slice(-16), 16)
|
|
25
|
+
// We leverage the last 15 hex digits which will fit in a signed long
|
|
26
|
+
return parseInt(crypto.createHash('sha1').update(value).digest('hex').slice(-15), 16)
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
function formatTrace(trace) {
|
package/lib/grpc/connection.js
CHANGED
|
@@ -38,7 +38,7 @@ class GrpcConnection extends EventEmitter {
|
|
|
38
38
|
/**
|
|
39
39
|
* GrpcConnection constructor
|
|
40
40
|
*
|
|
41
|
-
* Standard property setting/
|
|
41
|
+
* Standard property setting/initialization, and sets an initial
|
|
42
42
|
* connection state of disconnected
|
|
43
43
|
*
|
|
44
44
|
* @param {Object} traceObserverConfig config item config.infinite_tracing.trace_observer
|
|
@@ -290,7 +290,7 @@ class GrpcConnection extends EventEmitter {
|
|
|
290
290
|
_generateCredentials(grpcApi) {
|
|
291
291
|
let certBuffer = null
|
|
292
292
|
|
|
293
|
-
// Current settable value for testing. If allowed to be
|
|
293
|
+
// Current settable value for testing. If allowed to be overridden via
|
|
294
294
|
// configuration, this should be removed in place of setting
|
|
295
295
|
// this._rootCerts from config via normal configuration precedence.
|
|
296
296
|
const envTestCerts = process.env.NEWRELIC_GRPCCONNECTION_CA
|
|
@@ -177,7 +177,7 @@ function wrapEmitWithTransaction(agent, emit, isHTTPS) {
|
|
|
177
177
|
'http.statusCode',
|
|
178
178
|
responseCode
|
|
179
179
|
)
|
|
180
|
-
|
|
180
|
+
|
|
181
181
|
segment.addSpanAttribute('http.statusCode', responseCode)
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -267,7 +267,7 @@ function wrapResponseEnd(agent, proto) {
|
|
|
267
267
|
return end.apply(this, arguments)
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
// If an error
|
|
270
|
+
// If an error happened, add it to the aggregator.
|
|
271
271
|
if (txInfo.error) {
|
|
272
272
|
if (!txInfo.errorHandled || urltils.isError(agent.config, this.statusCode)) {
|
|
273
273
|
agent.errors.add(txInfo.transaction, txInfo.error)
|
|
@@ -291,7 +291,7 @@ function wrapResponseEnd(agent, proto) {
|
|
|
291
291
|
})
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
// CAT this
|
|
294
|
+
// CAT this won't be used unless CAT is enabled, see below where we actually do
|
|
295
295
|
// the shimmer stuff if you'd like to verify.
|
|
296
296
|
function wrapWriteHead(agent, writeHead) {
|
|
297
297
|
return function wrappedWriteHead() {
|
|
@@ -59,7 +59,7 @@ function buildMiddlewareSpecForRouteHandler(shim, path) {
|
|
|
59
59
|
* then this method is required/useful again.
|
|
60
60
|
*
|
|
61
61
|
* The isFinal param determines whether or not a path is appended for
|
|
62
|
-
* this
|
|
62
|
+
* this particular piece of middleware. (i.e. if this is the final handler
|
|
63
63
|
* that is actually handling the request, the path is actually left on)
|
|
64
64
|
*/
|
|
65
65
|
next: function wrapNext(shim, fn, fnName, args, bindSegment) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
+
const semver = require('semver')
|
|
2
3
|
const {
|
|
3
4
|
buildMiddlewareSpecForRouteHandler,
|
|
4
5
|
buildMiddlewareSpecForMiddlewareFunction
|
|
@@ -37,6 +38,12 @@ const setupRouteHandler = (shim, fastify) => {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
const setupMiddlewareHandlers = (shim, fastify) => {
|
|
41
|
+
// Don't wrap use() in fastify v3+
|
|
42
|
+
const fastifyVersion = shim.require('./package.json').version
|
|
43
|
+
if (semver.satisfies(fastifyVersion, '>=3.0.0')) {
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
|
|
40
47
|
shim.wrap(fastify, 'use', function wrapFastifyUse(shim, fn) {
|
|
41
48
|
return function wrappedFastifyUser() {
|
|
42
49
|
const args = shim.argsToArray.apply(shim, arguments)
|
package/lib/proxy/grpc.js
CHANGED
|
@@ -8,7 +8,7 @@ class ProxyGrpc {
|
|
|
8
8
|
constructor(grpcLibrary = '@grpc/grpc-js') {
|
|
9
9
|
this.library = require(grpcLibrary)
|
|
10
10
|
|
|
11
|
-
// add methods or
|
|
11
|
+
// add methods or objects from base grpc class that we need as needed
|
|
12
12
|
this.credentials = this.library.credentials
|
|
13
13
|
this.Metadata = this.library.Metadata
|
|
14
14
|
this.loadPackageDefinition = this.library.loadPackageDefinition
|
|
@@ -129,7 +129,6 @@ class AwsLambda {
|
|
|
129
129
|
const segmentRecorder = isApiGatewayLambdaProxy ? recordWeb : recordBackground
|
|
130
130
|
const segment = shim.createSegment(functionName, segmentRecorder)
|
|
131
131
|
transaction.baseSegment = segment
|
|
132
|
-
|
|
133
132
|
// resultProcessor is used to execute additional logic based on the
|
|
134
133
|
// payload supplied to the callback.
|
|
135
134
|
let resultProcessor
|
|
@@ -180,7 +179,6 @@ class AwsLambda {
|
|
|
180
179
|
shim.agent.setLambdaArn(context.invokedFunctionArn)
|
|
181
180
|
|
|
182
181
|
shim.agent.setLambdaFunctionVersion(context.functionVersion)
|
|
183
|
-
|
|
184
182
|
segment.addSpanAttributes(awsAttributes)
|
|
185
183
|
|
|
186
184
|
segment.start()
|
|
@@ -194,7 +192,7 @@ class AwsLambda {
|
|
|
194
192
|
throw err
|
|
195
193
|
}
|
|
196
194
|
if (shim.isPromise(res)) {
|
|
197
|
-
res = lambdaInterceptPromise(res, txnEnder)
|
|
195
|
+
res = lambdaInterceptPromise(res, resultProcessor, txnEnder)
|
|
198
196
|
}
|
|
199
197
|
return res
|
|
200
198
|
}
|
|
@@ -202,8 +200,11 @@ class AwsLambda {
|
|
|
202
200
|
// In order to capture error events
|
|
203
201
|
// we need to store the error in uncaughtException
|
|
204
202
|
// otherwise the transaction will end before they are captured
|
|
205
|
-
function lambdaInterceptPromise(prom, cb) {
|
|
203
|
+
function lambdaInterceptPromise(prom, resultProcessor, cb) {
|
|
206
204
|
return prom.then(function onThen(arg) {
|
|
205
|
+
if (resultProcessor) {
|
|
206
|
+
resultProcessor(arg)
|
|
207
|
+
}
|
|
207
208
|
cb()
|
|
208
209
|
return arg
|
|
209
210
|
}, function onCatch(err) {
|
|
@@ -397,7 +398,10 @@ function setWebResponse(transaction, response) {
|
|
|
397
398
|
responseCode
|
|
398
399
|
)
|
|
399
400
|
|
|
400
|
-
|
|
401
|
+
// We are adding http.statusCode to base segment as
|
|
402
|
+
// we found in testing async invoked lambdas, the
|
|
403
|
+
// active segement is not available at this point.
|
|
404
|
+
const segment = transaction.baseSegment
|
|
401
405
|
|
|
402
406
|
segment.addSpanAttribute('http.statusCode', responseCode)
|
|
403
407
|
}
|
package/lib/shim/promise-shim.js
CHANGED
|
@@ -46,7 +46,7 @@ class PromiseShim extends Shim {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
* Sets the class used to
|
|
49
|
+
* Sets the class used to identify promises from the wrapped promise library.
|
|
50
50
|
*
|
|
51
51
|
* @param {function} clss - The promise library's class.
|
|
52
52
|
*/
|
package/lib/shim/shim.js
CHANGED
|
@@ -308,7 +308,7 @@ Shim.prototype.__NR_unwrap = unwrapAll
|
|
|
308
308
|
*
|
|
309
309
|
* @description
|
|
310
310
|
* The syntax for declarative instrumentation. It can be used interlaced with
|
|
311
|
-
* custom, hand-written instrumentation for one-off or hard to
|
|
311
|
+
* custom, hand-written instrumentation for one-off or hard to simplify
|
|
312
312
|
* instrumentation logic.
|
|
313
313
|
*
|
|
314
314
|
* @property {Spec|WrapFunction} $return
|
|
@@ -1949,10 +1949,10 @@ function bindPromise(promise, segment) {
|
|
|
1949
1949
|
* Copies the given parameters onto the segment, respecting the current agent
|
|
1950
1950
|
* configuration.
|
|
1951
1951
|
*
|
|
1952
|
-
* @memberof Shim.
|
|
1952
|
+
* @memberof Shim.prototype
|
|
1953
1953
|
*
|
|
1954
1954
|
* @param {TraceSegment} segment - The segment to copy the parameters onto.
|
|
1955
|
-
* @param {object} parameters - The
|
|
1955
|
+
* @param {object} parameters - The parameters to copy.
|
|
1956
1956
|
*/
|
|
1957
1957
|
function copySegmentParameters(segment, parameters) {
|
|
1958
1958
|
for (var key in parameters) {
|
|
@@ -184,7 +184,7 @@ function bindCreateTransaction(nodule, property, spec) {
|
|
|
184
184
|
*
|
|
185
185
|
* - `pushTransactionName(pathSegment)`
|
|
186
186
|
*
|
|
187
|
-
* Transactions are named for the middlware that sends the
|
|
187
|
+
* Transactions are named for the middlware that sends the response. Some web
|
|
188
188
|
* frameworks are capable of mounting middlware in complex routing stacks. In
|
|
189
189
|
* order to maintain the correct name, transactions keep a stack of mount points
|
|
190
190
|
* for each middlware/router/app/whatever. The instrumentation should push on
|
|
@@ -331,7 +331,7 @@ function setFramework(framework) {
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
/**
|
|
334
|
-
* Sets the URI path to be used for naming the transaction
|
|
334
|
+
* Sets the URI path to be used for naming the transaction currently in scope.
|
|
335
335
|
*
|
|
336
336
|
* @memberof WebFrameworkShim.prototype
|
|
337
337
|
*
|
package/lib/shimmer.js
CHANGED
|
@@ -381,7 +381,7 @@ var shimmer = module.exports = {
|
|
|
381
381
|
* Forces file name resolve for modules not in our cache when
|
|
382
382
|
* their parent has already been loaded/cached by Node.
|
|
383
383
|
* Provides a fall-back for unexpected cases that may occur.
|
|
384
|
-
* Also provides
|
|
384
|
+
* Also provides flexibility for testing now that node 11+ caches these.
|
|
385
385
|
* @param {*} request
|
|
386
386
|
* @param {*} parent
|
|
387
387
|
* @param {*} isMain
|
|
@@ -16,7 +16,7 @@ function createSpanEventAggregator(config, collector, metrics) {
|
|
|
16
16
|
// TODO: ideally this validation and configuration clearing would happen
|
|
17
17
|
// in the config. Since we don't currently have a way to generate
|
|
18
18
|
// support metrics in the config, keeping this related logic together here.
|
|
19
|
-
// If logic happened prior, could merely check for
|
|
19
|
+
// If logic happened prior, could merely check for existence of trace_observer.host.
|
|
20
20
|
shouldCreateStreaming = validateInfiniteTracing(config.infinite_tracing.trace_observer)
|
|
21
21
|
|
|
22
22
|
if (!shouldCreateStreaming) {
|
|
@@ -58,7 +58,7 @@ class StreamingSpanEventAggregator extends Aggregator {
|
|
|
58
58
|
// Only log once started. This will get invoked on initial harvest
|
|
59
59
|
// prior to start which we'll just ignore.
|
|
60
60
|
if (this.started) {
|
|
61
|
-
logger.warnOnce(SEND_WARNING)
|
|
61
|
+
logger.warnOnce('SEND_WARNING', SEND_WARNING)
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
this.emit(`finished ${this.method} data send.`)
|
package/lib/timer.js
CHANGED
|
@@ -112,7 +112,7 @@ Timer.prototype.hasEnd = function hasEnd() {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
/*
|
|
115
|
-
* Sets duration and stops the timer, since the passed-in duration will take
|
|
115
|
+
* Sets duration and stops the timer, since the passed-in duration will take precedence
|
|
116
116
|
* over the measured duration.
|
|
117
117
|
* @param {number} duration The duration the timer should report.
|
|
118
118
|
*/
|
|
@@ -12,7 +12,7 @@ const DT_VERSION_MINOR = 1
|
|
|
12
12
|
|
|
13
13
|
module.exports = class DistributedTracePayload {
|
|
14
14
|
/**
|
|
15
|
-
* The class
|
|
15
|
+
* The class responsible for producing distributed trace payloads.
|
|
16
16
|
* Created by calling {@link TransactionHandle#_createDistributedTracePayload}.
|
|
17
17
|
*
|
|
18
18
|
* @constructor
|
package/lib/transaction/index.js
CHANGED
|
@@ -509,7 +509,7 @@ Transaction.prototype._markAsWeb = function _markAsWeb(rawURL) {
|
|
|
509
509
|
* Sets the transaction's name and determines if it will be ignored.
|
|
510
510
|
*
|
|
511
511
|
* @param {string} [name]
|
|
512
|
-
* Optional. The partial name to use for the finalized transaction. If
|
|
512
|
+
* Optional. The partial name to use for the finalized transaction. If omitted
|
|
513
513
|
* the current partial name is used.
|
|
514
514
|
*/
|
|
515
515
|
Transaction.prototype.finalizeName = function finalizeName(name) {
|
|
@@ -813,7 +813,7 @@ Transaction.prototype.hasOnlyExpectedErrors = function hasOnlyExpectedErrors() {
|
|
|
813
813
|
|
|
814
814
|
for (let i = 0;i < this.exceptions.length;i++) {
|
|
815
815
|
const exception = this.exceptions[i]
|
|
816
|
-
// this
|
|
816
|
+
// this exception is neither expected nor ignored
|
|
817
817
|
const isUnexpected = !(
|
|
818
818
|
errorHelper.isExpectedException(
|
|
819
819
|
this,
|
|
@@ -27,7 +27,7 @@ const FLAGS = {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* The class
|
|
30
|
+
* The class responsible for accepting, validating, and producing w3c tracecontext headers.
|
|
31
31
|
*/
|
|
32
32
|
class TraceContext {
|
|
33
33
|
/**
|
|
@@ -255,7 +255,7 @@ class TraceContext {
|
|
|
255
255
|
return traceContextData
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
// Keep the raw, non-NewRelic tracestate string stored so that we can
|
|
258
|
+
// Keep the raw, non-NewRelic tracestate string stored so that we can propagate it
|
|
259
259
|
this._traceStateRaw = parsedState.newTraceState
|
|
260
260
|
|
|
261
261
|
// These need to be kept to be added to root span events as an attribute
|
package/lib/util/byte-limit.js
CHANGED
|
@@ -55,7 +55,7 @@ function truncate(val, limit) {
|
|
|
55
55
|
|
|
56
56
|
// Continue the binary search till:
|
|
57
57
|
// 1) The string is the desired length (i.e. cmpVal = 0) OR
|
|
58
|
-
// 2) The desired string must split a character to
|
|
58
|
+
// 2) The desired string must split a character to achieve the desired byte length
|
|
59
59
|
// In this case, we should cut the character that would be split.
|
|
60
60
|
// (i.e. delta > 1 character OR the string is larger than the limit)
|
|
61
61
|
var substr
|
|
@@ -81,7 +81,7 @@ exports.request = function request(opts, agent, cb) {
|
|
|
81
81
|
return cb(new Error('Request for metadata failed.'))
|
|
82
82
|
} else if (!data) {
|
|
83
83
|
logger.debug('Got no response data?')
|
|
84
|
-
return cb(new Error('No
|
|
84
|
+
return cb(new Error('No response data received.'))
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
cb(null, data.toString('utf8'))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "newrelic",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"author": "New Relic Node.js agent team <nodejs@newrelic.com>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"contributors": [
|
|
@@ -136,13 +136,15 @@
|
|
|
136
136
|
"unit": "rm -f newrelic_agent.log && time tap --test-regex='(\\/|^test\\/unit\\/.*\\.test\\.js)$' --timeout=180 --no-coverage",
|
|
137
137
|
"update-cross-agent-tests": "./bin/update-cats.sh",
|
|
138
138
|
"versioned-tests": "./bin/run-versioned-tests.sh",
|
|
139
|
-
"
|
|
139
|
+
"update-changelog-version": "node ./bin/update-changelog-version",
|
|
140
|
+
"versioned": "npm run prepare-test && time ./bin/run-versioned-tests.sh",
|
|
141
|
+
"version": "npm run update-changelog-version && git add ./NEWS.md"
|
|
140
142
|
},
|
|
141
143
|
"bin": {
|
|
142
144
|
"newrelic-naming-rules": "./bin/test-naming-rules.js"
|
|
143
145
|
},
|
|
144
146
|
"dependencies": {
|
|
145
|
-
"@grpc/grpc-js": "1.
|
|
147
|
+
"@grpc/grpc-js": "^1.2.5",
|
|
146
148
|
"@grpc/proto-loader": "^0.5.5",
|
|
147
149
|
"@newrelic/aws-sdk": "^3.0.0",
|
|
148
150
|
"@newrelic/koa": "^5.0.0",
|
|
@@ -161,6 +163,7 @@
|
|
|
161
163
|
"devDependencies": {
|
|
162
164
|
"@newrelic/proxy": "^2.0.0",
|
|
163
165
|
"@newrelic/test-utilities": "^5.0.0",
|
|
166
|
+
"@octokit/rest": "^18.0.15",
|
|
164
167
|
"JSV": "~4.0.2",
|
|
165
168
|
"architect": "*",
|
|
166
169
|
"benchmark": "^2.1.4",
|
|
@@ -187,7 +190,7 @@
|
|
|
187
190
|
"rimraf": "^2.6.3",
|
|
188
191
|
"should": "*",
|
|
189
192
|
"sinon": "^4.5.0",
|
|
190
|
-
"tap": "^14.10.
|
|
193
|
+
"tap": "^14.10.8",
|
|
191
194
|
"temp": "^0.8.1",
|
|
192
195
|
"through": "^2.3.6",
|
|
193
196
|
"when": "*"
|
package/stub_api.js
CHANGED
|
@@ -61,7 +61,7 @@ function setLambdaHandler(callback) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
function startSegment(name, record, handler, callback) {
|
|
64
|
-
logger.debug('Not calling `startSegment`
|
|
64
|
+
logger.debug('Not calling `startSegment` because New Relic is disabled.')
|
|
65
65
|
if (typeof handler === 'function') {
|
|
66
66
|
return handler(callback)
|
|
67
67
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"lastUpdated": "Mon
|
|
2
|
+
"lastUpdated": "Mon Feb 01 2021 09:58:16 GMT-0800 (Pacific Standard Time)",
|
|
3
3
|
"projectName": "New Relic Node Agent",
|
|
4
4
|
"projectUrl": "https://github.com/newrelic/node-newrelic",
|
|
5
5
|
"includeDev": true,
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@grpc/grpc-js@1.
|
|
7
|
+
"@grpc/grpc-js@1.2.5": {
|
|
8
8
|
"name": "@grpc/grpc-js",
|
|
9
|
-
"version": "1.
|
|
10
|
-
"range": "1.
|
|
9
|
+
"version": "1.2.5",
|
|
10
|
+
"range": "^1.2.5",
|
|
11
11
|
"licenses": "Apache-2.0",
|
|
12
12
|
"repoUrl": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
|
13
|
-
"versionedRepoUrl": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.
|
|
13
|
+
"versionedRepoUrl": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/tree/v1.2.5",
|
|
14
14
|
"licenseFile": "node_modules/@grpc/grpc-js/LICENSE",
|
|
15
|
-
"licenseUrl": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.
|
|
15
|
+
"licenseUrl": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js/blob/v1.2.5/LICENSE",
|
|
16
16
|
"licenseTextSource": "file",
|
|
17
17
|
"publisher": "Google Inc."
|
|
18
18
|
},
|
|
@@ -184,6 +184,17 @@
|
|
|
184
184
|
"publisher": "New Relic Node.js agent team",
|
|
185
185
|
"email": "nodejs@newrelic.com"
|
|
186
186
|
},
|
|
187
|
+
"@octokit/rest@18.0.15": {
|
|
188
|
+
"name": "@octokit/rest",
|
|
189
|
+
"version": "18.0.15",
|
|
190
|
+
"range": "^18.0.15",
|
|
191
|
+
"licenses": "MIT",
|
|
192
|
+
"repoUrl": "https://github.com/octokit/rest.js",
|
|
193
|
+
"versionedRepoUrl": "https://github.com/octokit/rest.js/tree/v18.0.15",
|
|
194
|
+
"licenseFile": "node_modules/@octokit/rest/LICENSE",
|
|
195
|
+
"licenseUrl": "https://github.com/octokit/rest.js/blob/v18.0.15/LICENSE",
|
|
196
|
+
"licenseTextSource": "file"
|
|
197
|
+
},
|
|
187
198
|
"JSV@4.0.2": {
|
|
188
199
|
"name": "JSV",
|
|
189
200
|
"version": "4.0.2",
|
|
@@ -552,15 +563,15 @@
|
|
|
552
563
|
"licenseTextSource": "file",
|
|
553
564
|
"publisher": "Christian Johansen"
|
|
554
565
|
},
|
|
555
|
-
"tap@14.10.
|
|
566
|
+
"tap@14.10.8": {
|
|
556
567
|
"name": "tap",
|
|
557
|
-
"version": "14.10.
|
|
558
|
-
"range": "^14.10.
|
|
568
|
+
"version": "14.10.8",
|
|
569
|
+
"range": "^14.10.8",
|
|
559
570
|
"licenses": "ISC",
|
|
560
571
|
"repoUrl": "https://github.com/tapjs/node-tap",
|
|
561
|
-
"versionedRepoUrl": "https://github.com/tapjs/node-tap/tree/v14.10.
|
|
572
|
+
"versionedRepoUrl": "https://github.com/tapjs/node-tap/tree/v14.10.8",
|
|
562
573
|
"licenseFile": "node_modules/tap/LICENSE",
|
|
563
|
-
"licenseUrl": "https://github.com/tapjs/node-tap/blob/v14.10.
|
|
574
|
+
"licenseUrl": "https://github.com/tapjs/node-tap/blob/v14.10.8/LICENSE",
|
|
564
575
|
"licenseTextSource": "file",
|
|
565
576
|
"publisher": "Isaac Z. Schlueter",
|
|
566
577
|
"email": "i@izs.me",
|