()
| 17 | }); |
| 18 | |
| 19 | export function startMetricsServer() { |
| 20 | const collectDefaultMetrics = client.collectDefaultMetrics; |
| 21 | |
| 22 | collectDefaultMetrics(); |
| 23 | |
| 24 | app.get("/metrics", async (req, res) => { |
| 25 | res.set("Content-Type", client.register.contentType); |
| 26 | |
| 27 | return res.send(await client.register.metrics()); |
| 28 | }); |
| 29 | |
| 30 | app.listen(9100, () => { |
| 31 | log.info("Metrics server started at http://localhost:9100"); |
| 32 | }); |
| 33 | } |