From 46b42a750edea9c2712719293f8f4eac680617f2 Mon Sep 17 00:00:00 2001 From: Quentin Bisson Date: Mon, 16 Oct 2023 22:40:31 +0200 Subject: [PATCH] Fix cluster query Fix mixin cluster parameter otherwise generated mixins looks like this: ```json {"type":"prometheus","uid":"${datasource}"},"label":"cluster","name":"job","query":"label_values(etcd_server_has_leader{job=~\".*etcd.*\"}, job)","refresh":2,"type":"query"}]},"time":{"from":"now-15m","to":"now"},"timezone": "`}}{{ .Values.grafana.defaultDashboardsTimezone }}{{`","title":"etcd","uid":"c2f4e12cdf69feb95caa41a5a1b423d9"}`}} ``` where name is job when the variable name used in dashboard queries is cluster. Signed-off-by: QuentinBisson --- contrib/mixin/dashboards/variables.libsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/mixin/dashboards/variables.libsonnet b/contrib/mixin/dashboards/variables.libsonnet index d54a24b17..7dafc63a9 100644 --- a/contrib/mixin/dashboards/variables.libsonnet +++ b/contrib/mixin/dashboards/variables.libsonnet @@ -9,7 +9,7 @@ function(config) { + var.datasource.generalOptions.withLabel('Data Source'), cluster: - var.query.new(config.clusterLabel) + var.query.new('cluster') + var.query.generalOptions.withLabel('cluster') + var.query.withDatasourceFromVariable(self.datasource) + { refresh: config.dashboard_var_refresh }