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:
Max Lendrich
2021-06-14 17:33:27 +02:00
parent 2bc3c1859a
commit bbab591570
3 changed files with 7 additions and 7 deletions

View File

@@ -34,7 +34,7 @@ Name | Description | Type | Labels
`windows_net_packets_received_unknown_total` | Total packets received by interface that were discarded because of an unknown or unsupported protocol | counter | `nic`
`windows_net_packets_total` | Total packets received and transmitted by interface | counter | `nic`
`windows_net_packets_sent_total` | Total packets transmitted by interface | counter | `nic`
`windows_net_current_bandwidth` | Estimate of the interface's current bandwidth in bits per second (bps) | gauge | `nic`
`windows_net_current_bandwidth_bytes` | Estimate of the interface's current bandwidth in bytes per second | gauge | `nic`
### Example metric
Query the rate of transmitted network traffic
@@ -45,14 +45,14 @@ rate(windows_net_bytes_sent_total{instance="localhost"}[2m])
## Useful queries
Get total utilisation of network interface as a percentage
```
rate(windows_net_bytes_total{instance="localhost", nic="Microsoft_Hyper_V_Network_Adapter__1"}[2m]) * 8 / windows_net_current_bandwidth{instance="locahost", nic="Microsoft_Hyper_V_Network_Adapter__1"} * 100
rate(windows_net_bytes_total{instance="localhost", nic="Microsoft_Hyper_V_Network_Adapter__1"}[2m]) / windows_net_current_bandwidth_bytes{instance="localhost", nic="Microsoft_Hyper_V_Network_Adapter__1"} * 100
```
## Alerting examples
**prometheus.rules**
```yaml
- alert: NetInterfaceUsage
expr: rate(windows_net_bytes_total[2m]) * 8 / windows_net_current_bandwidth * 100 > 95
expr: rate(windows_net_bytes_total[2m]) / windows_net_current_bandwidth_bytes * 100 > 95
for: 10m
labels:
severity: high