mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
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:
@@ -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),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user