From 9d6f51ff88352fbd81c8e970774c9caad9d7a420 Mon Sep 17 00:00:00 2001 From: Austin McKinley Date: Mon, 22 Sep 2025 16:24:52 -0700 Subject: [PATCH] normalize ogcard metrics --- bskyogcard/src/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bskyogcard/src/index.ts b/bskyogcard/src/index.ts index a5d92526ee..110c3f50b7 100644 --- a/bskyogcard/src/index.ts +++ b/bskyogcard/src/index.ts @@ -38,8 +38,17 @@ export class CardService { promClient: { collectDefaultMetrics: {}, }, - // Don't expose /metrics on main app - we'll use separate server + autoregister: false, + normalizePath: req => { + // If we have a matched route, use its path (with :params) instead of the full URL path + if (req.route) { + return req.route.path + } + + // Group all unmatched paths together to reduce cardinality + return '' + }, }) app.use(metricsMiddleware)