mirror of
https://github.com/status-im/codimd.git
synced 2025-01-12 13:04:12 +00:00
ac31e51d67
Root cause: - prometheus metrics '/metrics/codimd' exported by 3ca0341 are still in 'routes need sessions' section. - prometheus scrapes metrics repeatedly. - new session created every time while prometheus scrapes metrics '/metrics/codimd'. Solution: - move /metrics/codimd from lib/routes.js to lib/metrics.js. - move /metrics/codimd from section 'routes need sessions' of app.js to 'routes without sessions'. Signed-off-by: tarlety <tarlety@gmail.com>
16 lines
355 B
JavaScript
16 lines
355 B
JavaScript
'use strict'
|
|
|
|
const { Router } = require('express')
|
|
|
|
const { wrap } = require('./utils')
|
|
|
|
// load controller
|
|
const statusController = require('./status')
|
|
const appRouter = Router()
|
|
|
|
// register route
|
|
appRouter.get('/status', wrap(statusController.getStatus))
|
|
appRouter.get('/metrics/codimd', wrap(statusController.getMetrics))
|
|
|
|
exports.router = appRouter
|