From 2c155a12bdd333595b0657c5f145376295d40dd7 Mon Sep 17 00:00:00 2001 From: Ben Reedy Date: Wed, 28 Aug 2019 21:12:14 +1000 Subject: [PATCH] Set current_bandwidth to gauge type Bandwidth estimate for an interface may decrease or increase --- collector/net.go | 2 +- docs/collector.net.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/net.go b/collector/net.go index b22f96a31..5ea71e42c 100644 --- a/collector/net.go +++ b/collector/net.go @@ -252,7 +252,7 @@ func (c *NetworkCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Des ) ch <- prometheus.MustNewConstMetric( c.CurrentBandwidth, - prometheus.CounterValue, + prometheus.GaugeValue, float64(nic.CurrentBandwidth), name, ) diff --git a/docs/collector.net.md b/docs/collector.net.md index f3d95dd1a..779e40102 100644 --- a/docs/collector.net.md +++ b/docs/collector.net.md @@ -33,7 +33,7 @@ Name | Description | Type | Labels `wmi_net_packets_received_unknown` | Total packets received by interface that were discarded because of an unknown or unsupported protocol | counter | `nic` `wmi_net_packets_total` | Total packets received and transmitted by interface | counter | `nic` `wmi_net_packets_sent_total` | Total packets transmitted by interface | counter | `nic` -`wmi_net_current_bandwidth` | Estimate of the interface's current bandwidth in bits per second (bps) | counter | `nic` +`wmi_net_current_bandwidth` | Estimate of the interface's current bandwidth in bits per second (bps) | gauge | `nic` ### Example metric Query the rate of transmitted network traffic