Use proper percentage for pool util

This commit is contained in:
Joshua Boniface 2023-12-27 10:03:00 -05:00
parent 88f4d79d5a
commit 431ee69620
1 changed files with 2 additions and 2 deletions

View File

@ -1629,11 +1629,11 @@ def get_resource_metrics(zkhandler):
output_lines.append("# TYPE pvc_ceph_pool_used_percent gauge")
for pool in pool_data:
try:
pool_used_percent = pool["stats"]["used_percent"]
pool_used_percent = pool["stats"]["used_percent"] * 100
except Exception:
continue
output_lines.append(
f"pvc_ceph_pool_used_percent{{pool=\"{pool['name']}\"}} {pool_used_percent}"
f"pvc_ceph_pool_used_percent{{pool=\"{pool['name']}\"}} {pool_used_percent:2.2f}"
)
output_lines.append("# HELP pvc_ceph_pool_num_objects PVC Pool total objects")