Skip to content

Commit

Permalink
Change io time units to %util
Browse files Browse the repository at this point in the history
When appying rate() to seconds we have 'seconds per second' or fractions of the second, so actually it actually can be from 0 to 1.

Also update intervalFactor to 1 for better rates.

Signed-off-by: Vitaly Zhuravlev <zhuravlev.vitaly@gmail.com>
  • Loading branch information
v-zhuravlev authored and discordianfish committed Jul 26, 2022
1 parent 469600f commit 7519830
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/node-mixin/lib/prom-mixin.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,17 @@ local table = grafana70.panel.table;
.addTarget(prometheus.target(
'rate(node_disk_read_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(diskDeviceSelector)s}[$__rate_interval])' % config,
legendFormat='{{device}} read',
intervalFactor=1,
))
.addTarget(prometheus.target(
'rate(node_disk_written_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(diskDeviceSelector)s}[$__rate_interval])' % config,
legendFormat='{{device}} written',
intervalFactor=1,
))
.addTarget(prometheus.target(
'rate(node_disk_io_time_seconds_total{%(nodeExporterSelector)s, instance="$instance", %(diskDeviceSelector)s}[$__rate_interval])' % config,
legendFormat='{{device}} io time',
intervalFactor=1,
)) +
{
seriesOverrides: [
Expand All @@ -214,7 +217,7 @@ local table = grafana70.panel.table;
],
yaxes: [
self.yaxe(format='Bps'),
self.yaxe(format='s'),
self.yaxe(format='percentunit'),
],
},

Expand Down Expand Up @@ -410,7 +413,7 @@ local table = grafana70.panel.table;
local networkReceived =
graphPanel.new(
'Network Received',
description="Network received (bits/s)",
description='Network received (bits/s)',
datasource='$datasource',
span=6,
format='bps',
Expand All @@ -420,12 +423,13 @@ local table = grafana70.panel.table;
.addTarget(prometheus.target(
'rate(node_network_receive_bytes_total{%(nodeExporterSelector)s, instance="$instance", device!="lo"}[$__rate_interval]) * 8' % config,
legendFormat='{{device}}',
intervalFactor=1,
)),

local networkTransmitted =
graphPanel.new(
'Network Transmitted',
description="Network transmitted (bits/s)",
description='Network transmitted (bits/s)',
datasource='$datasource',
span=6,
format='bps',
Expand All @@ -435,6 +439,7 @@ local table = grafana70.panel.table;
.addTarget(prometheus.target(
'rate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, instance="$instance", device!="lo"}[$__rate_interval]) * 8' % config,
legendFormat='{{device}}',
intervalFactor=1,
)),

local cpuRow =
Expand Down

0 comments on commit 7519830

Please sign in to comment.