From c23a98ae900b6787b21db9b9a1f11cc07462236d Mon Sep 17 00:00:00 2001 From: Ben Reedy Date: Fri, 27 Sep 2019 19:48:16 +1000 Subject: [PATCH] Set tcp_connections_established to gauge type While the ConnectionsEstablished property in the Win32_PerfRawData_Tcpip_TCP class is listed as a counter, real-world metric values have been shown to increase *and* decrease. Documentation for the property states "Number of TCP connections for which the *current* state is either ESTABLISHED or CLOSE-WAIT" which would imply the metric is a gauge. --- collector/tcp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collector/tcp.go b/collector/tcp.go index 44a68712..3400fd59 100644 --- a/collector/tcp.go +++ b/collector/tcp.go @@ -136,7 +136,7 @@ func (c *TCPCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, e ) ch <- prometheus.MustNewConstMetric( c.ConnectionsEstablished, - prometheus.CounterValue, + prometheus.GaugeValue, float64(dst[0].ConnectionsEstablished), ) ch <- prometheus.MustNewConstMetric(