Skip to content

Commit 55fa4cc

Browse files
committed
chore: keep irate for node_namespace_pod_ontainer and add rate in as well
1 parent 01f4563 commit 55fa4cc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

rules/apps.libsonnet

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// Reduces cardinality of this timeseries by #cores, which makes it
1414
// more useable in dashboards. Also, allows us to do things like
1515
// quantile_over_time(...) which would otherwise not be possible.
16-
record: 'node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate',
16+
record: 'node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate5m',
1717
expr: |||
1818
sum by (%(clusterLabel)s, namespace, pod, container) (
1919
rate(container_cpu_usage_seconds_total{%(cadvisorSelector)s, image!=""}[5m])
@@ -22,6 +22,16 @@
2222
)
2323
||| % $._config,
2424
},
25+
{
26+
record: 'node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate',
27+
expr: |||
28+
sum by (%(clusterLabel)s, namespace, pod, container) (
29+
irate(container_cpu_usage_seconds_total{%(cadvisorSelector)s, image!=""}[5m])
30+
) * on (%(clusterLabel)s, namespace, pod) group_left(node) topk by (%(clusterLabel)s, namespace, pod) (
31+
1, max by(%(clusterLabel)s, namespace, pod, node) (kube_pod_info{node!=""})
32+
)
33+
||| % $._config,
34+
},
2535
],
2636
},
2737
{

0 commit comments

Comments
 (0)