Skip to content

fix(rpc): use ResettingTimer for RPC duration metrics#12

Closed
danbryan wants to merge 1 commit intorelease/1.16from
fix/rpc-metrics-resetting-timer
Closed

fix(rpc): use ResettingTimer for RPC duration metrics#12
danbryan wants to merge 1 commit intorelease/1.16from
fix/rpc-metrics-resetting-timer

Conversation

@danbryan
Copy link

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.

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.
@danbryan danbryan requested a review from vladjdk December 17, 2025 00:33
@danbryan danbryan closed this Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant