fix usage

This commit is contained in:
Austin McKinley
2025-09-29 17:15:01 -07:00
parent ad2eccef07
commit ab539776d0
+8 -3
View File
@@ -48,9 +48,14 @@ export class LinkService {
// Start metrics server
const metricsApp = express()
metricsApp.get('/metrics', (req, res) => {
res.set('Content-Type', this.ctx.metrics.register.contentType)
res.end(this.ctx.metrics.register.metrics())
metricsApp.get('/metrics', async (_req, res) => {
try {
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)