mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 04:00:25 +03:00
Add cache usage, total capacity to prometheus metrics (#11026)
This commit is contained in:
committed by
GitHub
parent
934bed47fa
commit
f3beb1236a
@@ -280,6 +280,26 @@ func cacheMetricsPrometheus(ch chan<- prometheus.Metric) {
|
||||
float64(cdStats.UsageState),
|
||||
cdStats.Dir,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
prometheus.NewDesc(
|
||||
prometheus.BuildFQName("cache", "usage", "size"),
|
||||
"Indicates current cache usage in bytes",
|
||||
[]string{"disk"}, nil),
|
||||
prometheus.GaugeValue,
|
||||
float64(cdStats.UsageSize),
|
||||
cdStats.Dir,
|
||||
)
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
prometheus.NewDesc(
|
||||
prometheus.BuildFQName("cache", "total", "size"),
|
||||
"Indicates total size of cache disk",
|
||||
[]string{"disk"}, nil),
|
||||
prometheus.GaugeValue,
|
||||
float64(cdStats.TotalCapacity),
|
||||
cdStats.Dir,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user