An ATproto social media client -- with an independent Appview.

normalize ogcard metrics

+10 -1
+10 -1
bskyogcard/src/index.ts
··· 38 38 promClient: { 39 39 collectDefaultMetrics: {}, 40 40 }, 41 - // Don't expose /metrics on main app - we'll use separate server 41 + 42 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 + }, 43 52 }) 44 53 app.use(metricsMiddleware) 45 54