@@ -75,6 +75,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
75
75
sum by (cluster, namespace, deployment) (
76
76
label_replace(
77
77
kube_deployment_spec_replicas,
78
+ # The question mark in "(.*?)" is used to make it non-greedy, otherwise it
79
+ # always matches everything and the (optional) zone is not removed.
78
80
"deployment", "$1", "deployment", "(.*?)(?:-zone-[a-z])?"
79
81
)
80
82
)
@@ -214,6 +216,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
214
216
node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate,
215
217
"deployment", "$1", "pod", "(.*)-(?:([0-9]+)|([a-z0-9]+)-([a-z0-9]+))"
216
218
),
219
+ # The question mark in "(.*?)" is used to make it non-greedy, otherwise it
220
+ # always matches everything and the (optional) zone is not removed.
217
221
"deployment", "$1", "deployment", "(.*?)(?:-zone-[a-z])?"
218
222
)
219
223
)
@@ -238,6 +242,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
238
242
kube_pod_container_resource_requests_cpu_cores,
239
243
"deployment", "$1", "pod", "(.*)-(?:([0-9]+)|([a-z0-9]+)-([a-z0-9]+))"
240
244
),
245
+ # The question mark in "(.*?)" is used to make it non-greedy, otherwise it
246
+ # always matches everything and the (optional) zone is not removed.
241
247
"deployment", "$1", "deployment", "(.*?)(?:-zone-[a-z])?"
242
248
)
243
249
)
@@ -252,6 +258,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
252
258
kube_pod_container_resource_requests{resource="cpu"},
253
259
"deployment", "$1", "pod", "(.*)-(?:([0-9]+)|([a-z0-9]+)-([a-z0-9]+))"
254
260
),
261
+ # The question mark in "(.*?)" is used to make it non-greedy, otherwise it
262
+ # always matches everything and the (optional) zone is not removed.
255
263
"deployment", "$1", "deployment", "(.*?)(?:-zone-[a-z])?"
256
264
)
257
265
)
@@ -287,6 +295,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
287
295
container_memory_usage_bytes,
288
296
"deployment", "$1", "pod", "(.*)-(?:([0-9]+)|([a-z0-9]+)-([a-z0-9]+))"
289
297
),
298
+ # The question mark in "(.*?)" is used to make it non-greedy, otherwise it
299
+ # always matches everything and the (optional) zone is not removed.
290
300
"deployment", "$1", "deployment", "(.*?)(?:-zone-[a-z])?"
291
301
)
292
302
)
@@ -311,6 +321,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
311
321
kube_pod_container_resource_requests_memory_bytes,
312
322
"deployment", "$1", "pod", "(.*)-(?:([0-9]+)|([a-z0-9]+)-([a-z0-9]+))"
313
323
),
324
+ # The question mark in "(.*?)" is used to make it non-greedy, otherwise it
325
+ # always matches everything and the (optional) zone is not removed.
314
326
"deployment", "$1", "deployment", "(.*?)(?:-zone-[a-z])?"
315
327
)
316
328
)
@@ -325,6 +337,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
325
337
kube_pod_container_resource_requests{resource="memory"},
326
338
"deployment", "$1", "pod", "(.*)-(?:([0-9]+)|([a-z0-9]+)-([a-z0-9]+))"
327
339
),
340
+ # The question mark in "(.*?)" is used to make it non-greedy, otherwise it
341
+ # always matches everything and the (optional) zone is not removed.
328
342
"deployment", "$1", "deployment", "(.*?)(?:-zone-[a-z])?"
329
343
)
330
344
)
0 commit comments