hyperv: add WMI health metric (#2494)

Co-authored-by: EisenbergD <dominik.eisenberg@beiersdorf.com>
Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: EisenbergD <dominik.eisenberg@beiersdorf.com>
Signed-off-by: Dominik Eisenberg <64131471+Dominik-esb@users.noreply.github.com>
This commit is contained in:
Dominik Eisenberg
2026-10-07 09:24:34 +00:00
committed by GitHub
co-authored by EisenbergD Jan-Otto Kröpke
parent 9496b537d6
commit 7b19310999
4 changed files with 130 additions and 3 deletions
+28 -2
View File
@@ -12,8 +12,7 @@ The hyperv collector exposes metrics about the Hyper-V hypervisor
### `--collectors.hyperv.enabled`
Comma-separated list of collectors to use, for example:
`--collectors.hyperv.enabled=dynamic_memory_balancer,dynamic_memory_vm,host,hypervisor_logical_processor,hypervisor_root_partition,hypervisor_root_virtual_processor,hypervisor_virtual_processor,legacy_network_adapter,virtual_machine_health_summary,virtual_machine_vid_partition,virtual_network_adapter,virtual_storage_device,virtual_switch`.
Matching is case-sensitive.
`--collectors.hyperv.enabled=dynamic_memory_balancer,dynamic_memory_vm,host,hypervisor_logical_processor,hypervisor_root_partition,hypervisor_root_virtual_processor,hypervisor_virtual_processor,legacy_network_adapter,virtual_machine_health_summary,virtual_machine_vid_partition,virtual_network_adapter,virtual_storage_device,virtual_switch,wmi_health`
## Metrics
@@ -274,6 +273,33 @@ Multiply by the number of threads per core to get the ratio per **physical** cor
| `windows_hyperv_vid_remote_physical_pages` | The number of physical pages not allocated from the preferred NUMA node | gauge | `vm` |
### Hyper-V WMI Health
Sub-collector `wmi_health`, enabled by default. It runs a minimal WQL query
(`SELECT Name FROM Msvm_ComputerSystem WHERE Caption = 'Hosting Computer System'`) against the
`root/virtualization/v2` namespace on every scrape, so remove it from `--collectors.hyperv.enabled` if you don't need it.
| Name | Description | Type | Labels |
|----------------------------|--------------------------------------------------------------------------------------------------------------|-------|--------|
| `windows_hyperv_wmi_health` | Hyper-V WMI health status. 1 if the Hyper-V WMI namespace is responding, 0 if it is broken or not responding | gauge | None |
WMI can stop responding while the host and the exporter otherwise keep running. On a Hyper-V
cluster node, Failover Cluster Manager generally cannot connect to the host in that state, and
recovery often requires a reboot. The query times out after 5 seconds and is then reported as `0`.
Example alert:
```yaml
- alert: HyperVWMIUnhealthy
expr: windows_hyperv_wmi_health == 0
for: 5m
labels:
severity: critical
annotations:
summary: Hyper-V WMI is not responding on {{ $labels.instance }}
```
### Hyper-V Virtual Machine Health Summary
| Name | Description | Type | Labels |