From a01f72a8b09fde9b5ccde04d740da6bee06e5931 Mon Sep 17 00:00:00 2001 From: Andrew Banman Date: Fri, 8 Apr 2022 09:27:22 -0700 Subject: [PATCH] Fix Hyper-V VM memory metric types Signed-off-by: Andrew Banman --- collector/hyperv.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/collector/hyperv.go b/collector/hyperv.go index 309e96d7..1131ef93 100644 --- a/collector/hyperv.go +++ b/collector/hyperv.go @@ -1548,28 +1548,28 @@ func (c *HyperVCollector) collectVmMemory(ch chan<- prometheus.Metric) (*prometh ch <- prometheus.MustNewConstMetric( c.VMMemoryAveragePressure, - prometheus.CounterValue, + prometheus.GaugeValue, float64(obj.AveragePressure), obj.Name, ) ch <- prometheus.MustNewConstMetric( c.VMMemoryCurrentPressure, - prometheus.CounterValue, + prometheus.GaugeValue, float64(obj.CurrentPressure), obj.Name, ) ch <- prometheus.MustNewConstMetric( c.VMMemoryGuestVisiblePhysicalMemory, - prometheus.CounterValue, + prometheus.GaugeValue, float64(obj.GuestVisiblePhysicalMemory), obj.Name, ) ch <- prometheus.MustNewConstMetric( c.VMMemoryMaximumPressure, - prometheus.CounterValue, + prometheus.GaugeValue, float64(obj.MaximumPressure), obj.Name, ) @@ -1590,14 +1590,14 @@ func (c *HyperVCollector) collectVmMemory(ch chan<- prometheus.Metric) (*prometh ch <- prometheus.MustNewConstMetric( c.VMMemoryMinimumPressure, - prometheus.CounterValue, + prometheus.GaugeValue, float64(obj.MinimumPressure), obj.Name, ) ch <- prometheus.MustNewConstMetric( c.VMMemoryPhysicalMemory, - prometheus.CounterValue, + prometheus.GaugeValue, float64(obj.PhysicalMemory), obj.Name, )