Skip to content

Commit e288750

Browse files
authored
Merge pull request #100651 from jherrman/storage-latency_CNV-62055
OSDOCS#62055 - Docs for VM storage latency
2 parents a151815 + 3385c93 commit e288750

File tree

1 file changed

+40
-17
lines changed

1 file changed

+40
-17
lines changed

modules/virt-querying-metrics.adoc

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,23 @@ This delay appears to the virtual machine as _steal time_, which is CPU time los
3838
Type: Counter.
3939

4040
*Example vCPU delay query*
41+
42+
The following query returns the average per-second delay over a 5-minute period. A high value may indicate CPU overcommitment or contention on the node:
43+
4144
[source,promql]
4245
----
43-
irate(kubevirt_vmi_vcpu_delay_seconds_total[5m]) > 0.05 <1>
46+
irate(kubevirt_vmi_vcpu_delay_seconds_total[5m]) > 0.05
4447
----
45-
<1> This query returns the average per-second delay over a 5-minute period. A high value may indicate CPU overcommitment or contention on the node.
48+
4649

4750
*Example vCPU wait time query*
51+
52+
The following query returns the top 3 VMs waiting for I/O at every given moment over a six-minute time period:
53+
4854
[source,promql]
4955
----
50-
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_vcpu_wait_seconds_total[6m]))) > 0 <1>
56+
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_vcpu_wait_seconds_total[6m]))) > 0
5157
----
52-
<1> This query returns the top 3 VMs waiting for I/O at every given moment over a six-minute time period.
5358
endif::openshift-rosa,openshift-dedicated[]
5459

5560
[id="virt-promql-network-metrics_{context}"]
@@ -64,11 +69,13 @@ Returns the total amount of traffic received (in bytes) on the virtual machine's
6469
Returns the total amount of traffic transmitted (in bytes) on the virtual machine's network. Type: Counter.
6570

6671
*Example network traffic query*
72+
73+
The following query returns the top 3 VMs transmitting the most network traffic at every given moment over a six-minute time period:
74+
6775
[source,promql]
6876
----
69-
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>
77+
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
7078
----
71-
<1> This query returns the top 3 VMs transmitting the most network traffic at every given moment over a six-minute time period.
7279

7380
[id="virt-promql-storage-metrics_{context}"]
7481
== Storage metrics
@@ -85,13 +92,21 @@ Returns the total amount (in bytes) of the virtual machine's storage-related tra
8592
Returns the total amount of storage writes (in bytes) of the virtual machine's storage-related traffic. Type: Counter.
8693
--
8794

88-
*Example storage-related traffic query*
95+
*Example storage-related traffic queries*
96+
97+
* The following query returns the top 3 VMs performing the most storage traffic at every given moment over a six-minute time period:
98+
+
8999
[source,promql]
90100
----
91-
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>
101+
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
92102
----
93103

94-
<1> This query returns the top 3 VMs performing the most storage traffic at every given moment over a six-minute time period.
104+
* The following query returns the top 3 VMs with the highest average read latency at every given moment over a six-minute time period:
105+
+
106+
[source,promql]
107+
----
108+
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_storage_read_times_seconds_total{name='${name}',namespace='${namespace}'${clusterFilter}}[6m]) / rate(kubevirt_vmi_storage_iops_read_total{name='${name}',namespace='${namespace}'${clusterFilter}}[6m]) > 0)) > 0
109+
----
95110

96111
[id="virt-storage-snapshot-data_{context}"]
97112
=== Storage snapshot data
@@ -103,17 +118,21 @@ Returns the total number of virtual machine disks restored from the source virtu
103118
Returns the amount of space in bytes restored from the source virtual machine. Type: Gauge.
104119

105120
*Examples of storage snapshot data queries*
121+
122+
* The following query returns the total number of virtual machine disks restored from the source virtual machine:
123+
+
106124
[source,promql]
107125
----
108-
kubevirt_vmsnapshot_disks_restored_from_source{vm_name="simple-vm", vm_namespace="default"} <1>
126+
kubevirt_vmsnapshot_disks_restored_from_source{vm_name="simple-vm", vm_namespace="default"}
109127
----
110-
<1> This query returns the total number of virtual machine disks restored from the source virtual machine.
111128

129+
* The following query returns the amount of space in bytes restored from the source virtual machine:
130+
+
112131
[source,promql]
113132
----
114-
kubevirt_vmsnapshot_disks_restored_from_source_bytes{vm_name="simple-vm", vm_namespace="default"} <1>
133+
kubevirt_vmsnapshot_disks_restored_from_source_bytes{vm_name="simple-vm", vm_namespace="default"}
115134
----
116-
<1> This query returns the amount of space in bytes restored from the source virtual machine.
135+
117136

118137
[id="virt-iops_{context}"]
119138
=== I/O performance
@@ -127,11 +146,13 @@ Returns the amount of write I/O operations the virtual machine is performing per
127146
Returns the amount of read I/O operations the virtual machine is performing per second. Type: Counter.
128147

129148
*Example I/O performance query*
149+
150+
The following query returns the top 3 VMs performing the most I/O operations per second at every given moment over a six-minute time period:
151+
130152
[source,promql]
131153
----
132-
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>
154+
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
133155
----
134-
<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.
135156

136157
[id="virt-promql-guest-memory-metrics_{context}"]
137158
== Guest memory swapping metrics
@@ -145,12 +166,14 @@ Returns the total amount (in bytes) of memory the virtual guest is swapping in.
145166
Returns the total amount (in bytes) of memory the virtual guest is swapping out. Type: Gauge.
146167

147168
*Example memory swapping query*
169+
170+
The following 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:
171+
148172
[source,promql]
149173
----
150-
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_memory_swap_in_traffic_bytes[6m])) + sum by (name, namespace) (rate(kubevirt_vmi_memory_swap_out_traffic_bytes[6m]))) > 0 <1>
174+
topk(3, sum by (name, namespace) (rate(kubevirt_vmi_memory_swap_in_traffic_bytes[6m])) + sum by (name, namespace) (rate(kubevirt_vmi_memory_swap_out_traffic_bytes[6m]))) > 0
151175
+
152176
----
153-
<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.
154177

155178
[NOTE]
156179
====

0 commit comments

Comments
 (0)