fix interval in graphs panels of node dashboard

Signed-off-by: raviprasad_lr <raviprasad_lr@yahoo.com>
This commit is contained in:
raviprasad_lr 2021-04-23 21:40:51 -07:00 committed by Johannes 'fish' Ziemke
parent 46cdf618c9
commit 504f9b785c
1 changed files with 6 additions and 12 deletions

View File

@ -23,14 +23,13 @@ local gauge = promgrafonnet.gauge;
.addTarget(prometheus.target( .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 / ignoring(cpu) group_left
count without (cpu)( node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle", instance="$instance"}) count without (cpu)( node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle", instance="$instance"})
) )
||| % $._config, ||| % $._config,
legendFormat='{{cpu}}', legendFormat='{{cpu}}',
intervalFactor=5, intervalFactor=5,
interval='$__rate_interval',
)); ));
local systemLoad = local systemLoad =
@ -99,19 +98,16 @@ local gauge = promgrafonnet.gauge;
) )
// TODO: Does it make sense to have those three in the same panel? // TODO: Does it make sense to have those three in the same panel?
.addTarget(prometheus.target( .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', legendFormat='{{device}} read',
interval='$__rate_interval',
)) ))
.addTarget(prometheus.target( .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', legendFormat='{{device}} written',
interval='$__rate_interval',
)) ))
.addTarget(prometheus.target( .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', legendFormat='{{device}} io time',
interval='$__rate_interval',
)) + )) +
{ {
seriesOverrides: [ seriesOverrides: [
@ -186,9 +182,8 @@ local gauge = promgrafonnet.gauge;
fill=0, fill=0,
) )
.addTarget(prometheus.target( .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}}', legendFormat='{{device}}',
interval='$__rate_interval',
)); ));
local networkTransmitted = local networkTransmitted =
@ -201,9 +196,8 @@ local gauge = promgrafonnet.gauge;
fill=0, fill=0,
) )
.addTarget(prometheus.target( .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}}', legendFormat='{{device}}',
interval='$__rate_interval',
)); ));
dashboard.new('Nodes', time_from='now-1h') dashboard.new('Nodes', time_from='now-1h')