Add Prometheus metrics

This commit is contained in:
Alex Gleason
2024-06-21 22:38:25 -05:00
parent 766290bd45
commit 31a5533fd7
10 changed files with 105 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
import { MiddlewareHandler } from '@hono/hono';
import { httpRequestCounter } from '@/metrics.ts';
export const metricsMiddleware: MiddlewareHandler = async (c, next) => {
const { method, path } = c.req;
httpRequestCounter.inc({ method, path });
await next();
};