@contrast/agentify 1.38.0 → 1.40.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/lib/index.js +12 -0
- package/lib/sources.test.js +2 -1
- package/package.json +14 -14
package/lib/index.js
CHANGED
|
@@ -62,6 +62,18 @@ const DEFAULT_INSTALL_ORDER = [
|
|
|
62
62
|
* @returns {import('.').Agentify}
|
|
63
63
|
*/
|
|
64
64
|
module.exports = function init(core = {}) {
|
|
65
|
+
// used for data that needs to be transferred to threads. originally added
|
|
66
|
+
// for the file descriptor so the main and esm thread logger instances can
|
|
67
|
+
// share the same FD. over time, other module-specific data that needs to
|
|
68
|
+
// be transferred can be added. the idea is that this data will be added
|
|
69
|
+
// automatically when the esm-loader thread is started (and possibly when
|
|
70
|
+
// other worker threads are started if we instrument them in the future).
|
|
71
|
+
//
|
|
72
|
+
// threadTransferData is added here because some integration tests don't
|
|
73
|
+
// instantiate the agent normally.
|
|
74
|
+
if (!core.threadTransferData) {
|
|
75
|
+
core.threadTransferData = Object.create(null);
|
|
76
|
+
}
|
|
65
77
|
core.startTime = process.hrtime.bigint();
|
|
66
78
|
if (!core.Perf) {
|
|
67
79
|
core.Perf = require('@contrast/perf');
|
package/lib/sources.test.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const EventEmitter = require('events');
|
|
4
4
|
const { expect } = require('chai');
|
|
5
|
+
const sinon = require('sinon');
|
|
5
6
|
const { initProtectFixture } = require('@contrast/test/fixtures');
|
|
6
7
|
|
|
7
8
|
describe('agentify sources', function () {
|
|
@@ -83,7 +84,7 @@ describe('agentify sources', function () {
|
|
|
83
84
|
};
|
|
84
85
|
resMock = new EventEmitter();
|
|
85
86
|
|
|
86
|
-
core.depHooks.resolve.withArgs({ name: 'http' }).yields(api);
|
|
87
|
+
core.depHooks.resolve.withArgs(sinon.match({ name: 'http' })).yields(api);
|
|
87
88
|
require('./sources')(core).install();
|
|
88
89
|
});
|
|
89
90
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/agentify",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.40.0",
|
|
4
4
|
"description": "Configures Contrast agent services and instrumentation within an application",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -17,21 +17,21 @@
|
|
|
17
17
|
"test": "../scripts/test.sh"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@contrast/common": "1.
|
|
21
|
-
"@contrast/config": "1.
|
|
22
|
-
"@contrast/core": "1.
|
|
23
|
-
"@contrast/deadzones": "1.
|
|
24
|
-
"@contrast/dep-hooks": "1.
|
|
25
|
-
"@contrast/esm-hooks": "2.
|
|
20
|
+
"@contrast/common": "1.28.0",
|
|
21
|
+
"@contrast/config": "1.38.0",
|
|
22
|
+
"@contrast/core": "1.43.0",
|
|
23
|
+
"@contrast/deadzones": "1.15.0",
|
|
24
|
+
"@contrast/dep-hooks": "1.12.0",
|
|
25
|
+
"@contrast/esm-hooks": "2.17.0",
|
|
26
26
|
"@contrast/find-package-json": "^1.1.0",
|
|
27
|
-
"@contrast/instrumentation": "1.
|
|
28
|
-
"@contrast/logger": "1.
|
|
29
|
-
"@contrast/metrics": "1.
|
|
30
|
-
"@contrast/patcher": "1.
|
|
27
|
+
"@contrast/instrumentation": "1.22.0",
|
|
28
|
+
"@contrast/logger": "1.16.0",
|
|
29
|
+
"@contrast/metrics": "1.20.0",
|
|
30
|
+
"@contrast/patcher": "1.15.0",
|
|
31
31
|
"@contrast/perf": "1.2.2",
|
|
32
|
-
"@contrast/reporter": "1.
|
|
33
|
-
"@contrast/rewriter": "1.
|
|
34
|
-
"@contrast/scopes": "1.
|
|
32
|
+
"@contrast/reporter": "1.39.0",
|
|
33
|
+
"@contrast/rewriter": "1.19.0",
|
|
34
|
+
"@contrast/scopes": "1.13.0",
|
|
35
35
|
"semver": "^7.6.0"
|
|
36
36
|
}
|
|
37
37
|
}
|