Merge pull request #804 from max-len/bandwidth-bytes

Export CurrentBandwidth as bytes
This commit is contained in:
Calle Pettersson
2021-06-16 20:16:45 +02:00
committed by GitHub
3 changed files with 7 additions and 7 deletions

View File

@@ -118,7 +118,7 @@ func NewNetworkCollector() (Collector, error) {
nil,
),
CurrentBandwidth: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "current_bandwidth"),
prometheus.BuildFQName(Namespace, subsystem, "current_bandwidth_bytes"),
"(Network.CurrentBandwidth)",
[]string{"nic"},
nil,
@@ -251,7 +251,7 @@ func (c *NetworkCollector) collect(ctx *ScrapeContext, ch chan<- prometheus.Metr
ch <- prometheus.MustNewConstMetric(
c.CurrentBandwidth,
prometheus.GaugeValue,
nic.CurrentBandwidth,
nic.CurrentBandwidth/8,
name,
)
}