packages icon indicating copy to clipboard operation
packages copied to clipboard

Prometheus node_network_speed_bytes

Open antoniovalenzuela opened this issue 1 year ago • 1 comments

OpenWrt 23.05.4 (r24012-d8dd03c46f) on Linksys WRT3200ACM.

Metric "node_network_speed_bytes" always show 125000000

I need get the current speed Upload/Download Mbps of WAN Upload/Download interface with Prometheus Explorer.

Please help

imagen

antoniovalenzuela avatar Aug 26 '24 21:08 antoniovalenzuela

This metric is expected to be constant, unless device is reconnected: it merely takes content of /sys/class/net/wan/speed and converts into bytes/s (original in Mb/s). And AFAIK, content of this file is kept constant once connection is established.

Regarding your need: to get current speed on the interface you can use something like irate(node_network_receive_bytes_total{device="wan"}[5m]) and irate(node_network_transmit_bytes_total{device="wan"}[5m]). Depending on situation you might need to switch to rate and adjust range selector, though.

markalex2209 avatar Oct 26 '24 18:10 markalex2209