mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-01 07:38:33 -04:00
Add custom prometheus metrics
This reuses the `realtime.getStatus` method to get the state of the application state on every prometheus scrape cycle. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
8914df60a9
commit
5c70cc021f
2 changed files with 51 additions and 0 deletions
2
app.js
2
app.js
|
@ -26,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()
|
||||
|
@ -66,6 +67,7 @@ app.use(morgan('combined', {
|
|||
|
||||
// Register prometheus metrics endpoint
|
||||
app.use(apiMetrics())
|
||||
metrics.setupCustomPrometheusMetrics()
|
||||
|
||||
// socket io
|
||||
const io = require('socket.io')(server, { cookie: false })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue