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

@@ -19,7 +19,6 @@ package cmd
import (
"net/http"
"strings"
"time"
"github.com/minio/minio/internal/auth"
@@ -156,9 +155,9 @@ func healingMetricsPrometheus(ch chan<- prometheus.Metric) {
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(healMetricsNamespace, "objects", "scanned"),
"Objects scanned in current self healing run",
"Objects scanned since uptime",
[]string{"type"}, nil),
prometheus.GaugeValue,
prometheus.CounterValue,
float64(v), string(k),
)
}
@@ -166,23 +165,20 @@ func healingMetricsPrometheus(ch chan<- prometheus.Metric) {
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(healMetricsNamespace, "objects", "healed"),
"Objects healed in current self healing run",
"Objects healed since uptime",
[]string{"type"}, nil),
prometheus.GaugeValue,
prometheus.CounterValue,
float64(v), string(k),
)
}
for k, v := range bgSeq.getHealFailedItemsMap() {
// healFailedItemsMap stores the endpoint and volume state separated by comma,
// split the fields and pass to channel at correct index
s := strings.Split(k, ",")
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(healMetricsNamespace, "objects", "heal_failed"),
"Objects for which healing failed in current self healing run",
[]string{"mount_path", "volume_status"}, nil),
prometheus.GaugeValue,
float64(v), s[0], s[1],
"Objects for which healing failed since uptime",
[]string{"type"}, nil),
prometheus.CounterValue,
float64(v), string(k),
)
}
}