fix usage
This commit is contained in:
@@ -48,9 +48,14 @@ export class LinkService {
|
|||||||
|
|
||||||
// Start metrics server
|
// Start metrics server
|
||||||
const metricsApp = express()
|
const metricsApp = express()
|
||||||
metricsApp.get('/metrics', (req, res) => {
|
metricsApp.get('/metrics', async (_req, res) => {
|
||||||
res.set('Content-Type', this.ctx.metrics.register.contentType)
|
try {
|
||||||
res.end(this.ctx.metrics.register.metrics())
|
const metrics = await this.ctx.metrics.getRegistry().metrics()
|
||||||
|
res.set('Content-Type', this.ctx.metrics.getRegistry().contentType)
|
||||||
|
res.end(metrics)
|
||||||
|
} catch (error) {
|
||||||
|
res.status(500).end('Error collecting metrics')
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.metricsServer = metricsApp.listen(this.ctx.cfg.service.metricsPort)
|
this.metricsServer = metricsApp.listen(this.ctx.cfg.service.metricsPort)
|
||||||
|
|||||||
Reference in New Issue
Block a user