From 0c3934bdabcf9f58ac4147e251cde357204ed02e Mon Sep 17 00:00:00 2001 From: Stephan Hesselmann Date: Wed, 3 Jan 2024 11:13:41 +0100 Subject: [PATCH] feat: use container_memory_working_set_bytes (#186) --- .../generated/dashboards/rhacs-central-configmap.yaml | 2 +- .../generated/dashboards/rhacs-central-dashboard.yaml | 2 +- .../dashboards/rhacs-cluster-overview-configmap.yaml | 6 +++--- .../dashboards/rhacs-cluster-overview-dashboard.yaml | 6 +++--- .../rhacs-cluster-resource-adjustment-configmap.yaml | 4 ++-- .../rhacs-cluster-resource-adjustment-dashboard.yaml | 4 ++-- resources/grafana/sources/rhacs-central.json | 2 +- resources/grafana/sources/rhacs-cluster-overview.json | 6 +++--- .../grafana/sources/rhacs-cluster-resource-adjustment.json | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/resources/grafana/generated/dashboards/rhacs-central-configmap.yaml b/resources/grafana/generated/dashboards/rhacs-central-configmap.yaml index 94894b2d..851ffcde 100644 --- a/resources/grafana/generated/dashboards/rhacs-central-configmap.yaml +++ b/resources/grafana/generated/dashboards/rhacs-central-configmap.yaml @@ -741,7 +741,7 @@ data: "datasource": { "uid": "${datasource}" }, - "expr": "sum(container_memory_usage_bytes{namespace=\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"})", + "expr": "sum(container_memory_working_set_bytes{namespace=\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"})", "interval": "", "legendFormat": "Used", "refId": "B" diff --git a/resources/grafana/generated/dashboards/rhacs-central-dashboard.yaml b/resources/grafana/generated/dashboards/rhacs-central-dashboard.yaml index fb012883..271961a5 100644 --- a/resources/grafana/generated/dashboards/rhacs-central-dashboard.yaml +++ b/resources/grafana/generated/dashboards/rhacs-central-dashboard.yaml @@ -741,7 +741,7 @@ spec: "datasource": { "uid": "${datasource}" }, - "expr": "sum(container_memory_usage_bytes{namespace=\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"})", + "expr": "sum(container_memory_working_set_bytes{namespace=\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"})", "interval": "", "legendFormat": "Used", "refId": "B" diff --git a/resources/grafana/generated/dashboards/rhacs-cluster-overview-configmap.yaml b/resources/grafana/generated/dashboards/rhacs-cluster-overview-configmap.yaml index 2c47daab..731156ef 100644 --- a/resources/grafana/generated/dashboards/rhacs-cluster-overview-configmap.yaml +++ b/resources/grafana/generated/dashboards/rhacs-cluster-overview-configmap.yaml @@ -957,7 +957,7 @@ data: "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(container_memory_usage_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace)", + "expr": "sum(container_memory_working_set_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace)", "format": "time_series", "interval": "", "legendFormat": "{{namespace}}", @@ -1400,7 +1400,7 @@ data: }, "editorMode": "code", "exemplar": false, - "expr": "sum(container_memory_usage_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace)", + "expr": "sum(container_memory_working_set_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -1808,7 +1808,7 @@ data: }, "editorMode": "code", "exemplar": false, - "expr": "sum(container_memory_usage_bytes{namespace=~\"rhacs-$instance_id\", container=\"scanner\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"scanner\", job=~\"kubelet\"}) by (namespace)", + "expr": "sum(container_memory_working_set_bytes{namespace=~\"rhacs-$instance_id\", container=\"scanner\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"scanner\", job=~\"kubelet\"}) by (namespace)", "format": "table", "instant": true, "legendFormat": "__auto", diff --git a/resources/grafana/generated/dashboards/rhacs-cluster-overview-dashboard.yaml b/resources/grafana/generated/dashboards/rhacs-cluster-overview-dashboard.yaml index e6c0915f..e95bf615 100644 --- a/resources/grafana/generated/dashboards/rhacs-cluster-overview-dashboard.yaml +++ b/resources/grafana/generated/dashboards/rhacs-cluster-overview-dashboard.yaml @@ -957,7 +957,7 @@ spec: "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(container_memory_usage_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace)", + "expr": "sum(container_memory_working_set_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace)", "format": "time_series", "interval": "", "legendFormat": "{{namespace}}", @@ -1400,7 +1400,7 @@ spec: }, "editorMode": "code", "exemplar": false, - "expr": "sum(container_memory_usage_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace)", + "expr": "sum(container_memory_working_set_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -1808,7 +1808,7 @@ spec: }, "editorMode": "code", "exemplar": false, - "expr": "sum(container_memory_usage_bytes{namespace=~\"rhacs-$instance_id\", container=\"scanner\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"scanner\", job=~\"kubelet\"}) by (namespace)", + "expr": "sum(container_memory_working_set_bytes{namespace=~\"rhacs-$instance_id\", container=\"scanner\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"scanner\", job=~\"kubelet\"}) by (namespace)", "format": "table", "instant": true, "legendFormat": "__auto", diff --git a/resources/grafana/generated/dashboards/rhacs-cluster-resource-adjustment-configmap.yaml b/resources/grafana/generated/dashboards/rhacs-cluster-resource-adjustment-configmap.yaml index cb0e1ba5..fc696447 100644 --- a/resources/grafana/generated/dashboards/rhacs-cluster-resource-adjustment-configmap.yaml +++ b/resources/grafana/generated/dashboards/rhacs-cluster-resource-adjustment-configmap.yaml @@ -3177,7 +3177,7 @@ data: }, "editorMode": "code", "exemplar": false, - "expr": "sum(container_memory_usage_bytes{container!=\"\",container!=\"POD\",job=\"kubelet\"} * on (node) group_left() kube_node_role{role=\"acscs-worker\"} * on (namespace, pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel) by (workload)", + "expr": "sum(container_memory_working_set_bytes{container!=\"\",container!=\"POD\",job=\"kubelet\"} * on (node) group_left() kube_node_role{role=\"acscs-worker\"} * on (namespace, pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel) by (workload)", "format": "table", "hide": false, "instant": true, @@ -3426,7 +3426,7 @@ data: }, "editorMode": "code", "exemplar": false, - "expr": "sum(container_memory_usage_bytes{container!=\"\",container!=\"POD\",job=\"kubelet\"} * on (node) group_left() kube_node_role{role=\"acscs-infra\"} * on (namespace, pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel) by (workload)", + "expr": "sum(container_memory_working_set_bytes{container!=\"\",container!=\"POD\",job=\"kubelet\"} * on (node) group_left() kube_node_role{role=\"acscs-infra\"} * on (namespace, pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel) by (workload)", "format": "table", "hide": false, "instant": true, diff --git a/resources/grafana/generated/dashboards/rhacs-cluster-resource-adjustment-dashboard.yaml b/resources/grafana/generated/dashboards/rhacs-cluster-resource-adjustment-dashboard.yaml index bbbe165a..f5be0aed 100644 --- a/resources/grafana/generated/dashboards/rhacs-cluster-resource-adjustment-dashboard.yaml +++ b/resources/grafana/generated/dashboards/rhacs-cluster-resource-adjustment-dashboard.yaml @@ -3177,7 +3177,7 @@ spec: }, "editorMode": "code", "exemplar": false, - "expr": "sum(container_memory_usage_bytes{container!=\"\",container!=\"POD\",job=\"kubelet\"} * on (node) group_left() kube_node_role{role=\"acscs-worker\"} * on (namespace, pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel) by (workload)", + "expr": "sum(container_memory_working_set_bytes{container!=\"\",container!=\"POD\",job=\"kubelet\"} * on (node) group_left() kube_node_role{role=\"acscs-worker\"} * on (namespace, pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel) by (workload)", "format": "table", "hide": false, "instant": true, @@ -3426,7 +3426,7 @@ spec: }, "editorMode": "code", "exemplar": false, - "expr": "sum(container_memory_usage_bytes{container!=\"\",container!=\"POD\",job=\"kubelet\"} * on (node) group_left() kube_node_role{role=\"acscs-infra\"} * on (namespace, pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel) by (workload)", + "expr": "sum(container_memory_working_set_bytes{container!=\"\",container!=\"POD\",job=\"kubelet\"} * on (node) group_left() kube_node_role{role=\"acscs-infra\"} * on (namespace, pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel) by (workload)", "format": "table", "hide": false, "instant": true, diff --git a/resources/grafana/sources/rhacs-central.json b/resources/grafana/sources/rhacs-central.json index 9975073a..8951d8c9 100644 --- a/resources/grafana/sources/rhacs-central.json +++ b/resources/grafana/sources/rhacs-central.json @@ -730,7 +730,7 @@ "datasource": { "uid": "${datasource}" }, - "expr": "sum(container_memory_usage_bytes{namespace=\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"})", + "expr": "sum(container_memory_working_set_bytes{namespace=\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"})", "interval": "", "legendFormat": "Used", "refId": "B" diff --git a/resources/grafana/sources/rhacs-cluster-overview.json b/resources/grafana/sources/rhacs-cluster-overview.json index 4cb7ccba..b3c85539 100644 --- a/resources/grafana/sources/rhacs-cluster-overview.json +++ b/resources/grafana/sources/rhacs-cluster-overview.json @@ -946,7 +946,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(container_memory_usage_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace)", + "expr": "sum(container_memory_working_set_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace)", "format": "time_series", "interval": "", "legendFormat": "{{namespace}}", @@ -1389,7 +1389,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sum(container_memory_usage_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace)", + "expr": "sum(container_memory_working_set_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"central\", job=~\"kubelet\"}) by (namespace)", "format": "table", "instant": true, "legendFormat": "__auto", @@ -1797,7 +1797,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sum(container_memory_usage_bytes{namespace=~\"rhacs-$instance_id\", container=\"scanner\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"scanner\", job=~\"kubelet\"}) by (namespace)", + "expr": "sum(container_memory_working_set_bytes{namespace=~\"rhacs-$instance_id\", container=\"scanner\", job=~\"kubelet\"}) by (namespace) / sum(container_spec_memory_limit_bytes{namespace=~\"rhacs-$instance_id\", container=\"scanner\", job=~\"kubelet\"}) by (namespace)", "format": "table", "instant": true, "legendFormat": "__auto", diff --git a/resources/grafana/sources/rhacs-cluster-resource-adjustment.json b/resources/grafana/sources/rhacs-cluster-resource-adjustment.json index 8751dabf..e23941c6 100644 --- a/resources/grafana/sources/rhacs-cluster-resource-adjustment.json +++ b/resources/grafana/sources/rhacs-cluster-resource-adjustment.json @@ -3166,7 +3166,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sum(container_memory_usage_bytes{container!=\"\",container!=\"POD\",job=\"kubelet\"} * on (node) group_left() kube_node_role{role=\"acscs-worker\"} * on (namespace, pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel) by (workload)", + "expr": "sum(container_memory_working_set_bytes{container!=\"\",container!=\"POD\",job=\"kubelet\"} * on (node) group_left() kube_node_role{role=\"acscs-worker\"} * on (namespace, pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel) by (workload)", "format": "table", "hide": false, "instant": true, @@ -3415,7 +3415,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sum(container_memory_usage_bytes{container!=\"\",container!=\"POD\",job=\"kubelet\"} * on (node) group_left() kube_node_role{role=\"acscs-infra\"} * on (namespace, pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel) by (workload)", + "expr": "sum(container_memory_working_set_bytes{container!=\"\",container!=\"POD\",job=\"kubelet\"} * on (node) group_left() kube_node_role{role=\"acscs-infra\"} * on (namespace, pod) group_left(workload) namespace_workload_pod:kube_pod_owner:relabel) by (workload)", "format": "table", "hide": false, "instant": true,