@@ 27,7 27,7 @@ spec:
datasource='$DS_PROMETHEUS',
).addTarget(
grafana.prometheus.target(
- 'label_replace(rate(container_cpu_usage_seconds_total{' + matchers + '}[$__rate_interval]), "host", "$1", "instance", "([^.]*).*:10250")',
+ 'label_replace(sum by (namespace, pod, container, instance) (rate(container_cpu_usage_seconds_total{' + matchers + '}[$__rate_interval])), "host", "$1", "instance", "([^.]*).*:10250")',
legendFormat='{{pod}}/{{container}}@{{host}}',
)
),
@@ 40,7 40,7 @@ spec:
format='bytes',
).addTarget(
grafana.prometheus.target(
- 'container_memory_usage_bytes{' + matchers + '}',
+ 'sum by (namespace, pod, container) (container_memory_usage_bytes{' + matchers + '})',
legendFormat='{{pod}}/{{container}}',
)
),
@@ 53,7 53,7 @@ spec:
format='bytes',
).addTarget(
grafana.prometheus.target(
- 'container_memory_rss{' + matchers + '}',
+ 'sum by (namespace, pod, container) (container_memory_rss{' + matchers + '})',
legendFormat='{{pod}}/{{container}}',
)
),
@@ 66,7 66,7 @@ spec:
format='bytes',
).addTarget(
grafana.prometheus.target(
- 'container_memory_cache{' + matchers + '}',
+ 'sum by (namespace, pod, container) (container_memory_cache{' + matchers + '})',
legendFormat='{{pod}}/{{container}}',
)
),
@@ 79,7 79,7 @@ spec:
format='Bps',
).addTarget(
grafana.prometheus.target(
- 'rate(container_network_receive_bytes_total{interface="eth0", ' + podMatchers + '}[$__rate_interval])',
+ 'sum by (namespace, pod, container) (rate(container_network_receive_bytes_total{interface="eth0", ' + podMatchers + '}[$__rate_interval]))',
legendFormat='{{pod}}',
)
),
@@ 92,7 92,7 @@ spec:
format='Bps',
).addTarget(
grafana.prometheus.target(
- 'rate(container_network_transmit_bytes_total{interface="eth0", ' + podMatchers + '}[$__rate_interval])',
+ 'sum by (namespace, pod, container) (rate(container_network_transmit_bytes_total{interface="eth0", ' + podMatchers + '}[$__rate_interval]))',
legendFormat='{{pod}}',
)
),