@@ -145,8 +145,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
145145 containerCPUUsagePanel(title, containerName)::
146146 $.panel(title) +
147147 $.queryPanel([
148- 'sum by(%s) (rate(container_cpu_usage_seconds_total{%s,container="%s"}[$__rate_interval]))' % [$._config.per_instance_label, $.namespaceMatcher(), containerName],
149- 'min(container_spec_cpu_quota{%s,container="%s"} / container_spec_cpu_period{%s,container="%s"})' % [$.namespaceMatcher(), containerName, $.namespaceMatcher(), containerName],
148+ 'sum by(%s) (rate(container_cpu_usage_seconds_total{%s,container=~ "%s"}[$__rate_interval]))' % [$._config.per_instance_label, $.namespaceMatcher(), containerName],
149+ 'min(container_spec_cpu_quota{%s,container=~ "%s"} / container_spec_cpu_period{%s,container=~ "%s"})' % [$.namespaceMatcher(), containerName, $.namespaceMatcher(), containerName],
150150 ], ['{{%s}}' % $._config.per_instance_label, 'limit' ]) +
151151 {
152152 seriesOverrides: [
@@ -164,8 +164,8 @@ local utils = import 'mixin-utils/utils.libsonnet';
164164 $.queryPanel([
165165 // We use "max" instead of "sum" otherwise during a rolling update of a statefulset we will end up
166166 // summing the memory of the old instance/pod (whose metric will be stale for 5m) to the new instance/pod.
167- 'max by(%s) (container_memory_working_set_bytes{%s,container="%s"})' % [$._config.per_instance_label, $.namespaceMatcher(), containerName],
168- 'min(container_spec_memory_limit_bytes{%s,container="%s"} > 0)' % [$.namespaceMatcher(), containerName],
167+ 'max by(%s) (container_memory_working_set_bytes{%s,container=~ "%s"})' % [$._config.per_instance_label, $.namespaceMatcher(), containerName],
168+ 'min(container_spec_memory_limit_bytes{%s,container=~ "%s"} > 0)' % [$.namespaceMatcher(), containerName],
169169 ], ['{{%s}}' % $._config.per_instance_label, 'limit' ]) +
170170 {
171171 seriesOverrides: [
0 commit comments