mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
fix(rpc): use ResettingTimer for RPC duration metrics
The rpc/duration/all metric was using metrics.NewRegisteredTimer which accumulates samples over the entire process lifetime. When exported to Prometheus, quantile values grow to millions of seconds (displayed as years). Switch to NewRegisteredResettingTimer which resets its sample buffer on each Prometheus scrape, ensuring quantile calculations use recent data only.
This commit is contained in:
parent
9a3ffad54d
commit
bbad7fc0f3
1 changed files with 1 additions and 1 deletions
|
|
@ -31,7 +31,7 @@ var (
|
|||
// serveTimeHistName is the prefix of the per-request serving time histograms.
|
||||
serveTimeHistName = "rpc/duration"
|
||||
|
||||
rpcServingTimer = metrics.NewRegisteredTimer("rpc/duration/all", nil)
|
||||
rpcServingTimer = metrics.NewRegisteredResettingTimer("rpc/duration/all", nil)
|
||||
)
|
||||
|
||||
// updateServeTimeHistogram tracks the serving time of a remote RPC call.
|
||||
|
|
|
|||
Loading…
Reference in a new issue