Merge pull request #9064 from bluesky-social/migrate-ogcard
Normalize ogcard path metrics
This commit is contained in:
+10
-1
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user