From 4f312c5e21cbe87fe65cf898eef960fa15e6b1c5 Mon Sep 17 00:00:00 2001 From: danushadhitya <70574266+danushadhitya@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:04:21 -0700 Subject: [PATCH 1/3] Update multi-cluster.libsonnet Since, most of the selectors for the dashboard are overriden by custom variables. File in path: dashboards/resources/multi-cluster.libsonnet does have the tranformation "byField" Selector hardcoded as "cluster" but whereas all other clustername selectors use the override variable "%(clusterLabel)s". Apparently, this fork contains the change of converting hard-coded selector to over-ride selector. --- dashboards/resources/multi-cluster.libsonnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboards/resources/multi-cluster.libsonnet b/dashboards/resources/multi-cluster.libsonnet index 0043f1613..8782a622b 100644 --- a/dashboards/resources/multi-cluster.libsonnet +++ b/dashboards/resources/multi-cluster.libsonnet @@ -126,7 +126,7 @@ local var = g.dashboard.variable; + g.panel.table.queryOptions.withTransformations([ g.panel.table.queryOptions.transformation.withId('joinByField') + g.panel.table.queryOptions.transformation.withOptions({ - byField: 'cluster', + byField: '%(clusterLabel)s', mode: 'outer', }), @@ -225,7 +225,7 @@ local var = g.dashboard.variable; + g.panel.table.queryOptions.withTransformations([ g.panel.table.queryOptions.transformation.withId('joinByField') + g.panel.table.queryOptions.transformation.withOptions({ - byField: 'cluster', + byField: '%(clusterLabel)s', mode: 'outer', }), From 8ecd12a457b8a87b53f3fa7f3ec1a09fd32a0456 Mon Sep 17 00:00:00 2001 From: danushadhitya <70574266+danushadhitya@users.noreply.github.com> Date: Mon, 19 Aug 2024 23:19:13 -0700 Subject: [PATCH 2/3] fix: multi-cluster.libsonnet to support grafana dashboard join "byField" Selector with interpolation error fix --- dashboards/resources/multi-cluster.libsonnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboards/resources/multi-cluster.libsonnet b/dashboards/resources/multi-cluster.libsonnet index 8782a622b..a815ed4c0 100644 --- a/dashboards/resources/multi-cluster.libsonnet +++ b/dashboards/resources/multi-cluster.libsonnet @@ -126,7 +126,7 @@ local var = g.dashboard.variable; + g.panel.table.queryOptions.withTransformations([ g.panel.table.queryOptions.transformation.withId('joinByField') + g.panel.table.queryOptions.transformation.withOptions({ - byField: '%(clusterLabel)s', + byField: std.format('%s', $._config.clusterlabel), mode: 'outer', }), @@ -225,7 +225,7 @@ local var = g.dashboard.variable; + g.panel.table.queryOptions.withTransformations([ g.panel.table.queryOptions.transformation.withId('joinByField') + g.panel.table.queryOptions.transformation.withOptions({ - byField: '%(clusterLabel)s', + byField: std.format('%s', $._config.clusterlabel), mode: 'outer', }), From 47448f92488d0b72829cbd96ec0ec94d28a09941 Mon Sep 17 00:00:00 2001 From: danushadhitya <70574266+danushadhitya@users.noreply.github.com> Date: Wed, 21 Aug 2024 10:57:57 -0700 Subject: [PATCH 3/3] Fix upper case issue --- dashboards/resources/multi-cluster.libsonnet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboards/resources/multi-cluster.libsonnet b/dashboards/resources/multi-cluster.libsonnet index a815ed4c0..2b16e8e80 100644 --- a/dashboards/resources/multi-cluster.libsonnet +++ b/dashboards/resources/multi-cluster.libsonnet @@ -126,7 +126,7 @@ local var = g.dashboard.variable; + g.panel.table.queryOptions.withTransformations([ g.panel.table.queryOptions.transformation.withId('joinByField') + g.panel.table.queryOptions.transformation.withOptions({ - byField: std.format('%s', $._config.clusterlabel), + byField: std.format('%s', $._config.clusterLabel), mode: 'outer', }), @@ -225,7 +225,7 @@ local var = g.dashboard.variable; + g.panel.table.queryOptions.withTransformations([ g.panel.table.queryOptions.transformation.withId('joinByField') + g.panel.table.queryOptions.transformation.withOptions({ - byField: std.format('%s', $._config.clusterlabel), + byField: std.format('%s', $._config.clusterLabel), mode: 'outer', }),