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 authored and sarahalsmiller committed Aug 29, 2024
1 parent d6e0bff commit 74a6463
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 74a6463

Please sign in to comment.