From 469600f4bf5815dc4ec77ba91c4ff7b1edf7835b Mon Sep 17 00:00:00 2001 From: Vitaly Zhuravlev Date: Thu, 12 May 2022 22:38:18 +0400 Subject: [PATCH] Update units of network ad disk graphs https://prometheus.io/docs/prometheus/latest/querying/functions/#rate rate() calculates per-second average rate, therefore Bps units should be used for disks. In networking bandwidth throughput is usually measured in bits/s so units are changed accordingly. Signed-off-by: Vitaly Zhuravlev --- docs/node-mixin/lib/prom-mixin.libsonnet | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/node-mixin/lib/prom-mixin.libsonnet b/docs/node-mixin/lib/prom-mixin.libsonnet index 7e22fd9a..2aab694c 100644 --- a/docs/node-mixin/lib/prom-mixin.libsonnet +++ b/docs/node-mixin/lib/prom-mixin.libsonnet @@ -213,7 +213,7 @@ local table = grafana70.panel.table; }, ], yaxes: [ - self.yaxe(format='bytes'), + self.yaxe(format='Bps'), self.yaxe(format='s'), ], }, @@ -410,28 +410,30 @@ local table = grafana70.panel.table; local networkReceived = graphPanel.new( 'Network Received', + description="Network received (bits/s)", datasource='$datasource', span=6, - format='bytes', + format='bps', min=0, fill=0, ) .addTarget(prometheus.target( - 'rate(node_network_receive_bytes_total{%(nodeExporterSelector)s, instance="$instance", device!="lo"}[$__rate_interval])' % config, + 'rate(node_network_receive_bytes_total{%(nodeExporterSelector)s, instance="$instance", device!="lo"}[$__rate_interval]) * 8' % config, legendFormat='{{device}}', )), local networkTransmitted = graphPanel.new( 'Network Transmitted', + description="Network transmitted (bits/s)", datasource='$datasource', span=6, - format='bytes', + format='bps', min=0, fill=0, ) .addTarget(prometheus.target( - 'rate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, instance="$instance", device!="lo"}[$__rate_interval])' % config, + 'rate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, instance="$instance", device!="lo"}[$__rate_interval]) * 8' % config, legendFormat='{{device}}', )),