From 05cad1fb4b9ed02c96ffb49ba6004adb3daeeb97 Mon Sep 17 00:00:00 2001 From: Vitaly Zhuravlev Date: Fri, 20 May 2022 12:08:37 +0400 Subject: [PATCH 1/2] mixin: update units for disk and networking panels (#7) * 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 * Change io time units to %util 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 --- docs/node-mixin/lib/prom-mixin.libsonnet | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/node-mixin/lib/prom-mixin.libsonnet b/docs/node-mixin/lib/prom-mixin.libsonnet index 7e22fd9a73..6b541ac360 100644 --- a/docs/node-mixin/lib/prom-mixin.libsonnet +++ b/docs/node-mixin/lib/prom-mixin.libsonnet @@ -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: [ @@ -213,8 +216,8 @@ local table = grafana70.panel.table; }, ], yaxes: [ - self.yaxe(format='bytes'), - self.yaxe(format='s'), + self.yaxe(format='Bps'), + self.yaxe(format='percentunit'), ], }, @@ -410,29 +413,33 @@ 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}}', + intervalFactor=1, )), 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}}', + intervalFactor=1, )), local cpuRow = From 6ef73ff708f33a56105b439d570aba7a8240fa86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 20:20:10 +0000 Subject: [PATCH 2/2] build(deps): bump github.com/prometheus/client_model from 0.2.0 to 0.3.0 Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.2.0 to 0.3.0. - [Release notes](https://github.com/prometheus/client_model/releases) - [Commits](https://github.com/prometheus/client_model/compare/v0.2.0...v0.3.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_model dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index a98d3de2d4..200cc57fef 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/mdlayher/wifi v0.0.0-20220320220353-954ff73a19a5 github.com/opencontainers/selinux v1.10.2 github.com/prometheus/client_golang v1.13.0 - github.com/prometheus/client_model v0.2.0 + github.com/prometheus/client_model v0.3.0 github.com/prometheus/common v0.37.0 github.com/prometheus/exporter-toolkit v0.8.1 github.com/prometheus/procfs v0.8.0 diff --git a/go.sum b/go.sum index f20b226111..19c1987c87 100644 --- a/go.sum +++ b/go.sum @@ -298,8 +298,9 @@ github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5 github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=