Skip to content

Commit 6104e1e

Browse files
authored
Merge pull request #37657 from sjhala-ccs/BZ1986542
BZ1986542: Updated example prometheus queries
2 parents 23af3d8 + 777f07e commit 6104e1e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

modules/virt-querying-metrics.adoc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ To query the vCPU metric, the `schedstats=enable` kernel argument must first be
3030
.Example vCPU wait time query
3131
[source,promql]
3232
----
33-
topk(3, sum by (name, namespace) (round(irate(kubevirt_vmi_vcpu_wait_seconds[6m]), 0.1))) > 0 <1>
33+
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_vcpu_wait_seconds[6m]))) > 0 <1>
3434
----
3535
<1> This query returns the top 3 VMs waiting for I/O at every given moment over a six-minute time period.
3636

@@ -48,7 +48,7 @@ Returns the total amount of traffic transmitted (in bytes) on the virtual machin
4848
.Example network traffic query
4949
[source,promql]
5050
----
51-
topk(3, sum by (name, namespace) (round(irate(kubevirt_vmi_network_receive_bytes_total[6m]), 0.1)) + sum by (name, namespace) (round(irate(kubevirt_vmi_network_transmit_bytes_total[6m]) , 0.1))) > 0 <1>
51+
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_network_receive_bytes_total[6m])) + sum by (name, namespace) (rate(kubevirt_vmi_network_transmit_bytes_total[6m]))) > 0 <1>
5252
----
5353
<1> This query returns the top 3 VMs transmitting the most network traffic at every given moment over a six-minute time period.
5454

@@ -69,8 +69,7 @@ Returns the total amount of storage writes (in bytes) of the virtual machine's s
6969
.Example storage-related traffic query
7070
[source,promql]
7171
----
72-
topk(3, sum by (name, namespace) (round(irate(kubevirt_vmi_storage_read_traffic_bytes_total[6m]), 0.1))
73-
+ sum by (name, namespace) (round(irate(kubevirt_vmi_storage_write_traffic_bytes_total[6m]), 0.1))) > 0 <1>
72+
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_storage_read_traffic_bytes_total[6m])) + sum by (name, namespace) (rate(kubevirt_vmi_storage_write_traffic_bytes_total[6m]))) > 0 <1>
7473
----
7574
<1> This query returns the top 3 VMs performing the most storage traffic at every given moment over a six-minute time period.
7675

@@ -88,8 +87,7 @@ Returns the amount of read I/O operations the virtual machine is performing per
8887
.Example I/O performance query
8988
[source,promql]
9089
----
91-
topk(3, sum by (name, namespace) (round(irate(kubevirt_vmi_storage_iops_read_total[6m]), 0.1))
92-
+ sum by (name, namespace) (round(irate(kubevirt_vmi_storage_iops_write_total[6m]) , 0.1))) > 0 <1>
90+
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_storage_iops_read_total[6m])) + sum by (name, namespace) (rate(kubevirt_vmi_storage_iops_write_total[6m]))) > 0 <1>
9391
----
9492
<1> This query returns the top 3 VMs performing the most I/O operations per second at every given moment over a six-minute time period.
9593

@@ -107,8 +105,7 @@ Returns the total amount (in bytes) of memory the virtual guest is swapping out.
107105
.Example memory swapping query
108106
[source,promql]
109107
----
110-
topk(3, sum by (name, namespace) (round(irate(kubevirt_vmi_memory_swap_in_traffic_bytes_total[6m]), 0.1))
111-
+ sum by (name, namespace) (round(irate(kubevirt_vmi_memory_swap_out_traffic_bytes_total[6m]), 0.1))) > 0 <1>
108+
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_memory_swap_in_traffic_bytes_total[6m])) + sum by (name, namespace) (rate(kubevirt_vmi_memory_swap_out_traffic_bytes_total[6m]))) > 0 <1>
112109
----
113110
<1> This query returns the top 3 VMs where the guest is performing the most memory swapping at every given moment over a six-minute time period.
114111

0 commit comments

Comments
 (0)