Skip to content

Commit 86c3f26

Browse files
Fix cortex_host_utilization_per_host_pct range 0-1 -> 0-100
1 parent 18e4b2a commit 86c3f26

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

internal/kpis/plugins/shared/host_utilization.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (k *HostUtilizationKPI) Collect(ch chan<- prometheus.Metric) {
6262
ch <- prometheus.MustNewConstMetric(
6363
k.hostResourceUsedPerHost,
6464
prometheus.GaugeValue,
65-
float64(hypervisor.VCPUsUsed)/float64(hypervisor.VCPUs),
65+
100*float64(hypervisor.VCPUsUsed)/float64(hypervisor.VCPUs),
6666
strconv.Itoa(hypervisor.ID),
6767
hypervisor.ServiceHost,
6868
hypervisor.Hostname,
@@ -73,7 +73,7 @@ func (k *HostUtilizationKPI) Collect(ch chan<- prometheus.Metric) {
7373
ch <- prometheus.MustNewConstMetric(
7474
k.hostResourceUsedPerHost,
7575
prometheus.GaugeValue,
76-
float64(hypervisor.MemoryMBUsed)/float64(hypervisor.MemoryMB),
76+
100*float64(hypervisor.MemoryMBUsed)/float64(hypervisor.MemoryMB),
7777
strconv.Itoa(hypervisor.ID),
7878
hypervisor.ServiceHost,
7979
hypervisor.Hostname,
@@ -84,7 +84,7 @@ func (k *HostUtilizationKPI) Collect(ch chan<- prometheus.Metric) {
8484
ch <- prometheus.MustNewConstMetric(
8585
k.hostResourceUsedPerHost,
8686
prometheus.GaugeValue,
87-
float64(hypervisor.LocalGBUsed)/float64(hypervisor.LocalGB),
87+
100*float64(hypervisor.LocalGBUsed)/float64(hypervisor.LocalGB),
8888
strconv.Itoa(hypervisor.ID),
8989
hypervisor.ServiceHost,
9090
hypervisor.Hostname,

plutono/provisioning/dashboards/cortex.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@
828828
"targets": [
829829
{
830830
"exemplar": false,
831-
"expr": "sort_desc(topk(5,cortex_host_utilization_per_host_pct{resource=\"cpu\"}))",
831+
"expr": "sort_desc(topk(10, cortex_host_utilization_per_host_pct{resource=\"cpu\"}))",
832832
"format": "time_series",
833833
"instant": true,
834834
"interval": "",
@@ -839,7 +839,7 @@
839839
],
840840
"timeFrom": null,
841841
"timeShift": null,
842-
"title": "Top 5 (Reserved, CPU %)",
842+
"title": "Top 10 (CPU %)",
843843
"type": "bargauge"
844844
},
845845
{
@@ -893,7 +893,7 @@
893893
"targets": [
894894
{
895895
"exemplar": false,
896-
"expr": "sort_desc(topk(5,cortex_host_utilization_per_host_pct{resource=\"memory\"}))",
896+
"expr": "sort_desc(topk(10,cortex_host_utilization_per_host_pct{resource=\"memory\"}))",
897897
"format": "time_series",
898898
"instant": true,
899899
"interval": "",
@@ -904,7 +904,7 @@
904904
],
905905
"timeFrom": null,
906906
"timeShift": null,
907-
"title": "Top 5 (Reserved, Memory %)",
907+
"title": "Top 10 (Reserved, Memory %)",
908908
"type": "bargauge"
909909
},
910910
{
@@ -958,7 +958,7 @@
958958
"targets": [
959959
{
960960
"exemplar": false,
961-
"expr": "sort_desc(topk(5,cortex_host_utilization_per_host_pct{resource=\"disk\"}))",
961+
"expr": "sort_desc(topk(10,cortex_host_utilization_per_host_pct{resource=\"disk\"}))",
962962
"format": "time_series",
963963
"instant": true,
964964
"interval": "",
@@ -969,7 +969,7 @@
969969
],
970970
"timeFrom": null,
971971
"timeShift": null,
972-
"title": "Top 5 (Reserved, Disk %)",
972+
"title": "Top 10 (Reserved, Disk %)",
973973
"type": "bargauge"
974974
},
975975
{

0 commit comments

Comments
 (0)