mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
change the volume health status metrics name
This commit is contained in:
parent
5d544d3f01
commit
9808ae48a0
@ -63,9 +63,9 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
volumeStatsHealthAbnormalDesc = metrics.NewDesc(
|
volumeStatsHealthAbnormalDesc = metrics.NewDesc(
|
||||||
metrics.BuildFQName("", kubeletmetrics.KubeletSubsystem, kubeletmetrics.VolumeStatsHealthStatusKey),
|
metrics.BuildFQName("", kubeletmetrics.KubeletSubsystem, kubeletmetrics.VolumeStatsHealthStatusAbnormalKey),
|
||||||
"Abnormal volume health status. The count is either 1 or 0. When volume_health_status is abnormal, 1 indicates the volume is unhealthy, 0 indicates volume is healthy",
|
"Abnormal volume health status. The count is either 1 or 0. 1 indicates the volume is unhealthy, 0 indicates volume is healthy",
|
||||||
[]string{"namespace", "persistentvolumeclaim", "volume_health_status"}, nil,
|
[]string{"namespace", "persistentvolumeclaim"}, nil,
|
||||||
metrics.ALPHA, "")
|
metrics.ALPHA, "")
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ func (collector *volumeStatsCollector) CollectWithStability(ch chan<- metrics.Me
|
|||||||
addGauge(volumeStatsInodesDesc, pvcRef, float64(*volumeStat.Inodes))
|
addGauge(volumeStatsInodesDesc, pvcRef, float64(*volumeStat.Inodes))
|
||||||
addGauge(volumeStatsInodesFreeDesc, pvcRef, float64(*volumeStat.InodesFree))
|
addGauge(volumeStatsInodesFreeDesc, pvcRef, float64(*volumeStat.InodesFree))
|
||||||
addGauge(volumeStatsInodesUsedDesc, pvcRef, float64(*volumeStat.InodesUsed))
|
addGauge(volumeStatsInodesUsedDesc, pvcRef, float64(*volumeStat.InodesUsed))
|
||||||
addGauge(volumeStatsHealthAbnormalDesc, pvcRef, convertBoolToFloat64(volumeStat.VolumeHealthStats.Abnormal), "abnormal")
|
addGauge(volumeStatsHealthAbnormalDesc, pvcRef, convertBoolToFloat64(volumeStat.VolumeHealthStats.Abnormal))
|
||||||
allPVCs.Insert(pvcUniqStr)
|
allPVCs.Insert(pvcUniqStr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,8 +47,8 @@ func TestVolumeStatsCollector(t *testing.T) {
|
|||||||
# TYPE kubelet_volume_stats_inodes_used gauge
|
# TYPE kubelet_volume_stats_inodes_used gauge
|
||||||
# HELP kubelet_volume_stats_used_bytes [ALPHA] Number of used bytes in the volume
|
# HELP kubelet_volume_stats_used_bytes [ALPHA] Number of used bytes in the volume
|
||||||
# TYPE kubelet_volume_stats_used_bytes gauge
|
# TYPE kubelet_volume_stats_used_bytes gauge
|
||||||
# HELP kubelet_volume_stats_health_status [ALPHA] Abnormal volume health status. The count is either 1 or 0. When volume_health_status is abnormal, 1 indicates the volume is unhealthy, 0 indicates volume is healthy
|
# HELP kubelet_volume_stats_health_status_abnormal [ALPHA] Abnormal volume health status. The count is either 1 or 0. 1 indicates the volume is unhealthy, 0 indicates volume is healthy
|
||||||
# TYPE kubelet_volume_stats_health_status gauge
|
# TYPE kubelet_volume_stats_health_status_abnormal gauge
|
||||||
`
|
`
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -126,7 +126,7 @@ func TestVolumeStatsCollector(t *testing.T) {
|
|||||||
kubelet_volume_stats_inodes_free{namespace="testns",persistentvolumeclaim="testpvc"} 655344
|
kubelet_volume_stats_inodes_free{namespace="testns",persistentvolumeclaim="testpvc"} 655344
|
||||||
kubelet_volume_stats_inodes_used{namespace="testns",persistentvolumeclaim="testpvc"} 16
|
kubelet_volume_stats_inodes_used{namespace="testns",persistentvolumeclaim="testpvc"} 16
|
||||||
kubelet_volume_stats_used_bytes{namespace="testns",persistentvolumeclaim="testpvc"} 4.21789696e+09
|
kubelet_volume_stats_used_bytes{namespace="testns",persistentvolumeclaim="testpvc"} 4.21789696e+09
|
||||||
kubelet_volume_stats_health_status{namespace="testns",persistentvolumeclaim="testpvc",volume_health_status="abnormal"} 1
|
kubelet_volume_stats_health_status_abnormal{namespace="testns",persistentvolumeclaim="testpvc"} 1
|
||||||
`
|
`
|
||||||
|
|
||||||
metrics = []string{
|
metrics = []string{
|
||||||
@ -136,7 +136,7 @@ func TestVolumeStatsCollector(t *testing.T) {
|
|||||||
"kubelet_volume_stats_inodes_free",
|
"kubelet_volume_stats_inodes_free",
|
||||||
"kubelet_volume_stats_inodes_used",
|
"kubelet_volume_stats_inodes_used",
|
||||||
"kubelet_volume_stats_used_bytes",
|
"kubelet_volume_stats_used_bytes",
|
||||||
"kubelet_volume_stats_health_status",
|
"kubelet_volume_stats_health_status_abnormal",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -33,29 +33,29 @@ import (
|
|||||||
|
|
||||||
// This const block defines the metric names for the kubelet metrics.
|
// This const block defines the metric names for the kubelet metrics.
|
||||||
const (
|
const (
|
||||||
KubeletSubsystem = "kubelet"
|
KubeletSubsystem = "kubelet"
|
||||||
NodeNameKey = "node_name"
|
NodeNameKey = "node_name"
|
||||||
NodeLabelKey = "node"
|
NodeLabelKey = "node"
|
||||||
PodWorkerDurationKey = "pod_worker_duration_seconds"
|
PodWorkerDurationKey = "pod_worker_duration_seconds"
|
||||||
PodStartDurationKey = "pod_start_duration_seconds"
|
PodStartDurationKey = "pod_start_duration_seconds"
|
||||||
CgroupManagerOperationsKey = "cgroup_manager_duration_seconds"
|
CgroupManagerOperationsKey = "cgroup_manager_duration_seconds"
|
||||||
PodWorkerStartDurationKey = "pod_worker_start_duration_seconds"
|
PodWorkerStartDurationKey = "pod_worker_start_duration_seconds"
|
||||||
PLEGRelistDurationKey = "pleg_relist_duration_seconds"
|
PLEGRelistDurationKey = "pleg_relist_duration_seconds"
|
||||||
PLEGDiscardEventsKey = "pleg_discard_events"
|
PLEGDiscardEventsKey = "pleg_discard_events"
|
||||||
PLEGRelistIntervalKey = "pleg_relist_interval_seconds"
|
PLEGRelistIntervalKey = "pleg_relist_interval_seconds"
|
||||||
PLEGLastSeenKey = "pleg_last_seen_seconds"
|
PLEGLastSeenKey = "pleg_last_seen_seconds"
|
||||||
EvictionsKey = "evictions"
|
EvictionsKey = "evictions"
|
||||||
EvictionStatsAgeKey = "eviction_stats_age_seconds"
|
EvictionStatsAgeKey = "eviction_stats_age_seconds"
|
||||||
PreemptionsKey = "preemptions"
|
PreemptionsKey = "preemptions"
|
||||||
VolumeStatsCapacityBytesKey = "volume_stats_capacity_bytes"
|
VolumeStatsCapacityBytesKey = "volume_stats_capacity_bytes"
|
||||||
VolumeStatsAvailableBytesKey = "volume_stats_available_bytes"
|
VolumeStatsAvailableBytesKey = "volume_stats_available_bytes"
|
||||||
VolumeStatsUsedBytesKey = "volume_stats_used_bytes"
|
VolumeStatsUsedBytesKey = "volume_stats_used_bytes"
|
||||||
VolumeStatsInodesKey = "volume_stats_inodes"
|
VolumeStatsInodesKey = "volume_stats_inodes"
|
||||||
VolumeStatsInodesFreeKey = "volume_stats_inodes_free"
|
VolumeStatsInodesFreeKey = "volume_stats_inodes_free"
|
||||||
VolumeStatsInodesUsedKey = "volume_stats_inodes_used"
|
VolumeStatsInodesUsedKey = "volume_stats_inodes_used"
|
||||||
VolumeStatsHealthStatusKey = "volume_stats_health_status"
|
VolumeStatsHealthStatusAbnormalKey = "volume_stats_health_status_abnormal"
|
||||||
RunningPodsKey = "running_pods"
|
RunningPodsKey = "running_pods"
|
||||||
RunningContainersKey = "running_containers"
|
RunningContainersKey = "running_containers"
|
||||||
// Metrics keys of remote runtime operations
|
// Metrics keys of remote runtime operations
|
||||||
RuntimeOperationsKey = "runtime_operations_total"
|
RuntimeOperationsKey = "runtime_operations_total"
|
||||||
RuntimeOperationsDurationKey = "runtime_operations_duration_seconds"
|
RuntimeOperationsDurationKey = "runtime_operations_duration_seconds"
|
||||||
|
Loading…
Reference in New Issue
Block a user