From ed7823703623e03190c963e829d38963623a35a6 Mon Sep 17 00:00:00 2001 From: Sergiusz Urbaniak Date: Thu, 12 Sep 2019 13:55:12 +0200 Subject: [PATCH 1/2] node-mixin: fix query in Disk Space Utilisation dashboard Signed-off-by: Sergiusz Urbaniak --- docs/node-mixin/dashboards/use.libsonnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/node-mixin/dashboards/use.libsonnet b/docs/node-mixin/dashboards/use.libsonnet index da66427b..8463ab95 100644 --- a/docs/node-mixin/dashboards/use.libsonnet +++ b/docs/node-mixin/dashboards/use.libsonnet @@ -280,9 +280,9 @@ local g = import 'grafana-builder/grafana.libsonnet'; g.queryPanel(||| 1 - ( - max without (mountpoint, fstype) (node_filesystem_avail_bytes{%(nodeExporterSelector)s, %(fsSelector)s, instance="$instance"}}) + max without (mountpoint, fstype) (node_filesystem_avail_bytes{%(nodeExporterSelector)s, %(fsSelector)s, instance="$instance"}) / - max without (mountpoint, fstype) (node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s, instance="$instance"}}) + max without (mountpoint, fstype) (node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s, instance="$instance"}) ) ||| % $._config, '{{device}}') + { From f4417b209a6fd7520d4488ec1d4c632d077ae0aa Mon Sep 17 00:00:00 2001 From: Sergiusz Urbaniak Date: Thu, 12 Sep 2019 13:57:19 +0200 Subject: [PATCH 2/2] node-mixin: fix configuration for unset fsSelector/diskDeviceSelector As per https://github.com/prometheus/node_exporter/pull/1429#discussion_r304210103 we want to fetch all devices and all fs types. Currently, this is done by setting empty string which breaks most queries which rely on it. This fixes it by setting the appropriate selector instead of empty string. Signed-off-by: Sergiusz Urbaniak --- docs/node-mixin/config.libsonnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/node-mixin/config.libsonnet b/docs/node-mixin/config.libsonnet index 8cf9860f..b25c3939 100644 --- a/docs/node-mixin/config.libsonnet +++ b/docs/node-mixin/config.libsonnet @@ -9,13 +9,13 @@ // empty, all filesystems are selected. If you have unusual // filesystem you don't want to include in dashboards and // alerting, you can exclude them here, e.g. 'fstype!="tmpfs"'. - fsSelector: '', + fsSelector: 'fstype!=""', // Select the device for disk-related queries. If left empty, all // devices are selected. If you have unusual devices you don't // want to include in dashboards and alerting, you can exclude // them here, e.g. 'device!="tmpfs"'. - diskDeviceSelector: '', + diskDeviceSelector: 'device!=""', // Some of the alerts are meant to fire if a critical failure of a // node is imminent (e.g. the disk is about to run full). In a