How to use the prom-client.register.metrics function in prom-client

To help you get started, we’ve selected a few prom-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AugustArchive / Maika / src / structures / registry / metrics.js View on Github external
.createServer((req, res) => {
                console.log(`[Metrics] [info]: ${req.url} was requested.`);
                if (url.parse(req.url) === '/metrics') {
                    res.writeHead(200, { 'Content-Type': register.contentType });
                    res.write(register.metrics());
                    res.end();
                }
            }).listen(5590);
    }
github calzoneman / sync / src / prometheus-server.js View on Github external
server = http.createServer((req, res) => {
        if (req.method !== 'GET'
                || parseURL(req.url).pathname !== prometheusConfig.getPath()) {
            res.writeHead(400, { 'Content-Type': 'text/plain' });
            res.end('Bad Request');
            return;
        }

        res.writeHead(200, {
            'Content-Type': register.contentType
        });
        res.end(register.metrics());
    });
github coralproject / talk / src / core / server / app / router / index.ts View on Github external
router.get("/metrics", noCacheMiddleware, (req, res) => {
      res.set("Content-Type", register.contentType);
      res.end(register.metrics());
    });
    logger.info({ path: "/metrics" }, "mounting metrics path on app");
github ClearcodeHQ / nodejs-microservice-boilerplate / src / modules / healthcheck.js View on Github external
server.get('/metrics', (req, res) => {
  res.status(200);
  res.set('Content-Type', register.contentType);
  res.end(register.metrics());
});
github AraiEzzra / DDKCORE / backlog / prometheus.js View on Github external
App.get('/metrics', (req, res) => {
        res.set('Content-Type', Register.contentType);
        res.end(Register.metrics());
    });
};
github Unleash / unleash / lib / routes / backstage.js View on Github external
this.get('/prometheus', (req, res) => {
                res.set('Content-Type', prometheusRegister.contentType);
                res.end(prometheusRegister.metrics());
            });
        }