mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-26 22:56:36 +00:00
Export CurrentBandwidth as bytes
From https://prometheus.io/docs/practices/naming/: To avoid confusion combining different metrics, always use bytes, even where bits appear more common. Fixes #800 Signed-off-by: Max Lendrich <maximilian.lendrich@sap.com>
This commit is contained in:
@@ -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,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user