Merge pull request #9064 from bluesky-social/migrate-ogcard

Normalize ogcard path metrics
This commit is contained in:
Austin McKinley
2025-09-22 16:57:38 -07:00
committed by GitHub
+10 -1
View File
@@ -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 '<unmatched>'
},
})
app.use(metricsMiddleware)