@contrast/config 1.18.0 → 1.19.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/config.js +2 -1
- package/lib/options.js +40 -1
- package/package.json +2 -2
package/lib/config.js
CHANGED
|
@@ -38,6 +38,7 @@ const OS_CONFIG_DIR = os.platform() === 'win32'
|
|
|
38
38
|
? path.resolve(process.env.ProgramData || '', 'contrast')
|
|
39
39
|
: '/etc/contrast';
|
|
40
40
|
const REDACTED_KEYS = ['api.api_key', 'api.service_key'];
|
|
41
|
+
const OVERRIDABLE_SOURCES = [DEFAULT_VALUE, CONTRAST_UI];
|
|
41
42
|
|
|
42
43
|
module.exports = class Config {
|
|
43
44
|
constructor(core) {
|
|
@@ -72,7 +73,7 @@ module.exports = class Config {
|
|
|
72
73
|
if (!this._status) this._status = 'Success';
|
|
73
74
|
|
|
74
75
|
for (const [name, mapper] of Object.entries(mappings)) {
|
|
75
|
-
if (this.getEffectiveSource(name)
|
|
76
|
+
if (OVERRIDABLE_SOURCES.includes(this.getEffectiveSource(name))) {
|
|
76
77
|
const remoteValue = mapper(msg);
|
|
77
78
|
if (remoteValue != null) {
|
|
78
79
|
this._effectiveMap.set(name, {
|
package/lib/options.js
CHANGED
|
@@ -214,6 +214,39 @@ const options = [
|
|
|
214
214
|
fn: castBoolean,
|
|
215
215
|
desc: 'Defaults to `true`. Controls whether configuration setting reports are sent to the Contrast web interface.',
|
|
216
216
|
},
|
|
217
|
+
// agent.heap_dump
|
|
218
|
+
{
|
|
219
|
+
name: 'agent.heap_dump.enable',
|
|
220
|
+
arg: '[true]',
|
|
221
|
+
fn: castBoolean,
|
|
222
|
+
default: false,
|
|
223
|
+
desc: 'Set to \'true\' for the agent to automatically take heap dumps of the instrumented application.',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: 'agent.heap_dump.path',
|
|
227
|
+
arg: '<path>',
|
|
228
|
+
default: 'contrast_heap_dumps',
|
|
229
|
+
desc: "Set the location to which to save the heap dump files. If relative, the path is determined based on the process' working directory.",
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: 'agent.heap_dump.delay_ms',
|
|
233
|
+
arg: '<time>',
|
|
234
|
+
default: 10000,
|
|
235
|
+
desc: 'Set the amount of time to wait, in milliseconds, after agent startup to begin taking heap dumps.',
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: 'agent.heap_dump.window_ms',
|
|
239
|
+
arg: '<number>',
|
|
240
|
+
default: 10000,
|
|
241
|
+
desc: 'Set the amount of time to wait, in milliseconds, between each heap dump.',
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'agent.heap_dump.count',
|
|
245
|
+
arg: '<number>',
|
|
246
|
+
default: 5,
|
|
247
|
+
desc: 'Set the number of heap dumps to take before disabling this feature.',
|
|
248
|
+
},
|
|
249
|
+
|
|
217
250
|
// agent.polling
|
|
218
251
|
{
|
|
219
252
|
name: 'agent.polling.app_activity_ms',
|
|
@@ -527,7 +560,13 @@ Example - \`label1, label2, label3\``,
|
|
|
527
560
|
name: 'server.name',
|
|
528
561
|
arg: '<name>',
|
|
529
562
|
default: os.hostname(),
|
|
530
|
-
desc: 'Override the reported server name.
|
|
563
|
+
desc: 'Override the reported server name. Defaults to the operating system hostname.',
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
name: 'server.type',
|
|
567
|
+
arg: '<type>',
|
|
568
|
+
default: `Node.js ${process.version}`,
|
|
569
|
+
desc: 'Override the reported server type.',
|
|
531
570
|
},
|
|
532
571
|
{
|
|
533
572
|
name: 'server.environment',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "An API for discovering Contrast agent configuration data",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"test": "../scripts/test.sh"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@contrast/common": "1.15.
|
|
20
|
+
"@contrast/common": "1.15.1",
|
|
21
21
|
"yaml": "^2.2.2"
|
|
22
22
|
}
|
|
23
23
|
}
|