Skip to content

Commit d9ea2e1

Browse files
committed
Address comments
1 parent c473cea commit d9ea2e1

File tree

1 file changed

+10
-14
lines changed
  • keps/sig-storage/1432-volume-health-monitor

1 file changed

+10
-14
lines changed

keps/sig-storage/1432-volume-health-monitor/README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -179,22 +179,18 @@ The newly added Volume Health stats will be stored in [persistentStats](https://
179179

180180
This is returned in [GetPodVolumeStats](https://github.com/kubernetes/kubernetes/blob/v1.22.1/pkg/kubelet/server/stats/fs_resource_analyzer.go#L99).
181181

182-
Add new metrics [here](https://github.com/kubernetes/kubernetes/blob/v1.22.1/pkg/kubelet/metrics/metrics.go#L50):
182+
Since Prometheus does not store string metrics, `volume_health_status` will be stored as either 1 or 0. The `volume_health_status` label could be `status: abnormal`.
183183

184184
```
185-
VolumeStatsHealthAbnormal = "volume_stats_health_abnormal"
186-
```
187-
188-
Update [CollectWithStability](https://github.com/kubernetes/kubernetes/blob/v1.22.1/pkg/kubelet/metrics/collectors/volume_stats.go#L117) to add a [NewLazyConstMetric](https://github.com/kubernetes/component-base/blob/v0.22.1/metrics/value.go#L33) with an [GaugeValue](https://github.com/kubernetes/component-base/blob/v0.22.1/metrics/value.go#L32).
189-
190-
Since Prometheus does not store string metrics, `VolumeStatsHealthAbnormal` will be stored as either 1 or 0.
191-
192-
PVC's namespace and name will be the label as in the following example:
193-
https://github.com/kubernetes/kubernetes/blob/v1.22.1/pkg/kubelet/metrics/collectors/volume_stats.go#L97
194-
195-
An example metric:
196-
```
197-
kubelet_volume_stats_health_abnormal{namespace="testns",persistentvolumeclaim="testpvc"} 1
185+
var volumeHealthMetric = metrics.NewGaugeVec(
186+
&metrics.GaugeOpts{
187+
Subsystem: KubeletSubsystem,
188+
Name: "volume_health_status",
189+
Help: "Volume health status. The count is either 1 or 0.",
190+
StabilityLevel: metrics.ALPHA,
191+
},
192+
[]string{"volume_plugin", "pvc_namespace", "pvc_name", "volume_health_status"},
193+
)
198194
```
199195

200196
### CSI changes

0 commit comments

Comments
 (0)