···38 promClient: {
39 collectDefaultMetrics: {},
40 },
41- // Don't expose /metrics on main app - we'll use separate server
42 autoregister: false,
00000000043 })
44 app.use(metricsMiddleware)
45
···38 promClient: {
39 collectDefaultMetrics: {},
40 },
41+42 autoregister: false,
43+ normalizePath: req => {
44+ // If we have a matched route, use its path (with :params) instead of the full URL path
45+ if (req.route) {
46+ return req.route.path
47+ }
48+49+ // Group all unmatched paths together to reduce cardinality
50+ return '<unmatched>'
51+ },
52 })
53 app.use(metricsMiddleware)
54