Skip to content

Commit

Permalink
Fix replication metrics on replication.go also
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemarey committed May 2, 2024
1 parent b9ef886 commit b6f60eb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agent/consul/replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ func (r *Replicator) Run(ctx context.Context) error {
// Perform a single round of replication
index, exit, err := r.delegate.Replicate(ctx, atomic.LoadUint64(&r.lastRemoteIndex), r.logger)
if exit {
metrics.SetGauge([]string{"leader", "replication", r.delegate.MetricName(), "status"},
0,
)
metrics.SetGauge([]string{"leader", "replication", r.delegate.MetricName(), "index"},
0,
)
return nil
}
if err != nil {
Expand Down

0 comments on commit b6f60eb

Please sign in to comment.