From 426e4d455653c64a361ce8ed70c71a58cff1e5f4 Mon Sep 17 00:00:00 2001 From: Diego Ximenes Date: Tue, 26 Oct 2021 01:47:19 -0300 Subject: [PATCH] Fix cluster example --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 84639e6..6259aee 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,8 @@ which returns an aggregate of all metrics from all the workers. ``` javascript const cluster = require('cluster'); -const promBundle = require('./src/index'); +const promBundle = require('express-prom-bundle'); +const promClient = require('prom-client'); const numCPUs = Math.max(2, require('os').cpus().length); const express = require('express'); @@ -215,6 +216,7 @@ if (cluster.isMaster) { console.log('cluster metrics listening on 9999'); console.log('call localhost:9999/metrics for aggregated metrics'); } else { + new promClient.AggregatorRegistry(); const app = express(); app.use(promBundle({ autoregister: false, // disable /metrics for single workers