From 8914df60a93c93f48fc7306b5b4edf347474894a Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 18 Apr 2021 12:31:28 +0200 Subject: Add prometheus endpoint at /metrics This is currently just using the default metrics of prometheus-api-metrics. Signed-off-by: David Mehren --- app.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app.js') diff --git a/app.js b/app.js index 51b5f093..28b675db 100644 --- a/app.js +++ b/app.js @@ -18,6 +18,7 @@ const passportSocketIo = require('passport.socketio') const helmet = require('helmet') const i18n = require('i18n') const flash = require('connect-flash') +const apiMetrics = require('prometheus-api-metrics') // core const config = require('./lib/config') @@ -63,6 +64,9 @@ app.use(morgan('combined', { stream: logger.stream })) +// Register prometheus metrics endpoint +app.use(apiMetrics()) + // socket io const io = require('socket.io')(server, { cookie: false }) io.engine.ws = new (require('ws').Server)({ -- cgit v1.2.3