From cf5548e682b8487c6fb0b9fa5a84b634747b00ac Mon Sep 17 00:00:00 2001 From: Madhusudhan Reddy Peram <111971409+madhu-reddy-peram@users.noreply.github.com> Date: Fri, 14 Nov 2025 12:46:38 +0000 Subject: [PATCH] Add cluster label to dashbaord panel queries to improve performance --- .../network-usage/cluster-total.libsonnet | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/dashboards/network-usage/cluster-total.libsonnet b/dashboards/network-usage/cluster-total.libsonnet index 7e209cef5..9743ae0e8 100644 --- a/dashboards/network-usage/cluster-total.libsonnet +++ b/dashboards/network-usage/cluster-total.libsonnet @@ -72,7 +72,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config @@ -90,7 +90,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config @@ -107,7 +107,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config) @@ -120,7 +120,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config) @@ -133,7 +133,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config) @@ -146,7 +146,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config) @@ -159,7 +159,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config) @@ -172,7 +172,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config) @@ -185,7 +185,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config) @@ -198,7 +198,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config) @@ -307,7 +307,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config @@ -325,7 +325,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config @@ -343,7 +343,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config @@ -361,7 +361,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config @@ -378,7 +378,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config) @@ -394,7 +394,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config) @@ -410,7 +410,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config) @@ -426,7 +426,7 @@ local var = g.dashboard.variable; * on (%(clusterLabel)s,namespace,pod) group_left () topk by (%(clusterLabel)s,namespace,pod) ( 1, - max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"}) + max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"}) ) ) ||| % $._config)