dmi: add dmi_info metric via GetSystemFirmwareTable (#2500)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau
2026-10-07 11:43:02 +00:00
committed by GitHub
parent ba682be668
commit 66c35b6783
11 changed files with 888 additions and 4 deletions
+73
View File
@@ -0,0 +1,73 @@
# dmi collector
The dmi collector exposes Desktop Management Interface (DMI) / SMBIOS system
information, compatible with node_exporter's
[`dmi` collector](https://github.com/prometheus/node_exporter/blob/master/collector/dmi.go).
|||
-|-
Metric name prefix | `dmi`
Data source | [`GetSystemFirmwareTable`](https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemfirmwaretable) (SMBIOS)
Enabled by default? | No
## Flags
None
## Metrics
| Name | Description | Type | Labels |
|---------------------|-----------------------------------------------------------------------------------------------------|-------|----------------------------------------------------------------------------|
| `windows_dmi_info` | A metric with a constant '1' value labeled by SMBIOS Type 1 (System Information) fields. | gauge | `product_name`, `product_serial`, `product_uuid`, `product_version`, `system_vendor` |
On VMs the labels reflect the hypervisor-assigned identity; on physical hosts
they reflect the hardware SMBIOS data. If SMBIOS data cannot be read (e.g. in
some container environments), the collector will fail to build.
### Example metric
```
# HELP windows_dmi_info A metric with a constant '1' value labeled by product_name, product_serial, product_uuid, product_version, system_vendor from SMBIOS Type 1 (System Information).
# TYPE windows_dmi_info gauge
windows_dmi_info{product_name="Standard PC (Q35 + ICH9, 2009)",product_serial="Not Specified",product_uuid="12345678-1234-1234-1234-123456789abc",product_version="pc-q35-9.2",system_vendor="QEMU"} 1
```
## Useful queries
### Cross-exporter compatibility
The label names match node_exporter's `node_dmi_info` metric, so dashboards
and alerts work across Linux and Windows guests:
```promql
# Works for both Linux and Windows guests
{__name__=~"node_dmi_info|windows_dmi_info"}
```
### Correlate with libvirt_exporter
With [prometheus-libvirt-exporter](https://github.com/inovex/prometheus-libvirt-exporter),
the domain UUID is exposed on `libvirt_domain_info_meta{uuid="..."}`. This UUID
matches the SMBIOS UUID passed to the guest by QEMU/KVM.
Add the `product_uuid` label to any guest metric:
```promql
windows_memory_physical_free_bytes
* on(job, instance) group_left(product_uuid)
windows_dmi_info
```
Join a host-side libvirt metric with the guest-identified UUID (full guest→host chain):
```promql
libvirt_domain_info_memory_usage_bytes
* on(job, instance, domain) group_left(uuid)
libvirt_domain_info_meta
* on(uuid) group_left()
label_replace(windows_dmi_info, "uuid", "$1", "product_uuid", "(.+)")
```
## Alerting examples
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
+3 -3
View File
@@ -5,7 +5,7 @@ The os collector exposes metrics about the operating system
|||
-|-
Metric name prefix | `os`
Classes | [`Win32_OperatingSystem`](https://msdn.microsoft.com/en-us/library/aa394239)
Data sources | Registry
Enabled by default? | Yes
## Flags
@@ -26,7 +26,7 @@ None
# HELP windows_os_hostname Labelled system hostname information as provided by ComputerSystem.DNSHostName and ComputerSystem.Domain
# TYPE windows_os_hostname gauge
windows_os_hostname{domain="",fqdn="PC",hostname="PC"} 1
# HELP windows_os_info Contains full product name & version in labels. Note that the "major_version" for Windows 11 is \\"10\\"; a build number greater than 22000 represents Windows 11.
# HELP windows_os_info Contains full product name & version in labels. Note that the "major_version" for Windows 11 is \\\"10\\\"; a build number greater than 22000 represents Windows 11.
# TYPE windows_os_info gauge
windows_os_info{build_number="19045",installation_type="Client",major_version="10",minor_version="0",product="Windows 10 Pro",revision="4842",version="10.0.19045"} 1
# HELP windows_os_install_time_timestamp_seconds Unix timestamp of OS installation time
@@ -35,7 +35,7 @@ windows_os_install_time_timestamp_seconds 1.6725312e+09
```
## Useful queries
_This collector does not yet have useful queries, we would appreciate your help adding them!_
_This collector does not yet have useful query examples, we would appreciate your help adding them!_
## Alerting examples
_This collector does not yet have alerting examples, we would appreciate your help adding them!_