From b3b47f2d0702ebc8086df96c127fd5d0bea34868 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Wed, 10 Jul 2019 20:09:01 +0200 Subject: [PATCH] Make selector naming consistent Signed-off-by: beorn7 --- docs/node-mixin/alerts/alerts.libsonnet | 40 ++++++++++++------------- docs/node-mixin/config.libsonnet | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/node-mixin/alerts/alerts.libsonnet b/docs/node-mixin/alerts/alerts.libsonnet index 70060ba5..013a9ee3 100644 --- a/docs/node-mixin/alerts/alerts.libsonnet +++ b/docs/node-mixin/alerts/alerts.libsonnet @@ -8,11 +8,11 @@ alert: 'NodeFilesystemSpaceFillingUp', expr: ||| ( - predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s}[6h], 24*60*60) < 0 + predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s}[6h], 24*60*60) < 0 and - node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} < 0.4 + node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s} < 0.4 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -27,11 +27,11 @@ alert: 'NodeFilesystemSpaceFillingUp', expr: ||| ( - predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s}[6h], 4*60*60) < 0 + predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s}[6h], 4*60*60) < 0 and - node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} < 0.2 + node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s} < 0.2 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -46,9 +46,9 @@ alert: 'NodeFilesystemOutOfSpace', expr: ||| ( - node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} * 100 < 5 + node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s} * 100 < 5 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -63,9 +63,9 @@ alert: 'NodeFilesystemOutOfSpace', expr: ||| ( - node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelectors)s} * 100 < 3 + node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s} * 100 < 3 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -80,11 +80,11 @@ alert: 'NodeFilesystemFilesFillingUp', expr: ||| ( - predict_linear(node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s}[6h], 24*60*60) < 0 + predict_linear(node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s}[6h], 24*60*60) < 0 and - node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelectors)s} < 0.4 + node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelector)s} < 0.4 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -99,11 +99,11 @@ alert: 'NodeFilesystemFilesFillingUp', expr: ||| ( - predict_linear(node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s}[6h], 4*60*60) < 0 + predict_linear(node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s}[6h], 4*60*60) < 0 and - node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelectors)s} < 0.2 + node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelector)s} < 0.2 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -118,9 +118,9 @@ alert: 'NodeFilesystemOutOfFiles', expr: ||| ( - node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelectors)s} * 100 < 5 + node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelector)s} * 100 < 5 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -135,9 +135,9 @@ alert: 'NodeFilesystemOutOfSpace', expr: ||| ( - node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelectors)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelectors)s} * 100 < 3 + node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelector)s} * 100 < 3 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelectors)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 ) ||| % $._config, 'for': '1h', diff --git a/docs/node-mixin/config.libsonnet b/docs/node-mixin/config.libsonnet index 6c5d6f74..5406bdbc 100644 --- a/docs/node-mixin/config.libsonnet +++ b/docs/node-mixin/config.libsonnet @@ -4,7 +4,7 @@ nodeExporterSelector: 'job="node-exporter"', // Mainly extracted because they are repetitive, but also useful to customize. - fsSelectors: 'fstype=~"ext.|xfs",mountpoint!="/var/lib/docker/aufs"', + fsSelector: 'fstype=~"ext.|xfs",mountpoint!="/var/lib/docker/aufs"', grafana_prefix: '', },