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)