From ffcb98dd43293690dd2e4ea85a5fda795274d1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Mon, 11 Jan 2021 10:55:25 +0100 Subject: [PATCH] Add missing node:node_memory_bytes_available:sum prometheus recording rule --- deploy/helm/sumologic/upgrade-2.0.0.sh | 11 +++++++++++ deploy/helm/sumologic/values.yaml | 11 +++++++++++ .../static/prometheus_operator_valid.output.yaml | 11 +++++++++++ .../static/prometheus_service_monitors.output.yaml | 11 +++++++++++ .../static/prometheus_whole_config.output.yaml | 11 +++++++++++ 5 files changed, 55 insertions(+) diff --git a/deploy/helm/sumologic/upgrade-2.0.0.sh b/deploy/helm/sumologic/upgrade-2.0.0.sh index eef512ed41..f7593a5f77 100755 --- a/deploy/helm/sumologic/upgrade-2.0.0.sh +++ b/deploy/helm/sumologic/upgrade-2.0.0.sh @@ -357,6 +357,17 @@ function add_prometheus_pre_1_14_recording_rules() { / sum(node_memory_MemTotal_bytes{job="node-exporter"}) record: ':node_memory_utilisation:' + - expr: |- + sum by (node) ( + ( + node_memory_MemFree_bytes{job="node-exporter"} + + node_memory_Cached_bytes{job="node-exporter"} + + node_memory_Buffers_bytes{job="node-exporter"} + ) + * on (namespace, pod) group_left(node) + node_namespace_pod:kube_pod_info: + ) + record: node:node_memory_bytes_available:sum - expr: |- (node:node_memory_bytes_total:sum - node:node_memory_bytes_available:sum) / diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index a4cd07adb2..22fd436490 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -959,6 +959,17 @@ kube-prometheus-stack: / sum(node_memory_MemTotal_bytes{job="node-exporter"}) record: ':node_memory_utilisation:' + - expr: |- + sum by (node) ( + ( + node_memory_MemFree_bytes{job="node-exporter"} + + node_memory_Cached_bytes{job="node-exporter"} + + node_memory_Buffers_bytes{job="node-exporter"} + ) + * on (namespace, pod) group_left(node) + node_namespace_pod:kube_pod_info: + ) + record: node:node_memory_bytes_available:sum - expr: |- (node:node_memory_bytes_total:sum - node:node_memory_bytes_available:sum) / diff --git a/tests/upgrade_v2_script/static/prometheus_operator_valid.output.yaml b/tests/upgrade_v2_script/static/prometheus_operator_valid.output.yaml index b32e58c56b..ed960ff71c 100644 --- a/tests/upgrade_v2_script/static/prometheus_operator_valid.output.yaml +++ b/tests/upgrade_v2_script/static/prometheus_operator_valid.output.yaml @@ -68,6 +68,17 @@ kube-prometheus-stack: / sum(node_memory_MemTotal_bytes{job="node-exporter"}) record: ':node_memory_utilisation:' + - expr: |- + sum by (node) ( + ( + node_memory_MemFree_bytes{job="node-exporter"} + + node_memory_Cached_bytes{job="node-exporter"} + + node_memory_Buffers_bytes{job="node-exporter"} + ) + * on (namespace, pod) group_left(node) + node_namespace_pod:kube_pod_info: + ) + record: node:node_memory_bytes_available:sum - expr: |- (node:node_memory_bytes_total:sum - node:node_memory_bytes_available:sum) / diff --git a/tests/upgrade_v2_script/static/prometheus_service_monitors.output.yaml b/tests/upgrade_v2_script/static/prometheus_service_monitors.output.yaml index 2adc1b669c..3288441d69 100644 --- a/tests/upgrade_v2_script/static/prometheus_service_monitors.output.yaml +++ b/tests/upgrade_v2_script/static/prometheus_service_monitors.output.yaml @@ -106,6 +106,17 @@ kube-prometheus-stack: / sum(node_memory_MemTotal_bytes{job="node-exporter"}) record: ':node_memory_utilisation:' + - expr: |- + sum by (node) ( + ( + node_memory_MemFree_bytes{job="node-exporter"} + + node_memory_Cached_bytes{job="node-exporter"} + + node_memory_Buffers_bytes{job="node-exporter"} + ) + * on (namespace, pod) group_left(node) + node_namespace_pod:kube_pod_info: + ) + record: node:node_memory_bytes_available:sum - expr: |- (node:node_memory_bytes_total:sum - node:node_memory_bytes_available:sum) / diff --git a/tests/upgrade_v2_script/static/prometheus_whole_config.output.yaml b/tests/upgrade_v2_script/static/prometheus_whole_config.output.yaml index b0e2f1f1b3..dd376282a9 100644 --- a/tests/upgrade_v2_script/static/prometheus_whole_config.output.yaml +++ b/tests/upgrade_v2_script/static/prometheus_whole_config.output.yaml @@ -365,6 +365,17 @@ kube-prometheus-stack: / sum(node_memory_MemTotal_bytes{job="node-exporter"}) record: ':node_memory_utilisation:' + - expr: |- + sum by (node) ( + ( + node_memory_MemFree_bytes{job="node-exporter"} + + node_memory_Cached_bytes{job="node-exporter"} + + node_memory_Buffers_bytes{job="node-exporter"} + ) + * on (namespace, pod) group_left(node) + node_namespace_pod:kube_pod_info: + ) + record: node:node_memory_bytes_available:sum - expr: |- (node:node_memory_bytes_total:sum - node:node_memory_bytes_available:sum) /