From 69fcd998f884a84b7b940a41f71f33a9c078b33d Mon Sep 17 00:00:00 2001 From: Stefan Thies Date: Thu, 22 Sep 2016 22:49:10 +0200 Subject: [PATCH] add check for pm2 env / master mode --- lib/httpServerAgent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/httpServerAgent.js b/lib/httpServerAgent.js index ce9382d..a1f3535 100644 --- a/lib/httpServerAgent.js +++ b/lib/httpServerAgent.js @@ -94,7 +94,7 @@ module.exports = function httpServerAgent () { timer.reset() reqSize = 0 resSize = 0 - if (cluster.isMaster) { + if (cluster.isMaster || process.env.NODE_APP_INSTANCE === 0 || process.env.SPM_MASTER_MODE === 1)) { agent.addMetrics({ ts: now, name: 'numWorkers',