Skip to content

Commit

Permalink
fix(metrics): validator missed blocks, inc -> set
Browse files Browse the repository at this point in the history
We were inappropriately `increment`ing a gauge to track missed blocks,
when instead we should have been clobbering the value via `set`,
as we know the precise number from the state machine. This fixes
a broken metric for missed blocks that was growing too fast,
emitting wrong values.

Refs #3746.
  • Loading branch information
conorsch committed May 6, 2024
1 parent 3b33c2d commit 6ee9cb4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ pub trait ValidatorUptimeTracker: StateWrite {
"recorded vote info"
);
metrics::gauge!(metrics::MISSED_BLOCKS, "identity_key" => identity_key.to_string())
.increment(uptime.num_missed_blocks() as f64);
.set(uptime.num_missed_blocks() as f64);

uptime.mark_height_as_signed(height, voted)?;
if uptime.num_missed_blocks() as u64 >= params.missed_blocks_maximum {
Expand Down

0 comments on commit 6ee9cb4

Please sign in to comment.