mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
Use +Inf label additionally for Histogram metrics (#18807)
This commit is contained in:
@@ -20,6 +20,7 @@ package cmd
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math"
|
||||
"net/http"
|
||||
"runtime"
|
||||
"strconv"
|
||||
@@ -1715,6 +1716,17 @@ func getHistogramMetrics(hist *prometheus.HistogramVec, desc MetricDescription)
|
||||
}
|
||||
metrics = append(metrics, metric)
|
||||
}
|
||||
// add metrics with +Inf label
|
||||
labels1 := make(map[string]string)
|
||||
for _, lp := range dtoMetric.GetLabel() {
|
||||
labels1[*lp.Name] = *lp.Value
|
||||
}
|
||||
labels1["le"] = fmt.Sprintf("%.3f", math.Inf(+1))
|
||||
metrics = append(metrics, Metric{
|
||||
Description: desc,
|
||||
VariableLabels: labels1,
|
||||
Value: dtoMetric.Counter.GetValue(),
|
||||
})
|
||||
}
|
||||
return metrics
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user