elysia-prometheus-metrics
v1.3.0
Published
ElysiaJS middleware exporting HTTP request duration metrics
Downloads
679
Maintainers
Readme
Elysia Prometheus metrics
An Elysia.js middleware to export Prometheus metrics. Is is intended as a replacement to the express prometheus bundle for Elysia, without relying on prom-client as Bun does not support the PerformanceObserver yet (As of november 2023). Currently, this middleware only provides the http_request_duration_seconds
histogram.
Installation
bun add elysia-prometheus-metrics
Usage
import { Elysia } from "elysia"
import metricsMiddleware from "elysia-prometheus-metrics"
const middlewareOptions = {}
new Elysia()
.use(metricsMiddleware(middlewareOptions))
.get("/", () => "Hello world")
.listen(8080)