mirror of
https://github.com/minio/minio.git
synced 2024-12-23 21:55:53 -05:00
Export tier metrics via Prometheus (#13413)
e.g ``` minio_cluster_ilm_transitioned_bytes{server="minio3:9000",tier="S3TIER-1"} 1.36317772e+08 minio_cluster_ilm_transitioned_bytes{server="minio3:9000",tier="S3TIER-2"} 2892 minio_cluster_ilm_transitioned_bytes{server="minio3:9000",tier="STANDARD"} 1.3631488e+08 minio_cluster_ilm_transitioned_objects{server="minio3:9000",tier="S3TIER-1"} 1 minio_cluster_ilm_transitioned_objects{server="minio3:9000",tier="S3TIER-2"} 0 minio_cluster_ilm_transitioned_objects{server="minio3:9000",tier="STANDARD"} 1 minio_cluster_ilm_transitioned_versions{server="minio3:9000",tier="S3TIER-1"} 3 minio_cluster_ilm_transitioned_versions{server="minio3:9000",tier="S3TIER-2"} 2 minio_cluster_ilm_transitioned_versions{server="minio3:9000",tier="STANDARD"} 1 ```
This commit is contained in:
parent
9890f579f8
commit
0ee2933234
@ -48,6 +48,7 @@ func init() {
|
||||
getMinioHealingMetrics(),
|
||||
getNodeHealthMetrics(),
|
||||
getClusterStorageMetrics(),
|
||||
getClusterTierMetrics(),
|
||||
}
|
||||
|
||||
peerMetricsGroups = []*MetricsGroup{
|
||||
@ -181,6 +182,10 @@ const (
|
||||
expiryPendingTasks MetricName = "expiry_pending_tasks"
|
||||
transitionPendingTasks MetricName = "transition_pending_tasks"
|
||||
transitionActiveTasks MetricName = "transition_active_tasks"
|
||||
|
||||
transitionedBytes MetricName = "transitioned_bytes"
|
||||
transitionedObjects MetricName = "transitioned_objects"
|
||||
transitionedVersions MetricName = "transitioned_versions"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -1605,13 +1610,90 @@ func getBucketUsageMetrics() *MetricsGroup {
|
||||
HistogramBucketLabel: "range",
|
||||
VariableLabels: map[string]string{"bucket": bucket},
|
||||
})
|
||||
|
||||
}
|
||||
return
|
||||
})
|
||||
return mg
|
||||
}
|
||||
|
||||
func getClusterTransitionedBytesMD() MetricDescription {
|
||||
return MetricDescription{
|
||||
Namespace: clusterMetricNamespace,
|
||||
Subsystem: ilmSubsystem,
|
||||
Name: transitionedBytes,
|
||||
Help: "Total bytes transitioned to a tier",
|
||||
Type: gaugeMetric,
|
||||
}
|
||||
}
|
||||
|
||||
func getClusterTransitionedObjectsMD() MetricDescription {
|
||||
return MetricDescription{
|
||||
Namespace: clusterMetricNamespace,
|
||||
Subsystem: ilmSubsystem,
|
||||
Name: transitionedObjects,
|
||||
Help: "Total number of objects transitioned to a tier",
|
||||
Type: gaugeMetric,
|
||||
}
|
||||
}
|
||||
|
||||
func getClusterTransitionedVersionsMD() MetricDescription {
|
||||
return MetricDescription{
|
||||
Namespace: clusterMetricNamespace,
|
||||
Subsystem: ilmSubsystem,
|
||||
Name: transitionedVersions,
|
||||
Help: "Total number of versions transitioned to a tier",
|
||||
Type: gaugeMetric,
|
||||
}
|
||||
}
|
||||
|
||||
func getClusterTierMetrics() *MetricsGroup {
|
||||
mg := &MetricsGroup{
|
||||
cacheInterval: 10 * time.Second,
|
||||
}
|
||||
mg.RegisterRead(func(ctx context.Context) (metrics []Metric) {
|
||||
if globalTierConfigMgr.Empty() {
|
||||
return
|
||||
}
|
||||
objLayer := newObjectLayerFn()
|
||||
if objLayer == nil || globalIsGateway {
|
||||
return
|
||||
}
|
||||
|
||||
dui, err := loadDataUsageFromBackend(GlobalContext, objLayer)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
// data usage has not captured any data yet.
|
||||
if dui.LastUpdate.IsZero() {
|
||||
return
|
||||
}
|
||||
|
||||
// e.g minio_cluster_ilm_transitioned_bytes{tier="S3TIER-1"}=136314880
|
||||
// minio_cluster_ilm_transitioned_objects{tier="S3TIER-1"}=1
|
||||
// minio_cluster_ilm_transitioned_versions{tier="S3TIER-1"}=3
|
||||
for tier, st := range dui.TierStats.Tiers {
|
||||
metrics = append(metrics, Metric{
|
||||
Description: getClusterTransitionedBytesMD(),
|
||||
Value: float64(st.TotalSize),
|
||||
VariableLabels: map[string]string{"tier": tier},
|
||||
})
|
||||
metrics = append(metrics, Metric{
|
||||
Description: getClusterTransitionedObjectsMD(),
|
||||
Value: float64(st.NumObjects),
|
||||
VariableLabels: map[string]string{"tier": tier},
|
||||
})
|
||||
metrics = append(metrics, Metric{
|
||||
Description: getClusterTransitionedVersionsMD(),
|
||||
Value: float64(st.NumVersions),
|
||||
VariableLabels: map[string]string{"tier": tier},
|
||||
})
|
||||
}
|
||||
|
||||
return metrics
|
||||
})
|
||||
return mg
|
||||
}
|
||||
|
||||
func getLocalStorageMetrics() *MetricsGroup {
|
||||
mg := &MetricsGroup{
|
||||
cacheInterval: 10 * time.Second,
|
||||
|
@ -27,6 +27,9 @@ These metrics can be from any MinIO server once per collection.
|
||||
| `minio_cluster_capacity_usable_total_bytes` | Total usable capacity online in the cluster. |
|
||||
| `minio_cluster_nodes_offline_total` | Total number of MinIO nodes offline. |
|
||||
| `minio_cluster_nodes_online_total` | Total number of MinIO nodes online. |
|
||||
| `minio_cluster_ilm_transitioned_bytes` | Total bytes transitioned to a tier |
|
||||
| `minio_cluster_ilm_transitioned_objects` | Total number of objects transitioned to a tier |
|
||||
| `minio_cluster_ilm_transitioned_versions` | Total number of versions transitioned to a tier |
|
||||
| `minio_heal_objects_error_total` | Objects for which healing failed in current self healing run |
|
||||
| `minio_heal_objects_heal_total` | Objects healed in current self healing run |
|
||||
| `minio_heal_objects_total` | Objects scanned in current self healing run |
|
||||
|
Loading…
Reference in New Issue
Block a user