diff --git a/bin/pm2 b/bin/pm2 index feca91ee9..124a47aac 100755 --- a/bin/pm2 +++ b/bin/pm2 @@ -87,6 +87,7 @@ commander.version(pkg.version) .option('--sort ', 'sort process according to field\'s name') .option('--v8', 'enable v8 data collecting') .option('--event-loop-inspector', 'enable event-loop-inspector dump in pmx') + .option('--deep-monitoring', 'enable all monitoring tools (equivalent to --v8 --event-loop-inspector --trace') .usage('[cmd] app'); commander.on('--help', function() { diff --git a/lib/API/schema.json b/lib/API/schema.json index 97274d7af..a74b138e3 100644 --- a/lib/API/schema.json +++ b/lib/API/schema.json @@ -202,6 +202,11 @@ "boolean" ] }, + "deep_monitoring": { + "type": [ + "boolean" + ] + }, "increment_var": { "type": "string" }, diff --git a/lib/ProcessContainer.js b/lib/ProcessContainer.js index 81c1fb508..db9540dd6 100644 --- a/lib/ProcessContainer.js +++ b/lib/ProcessContainer.js @@ -32,10 +32,11 @@ delete process.env.pm2_env; if (process.env.pmx !== 'false') { require('pmx').init({ - transactions: (process.env.km_link === 'true' && process.env.trace === 'true') || false, + transactions: (process.env.km_link === 'true' && (process.env.trace === 'true' || process.env.deep_monitoring === 'true')) || false, http: process.env.km_link === 'true' || false, - v8: process.env.v8 === 'true' || false, - event_loop_dump: process.env['event_loop_inspector'] === 'true' || false + v8: process.env.v8 === 'true' || process.env.deep_monitoring === 'true' || false, + event_loop_dump: process.env.event_loop_inspector === 'true' || process.env.deep_monitoring === 'true' || false, + deep_metrics: process.env.deep_monitoring === 'true' || false }); } diff --git a/lib/ProcessContainerFork.js b/lib/ProcessContainerFork.js index fd992498f..6d1b0cebb 100644 --- a/lib/ProcessContainerFork.js +++ b/lib/ProcessContainerFork.js @@ -6,10 +6,11 @@ // Inject custom modules if (process.env.pmx !== 'false') { require('pmx').init({ - transactions: (process.env.km_link === 'true' && process.env.trace === 'true') || false, + transactions: (process.env.km_link === 'true' && (process.env.trace === 'true' || process.env.deep_monitoring === 'true')) || false, http: process.env.km_link === 'true' || false, - v8: process.env.v8 === 'true' || false, - event_loop_dump: process.env['event_loop_inspector'] === 'true' || false + v8: process.env.v8 === 'true' || process.env.deep_monitoring === 'true' || false, + event_loop_dump: process.env.event_loop_inspector === 'true' || process.env.deep_monitoring === 'true' || false, + deep_metrics: process.env.deep_monitoring === 'true' || false }); }