Skip to content

Commit 1172d48

Browse files
Add cluster label to dashbaord panel queries to improve performance (#1135)
1 parent 679f866 commit 1172d48

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

dashboards/network-usage/cluster-total.libsonnet

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ local var = g.dashboard.variable;
7272
* on (%(clusterLabel)s,namespace,pod) group_left ()
7373
topk by (%(clusterLabel)s,namespace,pod) (
7474
1,
75-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
75+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
7676
)
7777
)
7878
||| % $._config
@@ -90,7 +90,7 @@ local var = g.dashboard.variable;
9090
* on (%(clusterLabel)s,namespace,pod) group_left ()
9191
topk by (%(clusterLabel)s,namespace,pod) (
9292
1,
93-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
93+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
9494
)
9595
)
9696
||| % $._config
@@ -107,7 +107,7 @@ local var = g.dashboard.variable;
107107
* on (%(clusterLabel)s,namespace,pod) group_left ()
108108
topk by (%(clusterLabel)s,namespace,pod) (
109109
1,
110-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
110+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
111111
)
112112
)
113113
||| % $._config)
@@ -120,7 +120,7 @@ local var = g.dashboard.variable;
120120
* on (%(clusterLabel)s,namespace,pod) group_left ()
121121
topk by (%(clusterLabel)s,namespace,pod) (
122122
1,
123-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
123+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
124124
)
125125
)
126126
||| % $._config)
@@ -133,7 +133,7 @@ local var = g.dashboard.variable;
133133
* on (%(clusterLabel)s,namespace,pod) group_left ()
134134
topk by (%(clusterLabel)s,namespace,pod) (
135135
1,
136-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
136+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
137137
)
138138
)
139139
||| % $._config)
@@ -146,7 +146,7 @@ local var = g.dashboard.variable;
146146
* on (%(clusterLabel)s,namespace,pod) group_left ()
147147
topk by (%(clusterLabel)s,namespace,pod) (
148148
1,
149-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
149+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
150150
)
151151
)
152152
||| % $._config)
@@ -159,7 +159,7 @@ local var = g.dashboard.variable;
159159
* on (%(clusterLabel)s,namespace,pod) group_left ()
160160
topk by (%(clusterLabel)s,namespace,pod) (
161161
1,
162-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
162+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
163163
)
164164
)
165165
||| % $._config)
@@ -172,7 +172,7 @@ local var = g.dashboard.variable;
172172
* on (%(clusterLabel)s,namespace,pod) group_left ()
173173
topk by (%(clusterLabel)s,namespace,pod) (
174174
1,
175-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
175+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
176176
)
177177
)
178178
||| % $._config)
@@ -185,7 +185,7 @@ local var = g.dashboard.variable;
185185
* on (%(clusterLabel)s,namespace,pod) group_left ()
186186
topk by (%(clusterLabel)s,namespace,pod) (
187187
1,
188-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
188+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
189189
)
190190
)
191191
||| % $._config)
@@ -198,7 +198,7 @@ local var = g.dashboard.variable;
198198
* on (%(clusterLabel)s,namespace,pod) group_left ()
199199
topk by (%(clusterLabel)s,namespace,pod) (
200200
1,
201-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
201+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
202202
)
203203
)
204204
||| % $._config)
@@ -307,7 +307,7 @@ local var = g.dashboard.variable;
307307
* on (%(clusterLabel)s,namespace,pod) group_left ()
308308
topk by (%(clusterLabel)s,namespace,pod) (
309309
1,
310-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
310+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
311311
)
312312
)
313313
||| % $._config
@@ -325,7 +325,7 @@ local var = g.dashboard.variable;
325325
* on (%(clusterLabel)s,namespace,pod) group_left ()
326326
topk by (%(clusterLabel)s,namespace,pod) (
327327
1,
328-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
328+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
329329
)
330330
)
331331
||| % $._config
@@ -343,7 +343,7 @@ local var = g.dashboard.variable;
343343
* on (%(clusterLabel)s,namespace,pod) group_left ()
344344
topk by (%(clusterLabel)s,namespace,pod) (
345345
1,
346-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
346+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
347347
)
348348
)
349349
||| % $._config
@@ -361,7 +361,7 @@ local var = g.dashboard.variable;
361361
* on (%(clusterLabel)s,namespace,pod) group_left ()
362362
topk by (%(clusterLabel)s,namespace,pod) (
363363
1,
364-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
364+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
365365
)
366366
)
367367
||| % $._config
@@ -378,7 +378,7 @@ local var = g.dashboard.variable;
378378
* on (%(clusterLabel)s,namespace,pod) group_left ()
379379
topk by (%(clusterLabel)s,namespace,pod) (
380380
1,
381-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
381+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
382382
)
383383
)
384384
||| % $._config)
@@ -394,7 +394,7 @@ local var = g.dashboard.variable;
394394
* on (%(clusterLabel)s,namespace,pod) group_left ()
395395
topk by (%(clusterLabel)s,namespace,pod) (
396396
1,
397-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
397+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
398398
)
399399
)
400400
||| % $._config)
@@ -410,7 +410,7 @@ local var = g.dashboard.variable;
410410
* on (%(clusterLabel)s,namespace,pod) group_left ()
411411
topk by (%(clusterLabel)s,namespace,pod) (
412412
1,
413-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
413+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
414414
)
415415
)
416416
||| % $._config)
@@ -426,7 +426,7 @@ local var = g.dashboard.variable;
426426
* on (%(clusterLabel)s,namespace,pod) group_left ()
427427
topk by (%(clusterLabel)s,namespace,pod) (
428428
1,
429-
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false"})
429+
max by (%(clusterLabel)s,namespace,pod) (kube_pod_info{host_network="false",%(clusterLabel)s="$cluster"})
430430
)
431431
)
432432
||| % $._config)

0 commit comments

Comments
 (0)