From 7fc5c6045aeb1d615296f6daca1f7a77554d5efb Mon Sep 17 00:00:00 2001 From: Johannes 'fish' Ziemke Date: Tue, 20 Jul 2021 17:39:52 +0200 Subject: [PATCH] Read config from $ Signed-off-by: Johannes 'fish' Ziemke --- docs/node-mixin/dashboards/use.libsonnet | 27 ++++++++++++------------ 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/docs/node-mixin/dashboards/use.libsonnet b/docs/node-mixin/dashboards/use.libsonnet index 3a8959d6..01219472 100644 --- a/docs/node-mixin/dashboards/use.libsonnet +++ b/docs/node-mixin/dashboards/use.libsonnet @@ -22,18 +22,6 @@ local datasourceTemplate = { type: 'datasource', }; -local clusterTemplate = - template.new( - name='cluster', - datasource='$datasource', - query='label_values(node_time_seconds, %s)' % c._config.clusterLabel, - current='', - hide=if c._config.showMultiCluster then '' else '2', - refresh=2, - includeAll=false, - sort=1 - ); - local CPUUtilisation = graphPanel.new( 'CPU Utilisation', @@ -142,6 +130,17 @@ local diskSpaceUtilisation = ) { tooltip+: { sort: 2 } }; { + _clusterTemplate:: template.new( + name='cluster', + datasource='$datasource', + query='label_values(node_time_seconds, %s)' % $._config.clusterLabel, + current='', + hide=if $._config.showMultiCluster then '' else '2', + refresh=2, + includeAll=false, + sort=1 + ), + grafanaDashboards+:: { 'node-rsrc-use.json': @@ -154,7 +153,7 @@ local diskSpaceUtilisation = graphTooltip='shared_crosshair' ) .addTemplate(datasourceTemplate) - .addTemplate(clusterTemplate) + .addTemplate($._clusterTemplate) .addTemplate( template.new( 'instance', @@ -219,7 +218,7 @@ local diskSpaceUtilisation = graphTooltip='shared_crosshair' ) .addTemplate(datasourceTemplate) - .addTemplate(clusterTemplate) + .addTemplate($._clusterTemplate) .addRow( row.new('CPU') .addPanel(