From a91caac92c21406704007496d33d304b191f8c6e Mon Sep 17 00:00:00 2001 From: Dominik Eisenberg <64131471+Dominik-esb@users.noreply.github.com> Date: Fri, 6 Mar 2026 22:16:42 +0100 Subject: [PATCH] hyperv: fix virtual_storage_device_throughput metric to be a counter (not gauge) with _total suffix (#2285) Co-authored-by: EisenbergD --- docs/collector.hyperv.md | 2 +- internal/collector/hyperv/hyperv_virtual_storage_device.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/collector.hyperv.md b/docs/collector.hyperv.md index 2fbd6ec3..1761cd54 100644 --- a/docs/collector.hyperv.md +++ b/docs/collector.hyperv.md @@ -237,7 +237,7 @@ Some metrics explained: https://learn.microsoft.com/en-us/archive/blogs/chrisavi | `windows_hyperv_virtual_storage_device_bytes_written` | Represents the total number of bytes that have been written on this virtual device. | counter | `device` | | `windows_hyperv_virtual_storage_device_operations_written_total` | Represents the total number of write operations that have occurred on this virtual device. | counter | `device` | | `windows_hyperv_virtual_storage_device_latency_seconds` | Represents the average IO transfer latency for this virtual device. | gauge | `device` | -| `windows_hyperv_virtual_storage_device_throughput` | Represents the average number of 8KB IO transfers completed by this virtual device. | gauge | `device` | +| `windows_hyperv_virtual_storage_device_throughput_total` | Represents the total number of 8KB IO transfers completed by this virtual device. | counter | `device` | | `windows_hyperv_virtual_storage_device_normalized_throughput` | Represents the average number of IO transfers completed by this virtual device. | gauge | `device` | | `windows_hyperv_virtual_storage_device_lower_queue_length` | Represents the average queue length on the underlying storage subsystem for this device. | gauge | `device` | | `windows_hyperv_virtual_storage_device_lower_latency_seconds` | Represents the average IO transfer latency on the underlying storage subsystem for this virtual device. | gauge | `device` | diff --git a/internal/collector/hyperv/hyperv_virtual_storage_device.go b/internal/collector/hyperv/hyperv_virtual_storage_device.go index d96eb046..5812ec43 100644 --- a/internal/collector/hyperv/hyperv_virtual_storage_device.go +++ b/internal/collector/hyperv/hyperv_virtual_storage_device.go @@ -112,8 +112,8 @@ func (c *Collector) buildVirtualStorageDevice() error { nil, ) c.virtualStorageDeviceThroughput = prometheus.NewDesc( - prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_throughput"), - "Represents the average number of 8KB IO transfers completed by this virtual device.", + prometheus.BuildFQName(types.Namespace, Name, "virtual_storage_device_throughput_total"), + "Represents the total number of 8KB IO transfers completed by this virtual device.", []string{"device"}, nil, ) @@ -203,7 +203,7 @@ func (c *Collector) collectVirtualStorageDevice(ch chan<- prometheus.Metric) err ch <- prometheus.MustNewConstMetric( c.virtualStorageDeviceThroughput, - prometheus.GaugeValue, + prometheus.CounterValue, data.VirtualStorageDeviceThroughput, data.Name, )