storage_spaces: move storage pool and virtual disk metrics out of mscluster (#2646)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2026-10-10 16:50:35 +02:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 60e52fd8e6
commit 2b21e74f0e
15 changed files with 361 additions and 106 deletions
+1
View File
@@ -44,6 +44,7 @@ Actions workflow publishes default-branch changes to GitHub Pages.
- [`smb`](collector.smb.md)
- [`smbclient`](collector.smbclient.md)
- [`smtp`](collector.smtp.md)
- [`storage_spaces`](collector.storage_spaces.md)
- [`system`](collector.system.md)
- [`tcp`](collector.tcp.md)
- [`terminal_services`](collector.terminal_services.md)
+5 -39
View File
@@ -5,14 +5,17 @@ The MSCluster_Cluster class is a dynamic WMI class that represents a cluster.
|||
-|-
Metric name prefix | `mscluster`
Classes | `MSCluster_Cluster`,`MSCluster_Network`,`MSCluster_Node`,`MSCluster_Resource`,`MSCluster_ResourceGroup`,`MSCluster_DiskPartition`,`MSFT_VirtualDisk`,`MSFT_StoragePool`
Classes | `MSCluster_Cluster`,`MSCluster_Network`,`MSCluster_Node`,`MSCluster_Resource`,`MSCluster_ResourceGroup`,`MSCluster_DiskPartition`
Enabled by default? | No
Storage pool and virtual disk metrics (for example of Storage Spaces Direct) are exposed by the
[`storage_spaces`](collector.storage_spaces.md) collector.
## Flags
### `--collector.mscluster.enabled`
Comma-separated list of collectors to use, for example:
`--collector.mscluster.enabled=cluster,network,node,resource,resourcegroup,shared_volumes,virtualdisk,storagepool`.
`--collector.mscluster.enabled=cluster,network,node,resource,resourcegroup,shared_volumes`.
Matching is case-sensitive.
## Metrics
@@ -178,55 +181,18 @@ Matching is case-sensitive.
| `mscluster_shared_volumes_total_bytes` | Total size of the Cluster Shared Volume in bytes | gauge | `name`,`volume_guid` |
| `mscluster_shared_volumes_free_bytes` | Free space on the Cluster Shared Volume in bytes | gauge | `name`,`volume_guid` |
### Virtual Disk
| Name | Description | Type | Labels |
|-----------------------------------------------------------|------------------------------------------------------------------------------------------------|-------|--------|
| `mscluster_virtualdisk_info` | Virtual disk information (value is always 1) | gauge | `name`, `unique_id` |
| `mscluster_virtualdisk_health_status` | Health status of the virtual disk. 0: Healthy, 1: Warning, 2: Unhealthy, 5: Unknown | gauge | `name`, `unique_id` |
| `mscluster_virtualdisk_size_bytes` | Total size of the virtual disk in bytes | gauge | `name`, `unique_id` |
| `mscluster_virtualdisk_allocated_size_bytes` | Allocated size of the virtual disk in bytes (capacity actually provisioned, excludes thin-provisioned unused capacity) | gauge | `name`, `unique_id` |
| `mscluster_virtualdisk_footprint_on_pool_bytes` | Physical storage consumed by the virtual disk on the storage pool in bytes | gauge | `name`, `unique_id` |
| `mscluster_virtualdisk_storage_efficiency_percent` | Storage efficiency percentage (AllocatedSize / FootprintOnPool * 100) | gauge | `name`, `unique_id` |
### Storage Pool
| Name | Description | Type | Labels |
|-----------------------------------------------|-------------------------------------------------------------------------------------|-------|---------------------|
| `mscluster_storagepool_info` | Storage pool information (value is always 1) | gauge | `name`, `unique_id` |
| `mscluster_storagepool_health_status` | Health status of the storage pool. 0: Healthy, 1: Warning, 2: Unhealthy, 5: Unknown | gauge | `name`, `unique_id` |
| `mscluster_storagepool_size_bytes` | Total size of the storage pool in bytes | gauge | `name`, `unique_id` |
| `mscluster_storagepool_allocated_size_bytes` | Allocated size of the storage pool in bytes | gauge | `name`, `unique_id` |
| `mscluster_storagepool_operational_status` | Operational status codes reported for the storage pool (one series per status value) | gauge | `name`, `unique_id`, `status` |
| `mscluster_storagepool_thin_provisioning_alert_thresholds` | Thin provisioning alert thresholds configured for the storage pool, in percent (one series per configured threshold) | gauge | `name`, `unique_id`, `threshold` |
### Example metric
Query the state of all cluster resource owned by node1
```
windows_mscluster_resource_owner_node{node_name="node1"}
```
Query virtual disk storage efficiency for thin provisioned disks
```
windows_mscluster_virtualdisk_storage_efficiency_percent
```
## Useful queries
Counts the number of Network Name cluster resource
```
count(windows_mscluster_resource_state{type="Network Name"})
```
Find virtual disks with low storage efficiency (over-provisioned)
```
windows_mscluster_virtualdisk_storage_efficiency_percent < 50
```
Calculate total virtual disk capacity vs physical usage
```
sum(windows_mscluster_virtualdisk_size_bytes) / sum(windows_mscluster_virtualdisk_footprint_on_pool_bytes) * 100
```
## Alerting examples
#### Low free space on cluster shared volume
+76
View File
@@ -0,0 +1,76 @@
# storage_spaces collector
The storage_spaces collector exposes metrics about Storage Spaces storage pools and virtual disks.
It works on standalone hosts as well as on failover clusters using Storage Spaces Direct.
|||
-|-
Metric name prefix | `storage_spaces`
Classes | [`MSFT_StoragePool`](https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-storagepool), [`MSFT_VirtualDisk`](https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-virtualdisk)
Enabled by default? | No
## Flags
### `--collector.storage_spaces.enabled`
Comma-separated list of collectors to use, for example:
`--collector.storage_spaces.enabled=pool,virtual_disk`.
Matching is case-sensitive.
## Metrics
### Pool
| Name | Description | Type | Labels |
|------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|-------|----------------------------------|
| `windows_storage_spaces_pool_info` | Storage pool information (value is always 1) | gauge | `name`, `unique_id` |
| `windows_storage_spaces_pool_health_status` | Health status of the storage pool. 0: Healthy, 1: Warning, 2: Unhealthy, 5: Unknown | gauge | `name`, `unique_id` |
| `windows_storage_spaces_pool_size_bytes` | Total size of the storage pool in bytes | gauge | `name`, `unique_id` |
| `windows_storage_spaces_pool_allocated_size_bytes` | Allocated size of the storage pool in bytes | gauge | `name`, `unique_id` |
| `windows_storage_spaces_pool_operational_status` | Operational status codes reported for the storage pool (one series per status value) | gauge | `name`, `unique_id`, `status` |
| `windows_storage_spaces_pool_thin_provisioning_alert_thresholds` | Thin provisioning alert thresholds configured for the storage pool, in percent (one series per configured threshold) | gauge | `name`, `unique_id`, `threshold` |
### Virtual Disk
| Name | Description | Type | Labels |
|------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|-------|---------------------|
| `windows_storage_spaces_virtual_disk_info` | Virtual disk information (value is always 1) | gauge | `name`, `unique_id` |
| `windows_storage_spaces_virtual_disk_health_status` | Health status of the virtual disk. 0: Healthy, 1: Warning, 2: Unhealthy, 5: Unknown | gauge | `name`, `unique_id` |
| `windows_storage_spaces_virtual_disk_size_bytes` | Total size of the virtual disk in bytes | gauge | `name`, `unique_id` |
| `windows_storage_spaces_virtual_disk_allocated_size_bytes` | Allocated size of the virtual disk in bytes (capacity actually provisioned, excludes thin-provisioned unused capacity) | gauge | `name`, `unique_id` |
| `windows_storage_spaces_virtual_disk_footprint_on_pool_bytes` | Physical storage consumed by the virtual disk on the storage pool in bytes | gauge | `name`, `unique_id` |
| `windows_storage_spaces_virtual_disk_storage_efficiency_percent` | Storage efficiency percentage (AllocatedSize / FootprintOnPool * 100), omitted while FootprintOnPool is 0 | gauge | `name`, `unique_id` |
### Example metric
`windows_storage_spaces_pool_size_bytes{name="Pool01",unique_id="{8f2c...}"} 1.0995116277760e+12`
## Useful queries
Storage pool usage in percent
```
windows_storage_spaces_pool_allocated_size_bytes / windows_storage_spaces_pool_size_bytes * 100
```
Find virtual disks with low storage efficiency (over-provisioned)
```
windows_storage_spaces_virtual_disk_storage_efficiency_percent < 50
```
Calculate total virtual disk capacity vs physical usage
```
sum(windows_storage_spaces_virtual_disk_size_bytes) / sum(windows_storage_spaces_virtual_disk_footprint_on_pool_bytes) * 100
```
## Alerting examples
#### Unhealthy storage pool
```yaml
- alert: StoragePoolUnhealthy
expr: windows_storage_spaces_pool_health_status != 0
for: 10m
labels:
severity: warning
annotations:
summary: "Storage pool {{ $labels.name }} is not healthy"
description: "Storage pool {{ $labels.name }} on {{ $labels.instance }} reports health status {{ $value }}."
```