From c7658621b9ed280bc2dc7298fbd4ed6e8348d70e Mon Sep 17 00:00:00 2001 From: QuentinBisson Date: Wed, 24 Jul 2024 15:40:06 +0200 Subject: [PATCH] enhance(mixins): Allow hiding useless rows in loki-operational Signed-off-by: QuentinBisson --- production/loki-mixin/config.libsonnet | 19 +++++++++++++++++++ .../dashboards/loki-operational.libsonnet | 11 +++++++++-- production/loki-mixin/mixin.libsonnet | 2 ++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/production/loki-mixin/config.libsonnet b/production/loki-mixin/config.libsonnet index bdf5c9de5b58a..3b2c899dd784c 100644 --- a/production/loki-mixin/config.libsonnet +++ b/production/loki-mixin/config.libsonnet @@ -20,6 +20,25 @@ enabled: true, }, + operational: { + // Whether or not to include memcached in the operational dashboard + memcached: true, + // Whether or not to include consul in the operational dashboard + consul: true, + // Whether or not to include big table in the operational dashboard + bigTable: true, + // Whether or not to include dynamo in the operational dashboard + dynamo: true, + // Whether or not to include gcs in the operational dashboard + gcs: true, + // Whether or not to include s3 in the operational dashboard + s3: true, + // Whether or not to include azure blob in the operational dashboard + azureBlob: true, + // Whether or not to include bolt db in the operational dashboard + boltDB: true, + }, + // Enable TSDB specific dashboards tsdb: true, diff --git a/production/loki-mixin/dashboards/loki-operational.libsonnet b/production/loki-mixin/dashboards/loki-operational.libsonnet index c6944487ce8e7..0f29e9b01330b 100644 --- a/production/loki-mixin/dashboards/loki-operational.libsonnet +++ b/production/loki-mixin/dashboards/loki-operational.libsonnet @@ -14,8 +14,15 @@ local utils = import 'mixin-utils/utils.libsonnet'; hiddenRows:: [ 'Cassandra', - ] + if !$._config.ssd.enabled then [] else [ - 'Ingester', + if $._config.ssd.enabled then 'Ingester', + if !$._config.operational.memcached then 'Memcached', + if !$._config.operational.consul then 'Consul', + if !$._config.operational.bigTable then 'Big Table', + if !$._config.operational.dynamo then 'Dynamo', + if !$._config.operational.gcs then 'GCS', + if !$._config.operational.s3 then 'S3', + if !$._config.operational.azureBlob then 'Azure Blob', + if !$._config.operational.boltDB then 'BoltDB Shipper', ], hiddenPanels:: if $._config.promtail.enabled then [] else [ diff --git a/production/loki-mixin/mixin.libsonnet b/production/loki-mixin/mixin.libsonnet index 7e21657b2e61d..53584824c6331 100644 --- a/production/loki-mixin/mixin.libsonnet +++ b/production/loki-mixin/mixin.libsonnet @@ -2,4 +2,6 @@ (import 'alerts.libsonnet') + (import 'recording_rules.libsonnet') + { grafanaDashboardFolder: 'Loki', + // Without this, configs is not taken into account + _config+:: {}, }