We have multiple clusters using the same OpenStack tenant, and as such they share volumes. Trying to use alerts such as CinderDiskWithoutPV then gives false-negatives, as it thinks reports disks created by PV/PVCs from another cluster as matching its alert query:
kos_cinder_volume_status{name=~"(pvc-.+|kubernetes-dynamic-pvc.+)",pv_name=""} == 1
Would adding volume properties help? Such as CSI Cinder's CLUSTER_NAME setting, added support for in:
We have multiple clusters using the same OpenStack tenant, and as such they share volumes. Trying to use alerts such as
CinderDiskWithoutPV
then gives false-negatives, as it thinks reports disks created by PV/PVCs from another cluster as matching its alert query:kos_cinder_volume_status{name=~"(pvc-.+|kubernetes-dynamic-pvc.+)",pv_name=""} == 1
Would adding volume properties help? Such as CSI Cinder's
CLUSTER_NAME
setting, added support for in:Here's an example of a volume with a "cluster" attribute set (by Cinder CSI):
And here's another example with more
properties
being set:I suspect this would be the place to add it? https://github.com/mercedes-benz/kosmoo/blob/72c46a7fe4a73939d0fbfddc3d2366497f44b872/pkg/metrics/cinder.go#L166
Would it be the
Metadata
property on the GopherCloud Volume result to add, perhaps? https://github.com/gophercloud/gophercloud/blob/19ba3dc8b6df9f0c12aec667e77b4cee634d4245/openstack/blockstorage/v2/volumes/results.go#L64-L65