diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index 1046781296..4b953a1b07 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -73,7 +73,7 @@ func (e *endpoint) handlerWithMiddleware() http.HandlerFunc { handler.ServeHTTP(rw, r) if rw.statusCode >= 400 { - httpErrorCount.WithLabelValues(r.URL.Path, http.StatusText(rw.statusCode), r.Method).Inc() + httpErrorCount.WithLabelValues(e.name, http.StatusText(rw.statusCode), r.Method).Inc() } } } diff --git a/changelog/pvl-metrics-fix.md b/changelog/pvl-metrics-fix.md new file mode 100644 index 0000000000..3414c0bbc3 --- /dev/null +++ b/changelog/pvl-metrics-fix.md @@ -0,0 +1,3 @@ +### Fixed + +- http_error_count now matches the other cases by listing the endpoint name rather than the actual URL requested. This improves metrics cardinality.