From b8c4b0cb298bf63ca701073e921c65e5fc99a0d7 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Thu, 18 Jul 2019 14:14:02 +0200 Subject: [PATCH] Removed unneeded `sum_` and `avg_` from rule names Signed-off-by: beorn7 --- docs/node-mixin/dashboards/use.libsonnet | 38 ++++++++++++------------ docs/node-mixin/rules/rules.libsonnet | 14 ++++----- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/node-mixin/dashboards/use.libsonnet b/docs/node-mixin/dashboards/use.libsonnet index e3739ac2..23cd2ea7 100644 --- a/docs/node-mixin/dashboards/use.libsonnet +++ b/docs/node-mixin/dashboards/use.libsonnet @@ -12,7 +12,7 @@ local g = import 'grafana-builder/grafana.libsonnet'; g.panel('CPU Utilisation') + g.queryPanel(||| ( - instance:node_cpu_utilisation:avg_rate1m{%(nodeExporterSelector)s} + instance:node_cpu_utilisation:rate1m{%(nodeExporterSelector)s} * instance:node_num_cpu:sum{%(nodeExporterSelector)s} / ignoring (instance) group_left @@ -46,10 +46,10 @@ local g = import 'grafana-builder/grafana.libsonnet'; { yaxes: g.yaxes({ format: 'percentunit', max: 1 }) }, ) .addPanel( - g.panel('Memory Saturation (Swap I/O)') + - g.queryPanel('instance:node_memory_swap_io_bytes:sum_rate{%(nodeExporterSelector)s}' % $._config, '{{instance}}', legendLink) + + g.panel('Memory Saturation (Swapped Pages)') + + g.queryPanel('instance:node_memory_swap_io_pages:rate{%(nodeExporterSelector)s}' % $._config, '{{instance}}', legendLink) + g.stack + - { yaxes: g.yaxes('Bps') }, + { yaxes: g.yaxes('rps') }, ) ) .addRow( @@ -60,9 +60,9 @@ local g = import 'grafana-builder/grafana.libsonnet'; // 1 second per second doing I/O, normalize by metric cardinality for stacked charts. g.queryPanel(||| ( - instance:node_disk_io_time_seconds:sum_rate1m{%(nodeExporterSelector)s} + instance:node_disk_io_time_seconds:rate1m{%(nodeExporterSelector)s} / ignoring (instance) group_left - count without (instance) (instance:node_disk_io_time_seconds:sum_rate1m{%(nodeExporterSelector)s}) + count without (instance) (instance:node_disk_io_time_seconds:rate1m{%(nodeExporterSelector)s}) ) ||| % $._config, '{{instance}}', legendLink) + g.stack + @@ -72,9 +72,9 @@ local g = import 'grafana-builder/grafana.libsonnet'; g.panel('Disk IO Saturation') + g.queryPanel(||| ( - instance:node_disk_io_time_weighted_seconds:sum_rate1m{%(nodeExporterSelector)s} + instance:node_disk_io_time_weighted_seconds:rate1m{%(nodeExporterSelector)s} / ignoring (instance) group_left - count without (instance) (instance:node_disk_io_time_weighted_seconds:sum_rate1m{%(nodeExporterSelector)s}) + count without (instance) (instance:node_disk_io_time_weighted_seconds:rate1m{%(nodeExporterSelector)s}) ) ||| % $._config, '{{instance}}', legendLink) + g.stack + @@ -87,8 +87,8 @@ local g = import 'grafana-builder/grafana.libsonnet'; g.panel('Net Utilisation (Bytes Receive/Transmit)') + g.queryPanel( [ - 'instance:node_network_receive_bytes:sum_rate1m{%(nodeExporterSelector)s}' % $._config, - '-instance:node_network_transmit_bytes:sum_rate1m{%(nodeExporterSelector)s}' % $._config, + 'instance:node_network_receive_bytes:rate1m{%(nodeExporterSelector)s}' % $._config, + '-instance:node_network_transmit_bytes:rate1m{%(nodeExporterSelector)s}' % $._config, ], ['{{instance}} Receive', '{{instance}} Transmit'], legendLink, @@ -100,8 +100,8 @@ local g = import 'grafana-builder/grafana.libsonnet'; g.panel('Net Saturation (Drops Receive/Transmit)') + g.queryPanel( [ - 'instance:node_network_receive_drop:sum_rate1m{%(nodeExporterSelector)s}' % $._config, - '-instance:node_network_transmit_drop:sum_rate1m{%(nodeExporterSelector)s}' % $._config, + 'instance:node_network_receive_drop:rate1m{%(nodeExporterSelector)s}' % $._config, + '-instance:node_network_transmit_drop:rate1m{%(nodeExporterSelector)s}' % $._config, ], ['{{instance}} Receive', '{{instance}} Transmit'], legendLink, @@ -141,7 +141,7 @@ local g = import 'grafana-builder/grafana.libsonnet'; g.row('CPU') .addPanel( g.panel('CPU Utilisation') + - g.queryPanel('instance:node_cpu_utilisation:avg_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Utilisation') + + g.queryPanel('instance:node_cpu_utilisation:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Utilisation') + { yaxes: g.yaxes('percentunit') }, ) .addPanel( @@ -167,12 +167,12 @@ local g = import 'grafana-builder/grafana.libsonnet'; g.row('Disk') .addPanel( g.panel('Disk IO Utilisation') + - g.queryPanel('instance:node_disk_io_time_seconds:sum_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Utilisation') + + g.queryPanel('instance:node_disk_io_time_seconds:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Utilisation') + { yaxes: g.yaxes('percentunit') }, ) .addPanel( g.panel('Disk IO Saturation') + - g.queryPanel('instance:node_disk_io_time_weighted_seconds:sum_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Saturation') + + g.queryPanel('instance:node_disk_io_time_weighted_seconds:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, 'Saturation') + { yaxes: g.yaxes('percentunit') }, ) ) @@ -182,8 +182,8 @@ local g = import 'grafana-builder/grafana.libsonnet'; g.panel('Net Utilisation (Bytes Receive/Transmit)') + g.queryPanel( [ - 'instance:node_network_receive_bytes:sum_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, - '-instance:node_network_transmit_bytes:sum_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, + 'instance:node_network_receive_bytes:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, + '-instance:node_network_transmit_bytes:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, ], ['Receive', 'Transmit'], ) + @@ -193,8 +193,8 @@ local g = import 'grafana-builder/grafana.libsonnet'; g.panel('Net Saturation (Drops Receive/Transmit)') + g.queryPanel( [ - 'instance:node_network_receive_drop:sum_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, - '-instance:node_network_transmit_drop:sum_rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, + 'instance:node_network_receive_drop:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, + '-instance:node_network_transmit_drop:rate1m{%(nodeExporterSelector)s, instance="$instance"}' % $._config, ], ['Receive drops', 'Transmit drops'], ) + diff --git a/docs/node-mixin/rules/rules.libsonnet b/docs/node-mixin/rules/rules.libsonnet index d8c0faed..ad1b7171 100644 --- a/docs/node-mixin/rules/rules.libsonnet +++ b/docs/node-mixin/rules/rules.libsonnet @@ -17,7 +17,7 @@ }, { // CPU utilisation is % CPU is not idle. - record: 'instance:node_cpu_utilisation:avg_rate1m', + record: 'instance:node_cpu_utilisation:rate1m', expr: ||| 1 - avg without (cpu, mode) ( rate(node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle"}[1m]) @@ -63,7 +63,7 @@ // Disk utilisation (seconds spent, 1 second rate) // TODO: This should probably not aggregate over all devices but // keep them separate. - record: 'instance:node_disk_io_time_seconds:sum_rate1m', + record: 'instance:node_disk_io_time_seconds:rate1m', expr: ||| sum without (device) ( rate(node_disk_io_time_seconds_total{%(nodeExporterSelector)s, %(diskDeviceSelector)s}[1m]) @@ -74,7 +74,7 @@ // Disk saturation (weighted seconds spent, 1 second rate) // TODO: This should probably not aggregate over all devices but // keep them separate. - record: 'instance:node_disk_io_time_weighted_seconds:sum_rate1m', + record: 'instance:node_disk_io_time_weighted_seconds:rate1m', expr: ||| sum without (device) ( rate(node_disk_io_time_weighted_seconds_total{%(nodeExporterSelector)s, %(diskDeviceSelector)s}[1m]) @@ -84,7 +84,7 @@ // TODO: For the following rules, consider configurable filtering to exclude more network // device names than just "lo". { - record: 'instance:node_network_receive_bytes:sum_rate1m', + record: 'instance:node_network_receive_bytes:rate1m', expr: ||| sum without (device) ( rate(node_network_receive_bytes_total{%(nodeExporterSelector)s, device!="lo"}[1m]) @@ -92,7 +92,7 @@ ||| % $._config, }, { - record: 'instance:node_network_transmit_bytes:sum_rate1m', + record: 'instance:node_network_transmit_bytes:rate1m', expr: ||| sum without (device) ( rate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, device!="lo"}[1m]) @@ -101,7 +101,7 @@ }, // TODO: Find out if those drops ever happen on modern switched networks. { - record: 'instance:node_network_receive_drop:sum_rate1m', + record: 'instance:node_network_receive_drop:rate1m', expr: ||| sum without (device) ( rate(node_network_receive_drop_total{%(nodeExporterSelector)s, device!="lo"}[1m]) @@ -109,7 +109,7 @@ ||| % $._config, }, { - record: 'instance:node_network_transmit_drop:sum_rate1m', + record: 'instance:node_network_transmit_drop:rate1m', expr: ||| sum without (device) ( rate(node_network_transmit_drop_total{%(nodeExporterSelector)s, device!="lo"}[1m])