summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/app.js b/app.js
index 51b5f093..31d671f9 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')
@@ -25,6 +26,7 @@ const logger = require('./lib/logger')
const errors = require('./lib/errors')
const models = require('./lib/models')
const csp = require('./lib/csp')
+const metrics = require('./lib/prometheus')
// server setup
const app = express()
@@ -63,6 +65,10 @@ app.use(morgan('combined', {
stream: logger.stream
}))
+// Register prometheus metrics endpoint
+app.use(apiMetrics())
+metrics.setupCustomPrometheusMetrics()
+
// socket io
const io = require('socket.io')(server, { cookie: false })
io.engine.ws = new (require('ws').Server)({