limitVolumeSize prometheus metric
Describe the solution you'd like We need trident_backend_limit_volume_size_bytes metric to control trident backend utilization and over provisioning. Is it possible?
Describe alternatives you've considered It is no alternatives.
Hello @ArtemKaba
Can you explain how you want this metric to work?
@ArtemKaba bumping this up
@balaramesh Hi! Thank you for quick reply.
We usually limit trident backend (ontap-nas-economy driver) in each k8s cluster by limitVolumeSize parameter. So we can control how many storage space our customers can consume and resize on-demand. But we need to ability to monitor this quota for each backend and compare with already used (or allocated) resources.
@ArtemKaba limitVolumeSize is used to set the maximum size of a volume that can be created by Trident for a given backend. It sounds like you are looking to observe the amount of space consumed per backend. Is that what you are looking for?
If so, you can obtain that using trident_volume_allocated_bytes. This returns the amount of allocated storage per backend. An example Promethueus query would be:
trident_volume_allocated_bytes{backend_uuid="586b1cd5-8cf8-428d-a76c-2872713612c1"}
@ArtemKaba does this meet your requirement?
@balaramesh Hi,
thanks for your reply. let's imagine we have one trident backend and one storageclass using trident provisioner per k8s cluster. Backend limited by limitVolumeSize parameter. So we can calculate NetApp storage usage for this k8s cluster by
avg by(persistentvolumeclaim, namespace)(kubelet_volume_stats_used_bytes) *
on (persistentvolumeclaim, namespace) group_left
avg by(persistentvolumeclaim, namespace)(kube_persistentvolumeclaim_info{storageclass="netapp-nfs"})
But it is difficult to say there is a lot or a little free space left for a given backend. For this purpose we need to have limitVolumeSize as a prometheus metric. In that case we could calculate the percentage of backend usage:
sum(avg by(persistentvolumeclaim, namespace)(kubelet_volume_stats_used_bytes) *
on (persistentvolumeclaim, namespace) group_left
avg by(persistentvolumeclaim, namespace)(kube_persistentvolumeclaim_info{storageclass="netapp-nfs"})) /
trident_backend_limit_volume_size_bytes