From bcab8756ca3b017595d6a458350fa103db12fcb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Petrov?= Date: Wed, 14 Feb 2024 18:55:39 +0100 Subject: [PATCH] refactor the metrics --- .../rhacs-cluster-overview-configmap.yaml | 121 ++++++++---------- .../rhacs-cluster-overview-dashboard.yaml | 121 ++++++++---------- .../sources/rhacs-cluster-overview.json | 121 ++++++++---------- 3 files changed, 153 insertions(+), 210 deletions(-) diff --git a/resources/grafana/generated/dashboards/rhacs-cluster-overview-configmap.yaml b/resources/grafana/generated/dashboards/rhacs-cluster-overview-configmap.yaml index 9ec615bb..e46ef306 100644 --- a/resources/grafana/generated/dashboards/rhacs-cluster-overview-configmap.yaml +++ b/resources/grafana/generated/dashboards/rhacs-cluster-overview-configmap.yaml @@ -972,22 +972,18 @@ data: }, { "datasource": { - "type": "datasource", - "uid": "-- Mixed --" + "uid": "-- Mixed --", + "type": "datasource" }, - "description": "", "fieldConfig": { "defaults": { - "color": { - "mode": "thresholds" - }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, - "filterable": true, "inspect": false, + "filterable": true, "minWidth": 200 }, "mappings": [], @@ -995,13 +991,17 @@ data: "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", "value": 80 } ] + }, + "color": { + "mode": "thresholds" } }, "overrides": [ @@ -1032,7 +1032,8 @@ data: "mode": "percentage", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "orange", @@ -1179,13 +1180,13 @@ data: "id": "mappings", "value": [ { - "type": "value", "options": { "NaN": { - "text": "-", - "index": 0 + "index": 0, + "text": "-" } - } + }, + "type": "value" } ] }, @@ -1201,19 +1202,19 @@ data: "h": 12, "w": 24, "x": 0, - "y": 43 + "y": 3 }, "id": 19, "options": { + "showHeader": true, "cellHeight": "sm", "footer": { + "show": false, + "reducer": ["sum"], "countRows": false, - "enablePagination": true, "fields": "", - "reducer": ["sum"], - "show": false + "enablePagination": true }, - "showHeader": true, "sortBy": [ { "desc": true, @@ -1259,13 +1260,13 @@ data: }, "editorMode": "code", "exemplar": false, - "expr": "sum(process_cpu_seconds_total{namespace=~\"rhacs-$instance_id\", job=~\"central\"}) by (namespace, rhacs_org_name)", + "expr": "sum(process_cpu_seconds_total{namespace=~\"rhacs-$instance_id\", job=~\"central\"}) by (namespace, rhacs_org_name, rhacs_version, rhacs_expired_at)", "format": "table", "hide": false, "instant": true, "legendFormat": "__auto", "range": false, - "refId": "Organisation" + "refId": "Metadata" }, { "datasource": { @@ -1312,19 +1313,6 @@ data: "range": false, "refId": "Network transmitted" }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "min(process_cpu_seconds_total{namespace=~\"rhacs-$instance_id\", job=~\"central\"}) by (namespace, rhacs_version)", - "format": "table", - "hide": false, - "legendFormat": "__auto", - "range": true, - "refId": "Version" - }, { "datasource": { "type": "prometheus", @@ -1339,21 +1327,6 @@ data: "legendFormat": "__auto", "range": false, "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum(process_cpu_seconds_total{namespace=~\"rhacs-$instance_id\", job=~\"central\"}) by (namespace, rhacs_expired_at)", - "format": "table", - "hide": false, - "legendFormat": "__auto", - "range": true, - "refId": "Expired At", - "instant": false, - "exemplar": false } ], "title": "Central Overview Table", @@ -1361,7 +1334,8 @@ data: { "id": "seriesToColumns", "options": { - "byField": "namespace" + "byField": "namespace", + "mode": "outer" } }, { @@ -1376,6 +1350,7 @@ data: "Time 6": true, "Time 7": true, "Time 8": true, + "Value #Expired At": true, "Value #Organisation": true, "Value #Version": true, "__name__": true, @@ -1386,27 +1361,32 @@ data: "pod": true, "rhacs_cluster_name": true, "rhacs_environment": true, - "Value #Expired At": true + "Value #Metadata": true }, "indexByName": { - "Time 1": 9, - "Time 2": 10, - "Time 3": 11, - "Time 4": 12, - "Time 5": 13, - "Time 6": 15, - "Time 7": 16, - "Time 8": 17, - "Value #CPU consumption": 3, - "Value #CPU throttle": 4, - "Value #Memory consumption": 1, - "Value #Memory total": 2, - "Value #Network received": 5, - "Value #Network transmitted": 6, - "Value #Organisation": 14, - "Value #Secured Cores": 7, "namespace": 0, - "rhacs_org_name": 8 + "Value #Memory consumption": 1, + "Value #Network received": 2, + "Value #Network transmitted": 3, + "Value #Secured Cores": 4, + "rhacs_org_name": 5, + "Time 1": 6, + "Time 2": 7, + "Time 3": 8, + "Time 4": 9, + "Time 5": 10, + "Time 6": 11, + "rhacs_version": 12, + "Value #Metadata": 13, + "container": 14, + "exported_instance": 15, + "instance": 16, + "job": 17, + "pod": 18, + "rhacs_cluster_name": 19, + "rhacs_environment": 20, + "Value #A": 21, + "rhacs_expired_at": 22 }, "renameByName": { "Time 2": "", @@ -1421,14 +1401,15 @@ data: "Value #Organisation": "CPU seconds", "Value #Secured Cores": "Secured Cores", "Value #Version": "", + "rhacs_expired_at": "Expired At", "rhacs_org_name": "Organisation", - "rhacs_version": "Version", - "rhacs_expired_at": "Expired At" + "rhacs_version": "Version" } } } ], - "type": "table" + "type": "table", + "description": "" }, { "datasource": { diff --git a/resources/grafana/generated/dashboards/rhacs-cluster-overview-dashboard.yaml b/resources/grafana/generated/dashboards/rhacs-cluster-overview-dashboard.yaml index a2fb0698..cd732482 100644 --- a/resources/grafana/generated/dashboards/rhacs-cluster-overview-dashboard.yaml +++ b/resources/grafana/generated/dashboards/rhacs-cluster-overview-dashboard.yaml @@ -972,22 +972,18 @@ spec: }, { "datasource": { - "type": "datasource", - "uid": "-- Mixed --" + "uid": "-- Mixed --", + "type": "datasource" }, - "description": "", "fieldConfig": { "defaults": { - "color": { - "mode": "thresholds" - }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, - "filterable": true, "inspect": false, + "filterable": true, "minWidth": 200 }, "mappings": [], @@ -995,13 +991,17 @@ spec: "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", "value": 80 } ] + }, + "color": { + "mode": "thresholds" } }, "overrides": [ @@ -1032,7 +1032,8 @@ spec: "mode": "percentage", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "orange", @@ -1179,13 +1180,13 @@ spec: "id": "mappings", "value": [ { - "type": "value", "options": { "NaN": { - "text": "-", - "index": 0 + "index": 0, + "text": "-" } - } + }, + "type": "value" } ] }, @@ -1201,19 +1202,19 @@ spec: "h": 12, "w": 24, "x": 0, - "y": 43 + "y": 3 }, "id": 19, "options": { + "showHeader": true, "cellHeight": "sm", "footer": { + "show": false, + "reducer": ["sum"], "countRows": false, - "enablePagination": true, "fields": "", - "reducer": ["sum"], - "show": false + "enablePagination": true }, - "showHeader": true, "sortBy": [ { "desc": true, @@ -1259,13 +1260,13 @@ spec: }, "editorMode": "code", "exemplar": false, - "expr": "sum(process_cpu_seconds_total{namespace=~\"rhacs-$instance_id\", job=~\"central\"}) by (namespace, rhacs_org_name)", + "expr": "sum(process_cpu_seconds_total{namespace=~\"rhacs-$instance_id\", job=~\"central\"}) by (namespace, rhacs_org_name, rhacs_version, rhacs_expired_at)", "format": "table", "hide": false, "instant": true, "legendFormat": "__auto", "range": false, - "refId": "Organisation" + "refId": "Metadata" }, { "datasource": { @@ -1312,19 +1313,6 @@ spec: "range": false, "refId": "Network transmitted" }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "min(process_cpu_seconds_total{namespace=~\"rhacs-$instance_id\", job=~\"central\"}) by (namespace, rhacs_version)", - "format": "table", - "hide": false, - "legendFormat": "__auto", - "range": true, - "refId": "Version" - }, { "datasource": { "type": "prometheus", @@ -1339,21 +1327,6 @@ spec: "legendFormat": "__auto", "range": false, "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum(process_cpu_seconds_total{namespace=~\"rhacs-$instance_id\", job=~\"central\"}) by (namespace, rhacs_expired_at)", - "format": "table", - "hide": false, - "legendFormat": "__auto", - "range": true, - "refId": "Expired At", - "instant": false, - "exemplar": false } ], "title": "Central Overview Table", @@ -1361,7 +1334,8 @@ spec: { "id": "seriesToColumns", "options": { - "byField": "namespace" + "byField": "namespace", + "mode": "outer" } }, { @@ -1376,6 +1350,7 @@ spec: "Time 6": true, "Time 7": true, "Time 8": true, + "Value #Expired At": true, "Value #Organisation": true, "Value #Version": true, "__name__": true, @@ -1386,27 +1361,32 @@ spec: "pod": true, "rhacs_cluster_name": true, "rhacs_environment": true, - "Value #Expired At": true + "Value #Metadata": true }, "indexByName": { - "Time 1": 9, - "Time 2": 10, - "Time 3": 11, - "Time 4": 12, - "Time 5": 13, - "Time 6": 15, - "Time 7": 16, - "Time 8": 17, - "Value #CPU consumption": 3, - "Value #CPU throttle": 4, - "Value #Memory consumption": 1, - "Value #Memory total": 2, - "Value #Network received": 5, - "Value #Network transmitted": 6, - "Value #Organisation": 14, - "Value #Secured Cores": 7, "namespace": 0, - "rhacs_org_name": 8 + "Value #Memory consumption": 1, + "Value #Network received": 2, + "Value #Network transmitted": 3, + "Value #Secured Cores": 4, + "rhacs_org_name": 5, + "Time 1": 6, + "Time 2": 7, + "Time 3": 8, + "Time 4": 9, + "Time 5": 10, + "Time 6": 11, + "rhacs_version": 12, + "Value #Metadata": 13, + "container": 14, + "exported_instance": 15, + "instance": 16, + "job": 17, + "pod": 18, + "rhacs_cluster_name": 19, + "rhacs_environment": 20, + "Value #A": 21, + "rhacs_expired_at": 22 }, "renameByName": { "Time 2": "", @@ -1421,14 +1401,15 @@ spec: "Value #Organisation": "CPU seconds", "Value #Secured Cores": "Secured Cores", "Value #Version": "", + "rhacs_expired_at": "Expired At", "rhacs_org_name": "Organisation", - "rhacs_version": "Version", - "rhacs_expired_at": "Expired At" + "rhacs_version": "Version" } } } ], - "type": "table" + "type": "table", + "description": "" }, { "datasource": { diff --git a/resources/grafana/sources/rhacs-cluster-overview.json b/resources/grafana/sources/rhacs-cluster-overview.json index 91e372d3..ea2ba1ba 100644 --- a/resources/grafana/sources/rhacs-cluster-overview.json +++ b/resources/grafana/sources/rhacs-cluster-overview.json @@ -961,22 +961,18 @@ }, { "datasource": { - "type": "datasource", - "uid": "-- Mixed --" + "uid": "-- Mixed --", + "type": "datasource" }, - "description": "", "fieldConfig": { "defaults": { - "color": { - "mode": "thresholds" - }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, - "filterable": true, "inspect": false, + "filterable": true, "minWidth": 200 }, "mappings": [], @@ -984,13 +980,17 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", "value": 80 } ] + }, + "color": { + "mode": "thresholds" } }, "overrides": [ @@ -1021,7 +1021,8 @@ "mode": "percentage", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "orange", @@ -1168,13 +1169,13 @@ "id": "mappings", "value": [ { - "type": "value", "options": { "NaN": { - "text": "-", - "index": 0 + "index": 0, + "text": "-" } - } + }, + "type": "value" } ] }, @@ -1190,19 +1191,19 @@ "h": 12, "w": 24, "x": 0, - "y": 43 + "y": 3 }, "id": 19, "options": { + "showHeader": true, "cellHeight": "sm", "footer": { + "show": false, + "reducer": ["sum"], "countRows": false, - "enablePagination": true, "fields": "", - "reducer": ["sum"], - "show": false + "enablePagination": true }, - "showHeader": true, "sortBy": [ { "desc": true, @@ -1248,13 +1249,13 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sum(process_cpu_seconds_total{namespace=~\"rhacs-$instance_id\", job=~\"central\"}) by (namespace, rhacs_org_name)", + "expr": "sum(process_cpu_seconds_total{namespace=~\"rhacs-$instance_id\", job=~\"central\"}) by (namespace, rhacs_org_name, rhacs_version, rhacs_expired_at)", "format": "table", "hide": false, "instant": true, "legendFormat": "__auto", "range": false, - "refId": "Organisation" + "refId": "Metadata" }, { "datasource": { @@ -1301,19 +1302,6 @@ "range": false, "refId": "Network transmitted" }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "min(process_cpu_seconds_total{namespace=~\"rhacs-$instance_id\", job=~\"central\"}) by (namespace, rhacs_version)", - "format": "table", - "hide": false, - "legendFormat": "__auto", - "range": true, - "refId": "Version" - }, { "datasource": { "type": "prometheus", @@ -1328,21 +1316,6 @@ "legendFormat": "__auto", "range": false, "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum(process_cpu_seconds_total{namespace=~\"rhacs-$instance_id\", job=~\"central\"}) by (namespace, rhacs_expired_at)", - "format": "table", - "hide": false, - "legendFormat": "__auto", - "range": true, - "refId": "Expired At", - "instant": false, - "exemplar": false } ], "title": "Central Overview Table", @@ -1350,7 +1323,8 @@ { "id": "seriesToColumns", "options": { - "byField": "namespace" + "byField": "namespace", + "mode": "outer" } }, { @@ -1365,6 +1339,7 @@ "Time 6": true, "Time 7": true, "Time 8": true, + "Value #Expired At": true, "Value #Organisation": true, "Value #Version": true, "__name__": true, @@ -1375,27 +1350,32 @@ "pod": true, "rhacs_cluster_name": true, "rhacs_environment": true, - "Value #Expired At": true + "Value #Metadata": true }, "indexByName": { - "Time 1": 9, - "Time 2": 10, - "Time 3": 11, - "Time 4": 12, - "Time 5": 13, - "Time 6": 15, - "Time 7": 16, - "Time 8": 17, - "Value #CPU consumption": 3, - "Value #CPU throttle": 4, - "Value #Memory consumption": 1, - "Value #Memory total": 2, - "Value #Network received": 5, - "Value #Network transmitted": 6, - "Value #Organisation": 14, - "Value #Secured Cores": 7, "namespace": 0, - "rhacs_org_name": 8 + "Value #Memory consumption": 1, + "Value #Network received": 2, + "Value #Network transmitted": 3, + "Value #Secured Cores": 4, + "rhacs_org_name": 5, + "Time 1": 6, + "Time 2": 7, + "Time 3": 8, + "Time 4": 9, + "Time 5": 10, + "Time 6": 11, + "rhacs_version": 12, + "Value #Metadata": 13, + "container": 14, + "exported_instance": 15, + "instance": 16, + "job": 17, + "pod": 18, + "rhacs_cluster_name": 19, + "rhacs_environment": 20, + "Value #A": 21, + "rhacs_expired_at": 22 }, "renameByName": { "Time 2": "", @@ -1410,14 +1390,15 @@ "Value #Organisation": "CPU seconds", "Value #Secured Cores": "Secured Cores", "Value #Version": "", + "rhacs_expired_at": "Expired At", "rhacs_org_name": "Organisation", - "rhacs_version": "Version", - "rhacs_expired_at": "Expired At" + "rhacs_version": "Version" } } } ], - "type": "table" + "type": "table", + "description": "" }, { "datasource": {