Skip to content

Commit

Permalink
Set replication metric to 0 when losing leadership
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemarey committed Apr 26, 2024
1 parent 2baf5e7 commit b9ef886
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agent/consul/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,12 @@ func (s *Server) runACLReplicator(

index, exit, err := replicateFunc(ctx, logger, lastRemoteIndex)
if exit {
metrics.SetGauge([]string{"leader", "replication", metricName, "status"},
0,
)
metrics.SetGauge([]string{"leader", "replication", metricName, "index"},
0,
)
return nil
}

Expand Down

0 comments on commit b9ef886

Please sign in to comment.