Skip to content

Commit 3a1731c

Browse files
CLDSRV-717: Cluster primary doesn't collectMetrics
It only aggregates metrics from workers
1 parent 8581fd0 commit 3a1731c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ function main() {
379379
process.env.REPORT_TOKEN = _config.reportToken;
380380
const server = new S3Server(_config);
381381
server.initiateStartup(logger.newRequestLogger());
382+
monitoringClient.collectDefaultMetrics({ timeout: 5000 });
382383
}
383384
if (this.cluster && cluster.isPrimary) {
384385
for (let n = 0; n < workers; n++) {
@@ -429,8 +430,8 @@ function main() {
429430
if (this.cluster && cluster.isWorker) {
430431
const server = new S3Server(_config, cluster.worker);
431432
server.initiateStartup(logger.newRequestLogger());
433+
monitoringClient.collectDefaultMetrics({ timeout: 5000 });
432434
}
433-
monitoringClient.collectDefaultMetrics({ timeout: 5000 });
434435
}
435436

436437
module.exports = main;

0 commit comments

Comments
 (0)