From 45678b5605e0f0e9056c3e4af999132c7afec52f Mon Sep 17 00:00:00 2001 From: Stephen Lang Date: Fri, 27 Oct 2023 18:05:48 +0100 Subject: [PATCH 1/2] Split k8s.rules group into three groups In order to prevent missed deadlines of some rules affecting the entire group, split the k8s.rules group into three groups. Signed-off-by: Stephen Lang --- rules/apps.libsonnet | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rules/apps.libsonnet b/rules/apps.libsonnet index 5399fae98..fc0385125 100644 --- a/rules/apps.libsonnet +++ b/rules/apps.libsonnet @@ -58,6 +58,11 @@ ) ||| % $._config, }, + ], + }, + { + name: 'k8s.rules.container_resource', + rules: [ { record: 'cluster:namespace:pod_memory:active:kube_pod_container_resource_requests', expr: ||| @@ -150,6 +155,11 @@ ) ||| % $._config, }, + ], + }, + { + name: 'k8s.rules.pod_owner', + rules: [ // workload aggregation for deployments { record: 'namespace_workload_pod:kube_pod_owner:relabel', From d1a28fc380bf0133362915e0c0d58844e463183f Mon Sep 17 00:00:00 2001 From: Stephen Lang Date: Fri, 3 Nov 2023 14:25:26 +0000 Subject: [PATCH 2/2] Separate remaining expensive rules --- rules/apps.libsonnet | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/rules/apps.libsonnet b/rules/apps.libsonnet index fc0385125..e24914a37 100644 --- a/rules/apps.libsonnet +++ b/rules/apps.libsonnet @@ -7,7 +7,7 @@ prometheusRules+:: { groups+: [ { - name: 'k8s.rules', + name: 'k8s.rules.container_cpu_usage_seconds_total', rules: [ { // Reduces cardinality of this timeseries by #cores, which makes it @@ -22,6 +22,11 @@ ) ||| % $._config, }, + ], + }, + { + name: 'k8s.rules.container_memory_working_set_bytes', + rules: [ { record: 'node_namespace_pod_container:container_memory_working_set_bytes', expr: ||| @@ -31,6 +36,11 @@ ) ||| % $._config, }, + ], + }, + { + name: 'k8s.rules.container_memory_rss', + rules: [ { record: 'node_namespace_pod_container:container_memory_rss', expr: ||| @@ -40,6 +50,11 @@ ) ||| % $._config, }, + ], + }, + { + name: 'k8s.rules.container_memory_cache', + rules: [ { record: 'node_namespace_pod_container:container_memory_cache', expr: ||| @@ -49,6 +64,11 @@ ) ||| % $._config, }, + ], + }, + { + name: 'k8s.rules.container_memory_swap', + rules: [ { record: 'node_namespace_pod_container:container_memory_swap', expr: |||