From 504f9b785cea3a35587167710579375eafbf2e0a Mon Sep 17 00:00:00 2001 From: raviprasad_lr Date: Fri, 23 Apr 2021 21:40:51 -0700 Subject: [PATCH] fix interval in graphs panels of node dashboard Signed-off-by: raviprasad_lr --- docs/node-mixin/dashboards/node.libsonnet | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/docs/node-mixin/dashboards/node.libsonnet b/docs/node-mixin/dashboards/node.libsonnet index 60c9ab8d..ea7bcd40 100644 --- a/docs/node-mixin/dashboards/node.libsonnet +++ b/docs/node-mixin/dashboards/node.libsonnet @@ -23,14 +23,13 @@ local gauge = promgrafonnet.gauge; .addTarget(prometheus.target( ||| ( - (1 - rate(node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle", instance="$instance"}[$__interval])) + (1 - rate(node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle", instance="$instance"}[$__rate_interval])) / ignoring(cpu) group_left count without (cpu)( node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle", instance="$instance"}) ) ||| % $._config, legendFormat='{{cpu}}', intervalFactor=5, - interval='$__rate_interval', )); local systemLoad = @@ -99,19 +98,16 @@ local gauge = promgrafonnet.gauge; ) // TODO: Does it make sense to have those three in the same panel? .addTarget(prometheus.target( - 'rate(node_disk_read_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(diskDeviceSelector)s}[$__interval])' % $._config, + 'rate(node_disk_read_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(diskDeviceSelector)s}[$__rate_interval])' % $._config, legendFormat='{{device}} read', - interval='$__rate_interval', )) .addTarget(prometheus.target( - 'rate(node_disk_written_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(diskDeviceSelector)s}[$__interval])' % $._config, + 'rate(node_disk_written_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(diskDeviceSelector)s}[$__rate_interval])' % $._config, legendFormat='{{device}} written', - interval='$__rate_interval', )) .addTarget(prometheus.target( - 'rate(node_disk_io_time_seconds_total{%(nodeExporterSelector)s, instance="$instance", %(diskDeviceSelector)s}[$__interval])' % $._config, + 'rate(node_disk_io_time_seconds_total{%(nodeExporterSelector)s, instance="$instance", %(diskDeviceSelector)s}[$__rate_interval])' % $._config, legendFormat='{{device}} io time', - interval='$__rate_interval', )) + { seriesOverrides: [ @@ -186,9 +182,8 @@ local gauge = promgrafonnet.gauge; fill=0, ) .addTarget(prometheus.target( - 'rate(node_network_receive_bytes_total{%(nodeExporterSelector)s, instance="$instance", device!="lo"}[$__interval])' % $._config, + 'rate(node_network_receive_bytes_total{%(nodeExporterSelector)s, instance="$instance", device!="lo"}[$__rate_interval])' % $._config, legendFormat='{{device}}', - interval='$__rate_interval', )); local networkTransmitted = @@ -201,9 +196,8 @@ local gauge = promgrafonnet.gauge; fill=0, ) .addTarget(prometheus.target( - 'rate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, instance="$instance", device!="lo"}[$__interval])' % $._config, + 'rate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, instance="$instance", device!="lo"}[$__rate_interval])' % $._config, legendFormat='{{device}}', - interval='$__rate_interval', )); dashboard.new('Nodes', time_from='now-1h')