Skip to content

Commit 2c97488

Browse files
authoredFeb 22, 2024··
chore: Attached specs to the Shim.prototype for use in custom instrumentation and instrumentation outside of the agent (#2038)
1 parent 71ffa37 commit 2c97488

File tree

5 files changed

+45
-32
lines changed

5 files changed

+45
-32
lines changed
 

‎THIRD_PARTY_NOTICES.md

+7-20
Original file line numberDiff line numberDiff line change
@@ -1266,31 +1266,18 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12661266

12671267
### https-proxy-agent
12681268

1269-
This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) ([v7.0.3](https://github.com/TooTallNate/proxy-agents/tree/v7.0.3)), distributed under the [MIT License](https://github.com/TooTallNate/proxy-agents/blob/v7.0.3/LICENSE):
1269+
This product includes source derived from [https-proxy-agent](https://github.com/TooTallNate/proxy-agents) ([v7.0.2](https://github.com/TooTallNate/proxy-agents/tree/v7.0.2)), distributed under the [MIT License](https://github.com/TooTallNate/proxy-agents/blob/v7.0.2/README.md):
12701270

12711271
```
1272-
(The MIT License)
1272+
MIT License
12731273
1274-
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
1274+
Copyright (c) <year> <copyright holders>
12751275
1276-
Permission is hereby granted, free of charge, to any person obtaining
1277-
a copy of this software and associated documentation files (the
1278-
'Software'), to deal in the Software without restriction, including
1279-
without limitation the rights to use, copy, modify, merge, publish,
1280-
distribute, sublicense, and/or sell copies of the Software, and to
1281-
permit persons to whom the Software is furnished to do so, subject to
1282-
the following conditions:
1276+
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:
12831277
1284-
The above copyright notice and this permission notice shall be
1285-
included in all copies or substantial portions of the Software.
1278+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12861279
1287-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
1288-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1289-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1290-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
1291-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1292-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1293-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1280+
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.
12941281
```
12951282

12961283
### import-in-the-middle
@@ -2946,7 +2933,7 @@ SOFTWARE.
29462933

29472934
### lockfile-lint
29482935

2949-
This product includes source derived from [lockfile-lint](https://github.com/lirantal/lockfile-lint) ([v4.13.1](https://github.com/lirantal/lockfile-lint/tree/v4.13.1)), distributed under the [Apache-2.0 License](https://github.com/lirantal/lockfile-lint/blob/v4.13.1/LICENSE):
2936+
This product includes source derived from [lockfile-lint](https://github.com/lirantal/lockfile-lint) ([v4.12.1](https://github.com/lirantal/lockfile-lint/tree/v4.12.1)), distributed under the [Apache-2.0 License](https://github.com/lirantal/lockfile-lint/blob/v4.12.1/LICENSE):
29502937

29512938
```
29522939

‎lib/shim/shim.js

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ Shim.prototype.prefixRouteParameters = prefixRouteParameters
145145
Shim.prototype.interceptPromise = interceptPromise
146146
Shim.prototype.fixArity = arity.fixArity
147147
Shim.prototype.assignId = assignId
148+
Shim.prototype.specs = specs
148149

149150
// Internal methods.
150151
Shim.prototype.getExport = getExport

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
"lint": "eslint ./*.{js,mjs} lib test bin examples",
162162
"lint:fix": "eslint --fix, ./*.{js,mjs} lib test bin examples",
163163
"lint:lockfile": "lockfile-lint --path package-lock.json --type npm --allowed-hosts npm --validate-https --validate-integrity",
164-
"public-docs": "jsdoc -c ./jsdoc-conf.json --tutorials examples/shim api.js lib/shim/**/* lib/transaction/handle.js && cp examples/shim/*.png out/",
164+
"public-docs": "jsdoc -c ./jsdoc-conf.json --tutorials examples/shim api.js lib/shim/* lib/shim/specs/params/* lib/transaction/handle.js && cp examples/shim/*.png out/",
165165
"publish-docs": "./bin/publish-docs.sh",
166166
"services": "docker compose up -d --wait",
167167
"smoke": "npm run ssl && time tap test/smoke/**/**/*.tap.js --timeout=180 --no-coverage",

‎test/unit/shim/shim.test.js

+25
Original file line numberDiff line numberDiff line change
@@ -3105,4 +3105,29 @@ tap.test('Shim', function (t) {
31053105
})
31063106
t.end()
31073107
})
3108+
3109+
t.test('shim.specs', (t) => {
3110+
const agent = helper.loadMockedAgent()
3111+
t.teardown(() => {
3112+
helper.unloadAgent(agent)
3113+
})
3114+
3115+
const shim = new Shim(agent, 'test-mod')
3116+
t.ok(shim.specs, 'should assign specs to an instance of shim')
3117+
t.ok(shim.specs.ClassWrapSpec)
3118+
t.ok(shim.specs.MessageSpec)
3119+
t.ok(shim.specs.MessageSubscribeSpec)
3120+
t.ok(shim.specs.MiddlewareMounterSpec)
3121+
t.ok(shim.specs.MiddlewareSpec)
3122+
t.ok(shim.specs.OperationSpec)
3123+
t.ok(shim.specs.QuerySpec)
3124+
t.ok(shim.specs.RecorderSpec)
3125+
t.ok(shim.specs.RenderSpec)
3126+
t.ok(shim.specs.SegmentSpec)
3127+
t.ok(shim.specs.TransactionSpec)
3128+
t.ok(shim.specs.WrapSpec)
3129+
t.ok(shim.specs.params.DatastoreParameters)
3130+
t.ok(shim.specs.params.QueueMessageParameters)
3131+
t.end()
3132+
})
31083133
})

‎third_party_manifest.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"lastUpdated": "Wed Feb 21 2024 15:51:23 GMT-0600 (Central Standard Time)",
2+
"lastUpdated": "Thu Feb 22 2024 13:46:35 GMT-0500 (Eastern Standard Time)",
33
"projectName": "New Relic Node Agent",
44
"projectUrl": "https://github.com/newrelic/node-newrelic",
55
"includeOptDeps": true,
@@ -159,16 +159,16 @@
159159
"publisher": "Max Ogden",
160160
"email": "max@maxogden.com"
161161
},
162-
"https-proxy-agent@7.0.3": {
162+
"https-proxy-agent@7.0.2": {
163163
"name": "https-proxy-agent",
164-
"version": "7.0.3",
164+
"version": "7.0.2",
165165
"range": "^7.0.1",
166166
"licenses": "MIT",
167167
"repoUrl": "https://github.com/TooTallNate/proxy-agents",
168-
"versionedRepoUrl": "https://github.com/TooTallNate/proxy-agents/tree/v7.0.3",
169-
"licenseFile": "node_modules/https-proxy-agent/LICENSE",
170-
"licenseUrl": "https://github.com/TooTallNate/proxy-agents/blob/v7.0.3/LICENSE",
171-
"licenseTextSource": "file",
168+
"versionedRepoUrl": "https://github.com/TooTallNate/proxy-agents/tree/v7.0.2",
169+
"licenseFile": "node_modules/https-proxy-agent/README.md",
170+
"licenseUrl": "https://github.com/TooTallNate/proxy-agents/blob/v7.0.2/README.md",
171+
"licenseTextSource": "spdx",
172172
"publisher": "Nathan Rajlich",
173173
"email": "nathan@tootallnate.net",
174174
"url": "http://n8.io/"
@@ -570,15 +570,15 @@
570570
"publisher": "Andrey Okonetchnikov",
571571
"email": "andrey@okonet.ru"
572572
},
573-
"lockfile-lint@4.13.1": {
573+
"lockfile-lint@4.12.1": {
574574
"name": "lockfile-lint",
575-
"version": "4.13.1",
575+
"version": "4.12.1",
576576
"range": "^4.9.6",
577577
"licenses": "Apache-2.0",
578578
"repoUrl": "https://github.com/lirantal/lockfile-lint",
579-
"versionedRepoUrl": "https://github.com/lirantal/lockfile-lint/tree/v4.13.1",
579+
"versionedRepoUrl": "https://github.com/lirantal/lockfile-lint/tree/v4.12.1",
580580
"licenseFile": "node_modules/lockfile-lint/LICENSE",
581-
"licenseUrl": "https://github.com/lirantal/lockfile-lint/blob/v4.13.1/LICENSE",
581+
"licenseUrl": "https://github.com/lirantal/lockfile-lint/blob/v4.12.1/LICENSE",
582582
"licenseTextSource": "file",
583583
"publisher": "Liran Tal",
584584
"email": "liran.tal@gmail.com",

0 commit comments

Comments
 (0)
Please sign in to comment.