mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
Remove redundant prometheus data points (#5934)
Removed field minio_http_requests_total as it was redundant with minio_http_requests_duration_seconds_count Also removed field minio_server_start_time_seconds as it was redundant with process_start_time_seconds
This commit is contained in:
parent
9cab0f25e0
commit
e6ebcc4cb6
@ -190,8 +190,6 @@ func (st *HTTPStats) updateStats(r *http.Request, w *httpResponseRecorder, durat
|
|||||||
st.successDELETEs.Duration.Add(durationSecs)
|
st.successDELETEs.Duration.Add(durationSecs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Increment the prometheus http request count with appropriate label
|
|
||||||
httpRequests.With(prometheus.Labels{"request_type": r.Method}).Inc()
|
|
||||||
// Increment the prometheus http request response histogram with appropriate label
|
// Increment the prometheus http request response histogram with appropriate label
|
||||||
httpRequestsDuration.With(prometheus.Labels{"request_type": r.Method}).Observe(durationSecs)
|
httpRequestsDuration.With(prometheus.Labels{"request_type": r.Method}).Observe(durationSecs)
|
||||||
}
|
}
|
||||||
|
@ -26,13 +26,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
httpRequests = prometheus.NewCounterVec(
|
|
||||||
prometheus.CounterOpts{
|
|
||||||
Name: "minio_http_requests_total",
|
|
||||||
Help: "Total number of requests served by current Minio server instance",
|
|
||||||
},
|
|
||||||
[]string{"request_type"},
|
|
||||||
)
|
|
||||||
httpRequestsDuration = prometheus.NewHistogramVec(
|
httpRequestsDuration = prometheus.NewHistogramVec(
|
||||||
prometheus.HistogramOpts{
|
prometheus.HistogramOpts{
|
||||||
Name: "minio_http_requests_duration_seconds",
|
Name: "minio_http_requests_duration_seconds",
|
||||||
@ -44,7 +37,6 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
prometheus.MustRegister(httpRequests)
|
|
||||||
prometheus.MustRegister(httpRequestsDuration)
|
prometheus.MustRegister(httpRequestsDuration)
|
||||||
prometheus.MustRegister(newMinioCollector())
|
prometheus.MustRegister(newMinioCollector())
|
||||||
}
|
}
|
||||||
@ -107,6 +99,7 @@ func (c *minioCollector) Collect(ch chan<- prometheus.Metric) {
|
|||||||
prometheus.CounterValue,
|
prometheus.CounterValue,
|
||||||
float64(globalConnStats.getTotalInputBytes()),
|
float64(globalConnStats.getTotalInputBytes()),
|
||||||
)
|
)
|
||||||
|
|
||||||
// Total/Free Storage Bytes
|
// Total/Free Storage Bytes
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
prometheus.NewDesc(
|
prometheus.NewDesc(
|
||||||
@ -124,15 +117,6 @@ func (c *minioCollector) Collect(ch chan<- prometheus.Metric) {
|
|||||||
prometheus.GaugeValue,
|
prometheus.GaugeValue,
|
||||||
float64(s.Free),
|
float64(s.Free),
|
||||||
)
|
)
|
||||||
// Set Server Start Time
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
|
||||||
prometheus.NewDesc(
|
|
||||||
prometheus.BuildFQName("minio", "server", "start_time_seconds"),
|
|
||||||
"Time when current Minio server instance started",
|
|
||||||
nil, nil),
|
|
||||||
prometheus.GaugeValue,
|
|
||||||
float64(globalBootTime.Unix()),
|
|
||||||
)
|
|
||||||
|
|
||||||
// Minio Total Disk/Offline Disk
|
// Minio Total Disk/Offline Disk
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
@ -156,10 +140,7 @@ func (c *minioCollector) Collect(ch chan<- prometheus.Metric) {
|
|||||||
func metricsHandler() http.Handler {
|
func metricsHandler() http.Handler {
|
||||||
registry := prometheus.NewRegistry()
|
registry := prometheus.NewRegistry()
|
||||||
|
|
||||||
err := registry.Register(httpRequests)
|
err := registry.Register(httpRequestsDuration)
|
||||||
logger.LogIf(context.Background(), err)
|
|
||||||
|
|
||||||
err = registry.Register(httpRequestsDuration)
|
|
||||||
logger.LogIf(context.Background(), err)
|
logger.LogIf(context.Background(), err)
|
||||||
|
|
||||||
err = registry.Register(newMinioCollector())
|
err = registry.Register(newMinioCollector())
|
||||||
|
Loading…
Reference in New Issue
Block a user