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 committed May 12, 2022
1 parent 7e5586f commit 14d311a
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 @@ -191,14 +191,17 @@ local gaugePanel = grafana70.panel.gauge;
.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 @@ -213,7 +216,7 @@ local gaugePanel = grafana70.panel.gauge;
],
yaxes: [
self.yaxe(format='Bps'),
self.yaxe(format='s'),
self.yaxe(format='percentunit'),
],
},

Expand Down Expand Up @@ -266,7 +269,7 @@ local gaugePanel = grafana70.panel.gauge;
local networkReceived =
graphPanel.new(
'Network Received',
description="Network received (bits/s)",
description='Network received (bits/s)',
datasource='$datasource',
span=6,
format='bps',
Expand All @@ -276,12 +279,13 @@ local gaugePanel = grafana70.panel.gauge;
.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 @@ -291,6 +295,7 @@ local gaugePanel = grafana70.panel.gauge;
.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 14d311a

Please sign in to comment.