Skip to content

prometheusHandler

prometheusHandler(registry): (req) => Response

Defined in: src/metrics/PrometheusExporter.ts:87

Build a (req: Request) => Response handler that returns the current registry state in Prometheus text format. Plug into your server:

Bun.serve({ port: 9090, fetch: prometheusHandler(system.metrics), });

MetricsRegistry

(req) => Response