deprecate unexpected healing failed counters (#19705)

simplify this to avoid verbose metrics, and make
room for valid metrics to be reported for alerting
etc.
This commit is contained in:
Harshavardhana
2024-05-09 11:04:41 -07:00
committed by GitHub
parent 7b7d2ea7d4
commit b534dc69ab
5 changed files with 76 additions and 80 deletions

View File

@@ -133,19 +133,20 @@ func (h *healRoutine) AddWorker(ctx context.Context, objAPI ObjectLayer, bgSeq *
}
}
if bgSeq != nil {
// We increment relevant counter based on the heal result for prometheus reporting.
if err != nil {
bgSeq.countFailed(res)
} else {
bgSeq.countHeals(res.Type, false)
}
}
if task.respCh != nil {
task.respCh <- healResult{result: res, err: err}
continue
}
// when respCh is not set caller is not waiting but we
// update the relevant metrics for them
if bgSeq != nil {
if err == nil {
bgSeq.countHealed(res.Type)
} else {
bgSeq.countFailed(res.Type)
}
}
case <-ctx.Done():
return
}