From 0ab6c191be2f7be69183d69a39391d127898de65 Mon Sep 17 00:00:00 2001 From: Calle Pettersson Date: Sun, 29 Apr 2018 17:14:53 +0200 Subject: [PATCH] Fix wrong metric types in system collector, improve help-strings --- collector/system.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/collector/system.go b/collector/system.go index 83ae9e1c..051da15b 100644 --- a/collector/system.go +++ b/collector/system.go @@ -30,37 +30,37 @@ func NewSystemCollector() (Collector, error) { return &SystemCollector{ ContextSwitchesTotal: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "context_switches_total"), - "PerfOS_System.ContextSwitchesPersec", + "Total number of context switches (WMI source: PerfOS_System.ContextSwitchesPersec)", nil, nil, ), ExceptionDispatchesTotal: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "exception_dispatches_total"), - "PerfOS_System.ExceptionDispatchesPersec", + "Total number of exceptions dispatched (WMI source: PerfOS_System.ExceptionDispatchesPersec)", nil, nil, ), ProcessorQueueLength: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "processor_queue_length"), - "PerfOS_System.ProcessorQueueLength", + "Length of processor queue (WMI source: PerfOS_System.ProcessorQueueLength)", nil, nil, ), SystemCallsTotal: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "system_calls_total"), - "PerfOS_System.SystemCallsPersec", + "Total number of system calls (WMI source: PerfOS_System.SystemCallsPersec)", nil, nil, ), SystemUpTime: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "system_up_time"), - "SystemUpTime/Frequency_Object", + "System boot time (WMI source: PerfOS_System.SystemUpTime)", nil, nil, ), Threads: prometheus.NewDesc( prometheus.BuildFQName(Namespace, subsystem, "threads"), - "PerfOS_System.Threads", + "Current number of threads (WMI source: PerfOS_System.Threads)", nil, nil, ), @@ -96,12 +96,12 @@ func (c *SystemCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc ch <- prometheus.MustNewConstMetric( c.ContextSwitchesTotal, - prometheus.GaugeValue, + prometheus.CounterValue, float64(dst[0].ContextSwitchesPersec), ) ch <- prometheus.MustNewConstMetric( c.ExceptionDispatchesTotal, - prometheus.GaugeValue, + prometheus.CounterValue, float64(dst[0].ExceptionDispatchesPersec), ) ch <- prometheus.MustNewConstMetric( @@ -111,7 +111,7 @@ func (c *SystemCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc ) ch <- prometheus.MustNewConstMetric( c.SystemCallsTotal, - prometheus.GaugeValue, + prometheus.CounterValue, float64(dst[0].SystemCallsPersec), ) ch <- prometheus.MustNewConstMetric(