Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Commit b6d0b29

Browse files
JensEratchrischdi
andcommitted
add further missing cinder disk states (#10)
* add further missing states Complete list of available Cinder states from upstream API code. Also simplified `CinderDiskStuck` alert to match all disks stuck in transitional states (all but available and in-use) instead of explicitly listing them. * error-state have underscores, not hyphens Co-Authored-By: Christian Schlotter <[email protected]>
1 parent b9015d9 commit b6d0b29

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/alerts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This alerts assume that the parameter `metrics-prefix` was not changed and still
77

88
```
99
- alert: CinderDiskStuck
10-
expr: kos_cinder_volume_status{status=~".*ing"} == 1
10+
expr: kos_cinder_volume_status{status!~"available|in-use"} == 1
1111
for: 30m
1212
labels:
1313
severity: critical

pkg/metrics/cinder.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ var (
2020
// labels which get applied to the most metrics
2121
defaultLabels = []string{"id", "description", "name", "status", "cinder_availability_zone", "volume_type", "pvc_name", "pvc_namespace", "pv_name", "pv_storage_class", "pv_reclaim_policy", "pv_fs_type"}
2222

23-
// possible cinder states
24-
cinderStates = []string{"available", "error", "creating", "deleting", "in-use", "attaching", "detaching", "error_deleting", "maintenance", "reserved"}
23+
// possible cinder states, from https://github.com/openstack/cinder/blob/master/cinder/objects/fields.py#L168
24+
cinderStates = []string{"creating", "available", "deleting", "error", "error_deleting", "error_managing", "managing", "attaching", "in-use", "detaching", "maintenance", "restoring-backup", "error_restoring", "reserved", "awaiting-transfer", "backing-up", "error_backing-up", "error_extending", "downloading", "uploading", "retyping", "extending"}
2525

2626
cinderQuotaVolumes *prometheus.GaugeVec
2727
cinderQuotaVolumesGigabyte *prometheus.GaugeVec

0 commit comments

Comments
 (0)