1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/lib/routes/backstage.js
ivaosthu b8014fdddf Server Metrics with Prometheus
Implementation use internal eventBus to enable loose counting in the app.

read more at https://prometheus.io/

Closes #98
2020-02-20 08:30:40 +01:00

13 lines
357 B
JavaScript

'use strict';
const prometheusRegister = require('prom-client/lib/register');
module.exports = function (app, config) {
if(config.serverMetrics) {
app.get('/internal-backstage/prometheus', (req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end(prometheusRegister.metrics());
});
}
};