mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-23 00:04:26 +01:00
Add Prometheus metrics
This commit is contained in:
10
src/middleware/metricsMiddleware.ts
Normal file
10
src/middleware/metricsMiddleware.ts
Normal 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();
|
||||
};
|
||||
Reference in New Issue
Block a user