···3838 promClient: {
3939 collectDefaultMetrics: {},
4040 },
4141- // Don't expose /metrics on main app - we'll use separate server
4141+4242 autoregister: false,
4343+ normalizePath: req => {
4444+ // If we have a matched route, use its path (with :params) instead of the full URL path
4545+ if (req.route) {
4646+ return req.route.path
4747+ }
4848+4949+ // Group all unmatched paths together to reduce cardinality
5050+ return '<unmatched>'
5151+ },
4352 })
4453 app.use(metricsMiddleware)
4554