diff --git a/src/metrics.ts b/src/metrics.ts index efe1a895..2d74bd45 100644 --- a/src/metrics.ts +++ b/src/metrics.ts @@ -3,13 +3,13 @@ import { Counter } from 'prom-client'; export const httpRequestCounter = new Counter({ name: 'http_requests_total', help: 'Total number of HTTP requests', - labelNames: ['method', 'path'], + labelNames: ['method'], }); export const fetchCounter = new Counter({ name: 'fetch_total', help: 'Total number of fetch requests', - labelNames: ['method', 'path'], + labelNames: ['method'], }); export const firehoseEventCounter = new Counter({ diff --git a/src/middleware/metricsMiddleware.ts b/src/middleware/metricsMiddleware.ts index 1e88ff3f..1a491186 100644 --- a/src/middleware/metricsMiddleware.ts +++ b/src/middleware/metricsMiddleware.ts @@ -3,8 +3,8 @@ 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 }); + const { method } = c.req; + httpRequestCounter.inc({ method }); await next(); }; diff --git a/src/workers/fetch.ts b/src/workers/fetch.ts index ad0c834e..3ed98fbb 100644 --- a/src/workers/fetch.ts +++ b/src/workers/fetch.ts @@ -25,7 +25,7 @@ const fetchWorker: typeof fetch = async (...args) => { await ready; const [url, init] = serializeFetchArgs(args); const { body, signal, ...rest } = init; - fetchCounter.inc({ method: init.method, path: new URL(url).pathname }); + fetchCounter.inc({ method: init.method }); const result = await client.fetch(url, { ...rest, body: await prepareBodyForWorker(body) }, signal); return new Response(...result); };