MCPcopy Index your code
hub / github.com/TomDoesTech/REST-API-Tutorial-Updated / startMetricsServer

Function startMetricsServer

src/utils/metrics.ts:19–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17});
18
19export 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}

Callers 1

app.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected