From cf36cf5ea1435fa55f813a082ca8820f6c11cf12 Mon Sep 17 00:00:00 2001 From: QuentinBisson Date: Mon, 25 Mar 2024 16:12:15 +0100 Subject: [PATCH] Fix mimir-prometheus-comparator --- CHANGELOG.md | 1 + .../private/prometheus-mimir-comparative.json | 49 +++---------------- 2 files changed, 8 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dec0b2b8..e29da14c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix all dashboards that were only supporting only role=master to now support role=~control-plane|master. +- Fix Mimir - Prometheus cost dashboard to compare over real data (not missing on data from old prometheus instances) ## [3.8.4] - 2024-03-11 diff --git a/helm/dashboards/charts/private_dashboards_mz/dashboards/shared/private/prometheus-mimir-comparative.json b/helm/dashboards/charts/private_dashboards_mz/dashboards/shared/private/prometheus-mimir-comparative.json index 914babd8..1438a42a 100644 --- a/helm/dashboards/charts/private_dashboards_mz/dashboards/shared/private/prometheus-mimir-comparative.json +++ b/helm/dashboards/charts/private_dashboards_mz/dashboards/shared/private/prometheus-mimir-comparative.json @@ -94,7 +94,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(rate(container_cpu_usage_seconds_total{container=\"prometheus\", pod=~\"prometheus-($cluster)-.*\", cluster_type=~\"management_cluster\"}[5m]))", + "expr": "sum(rate(container_cpu_usage_seconds_total{container=\"prometheus\", namespace=~\".*-prometheus\", cluster_type=~\"management_cluster\"}[$__range]))", "legendFormat": "__auto", "range": true, "refId": "A" @@ -162,7 +162,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(max_over_time(\n container_memory_usage_bytes{container=\"prometheus\", pod=~\"prometheus-($cluster).*\", cluster_type=~\"management_cluster\"}[$__range]\n))", + "expr": "sum(max_over_time(container_memory_usage_bytes{container=\"prometheus\", namespace=~\".*-prometheus\", cluster_type=~\"management_cluster\"}[$__range]))", "legendFormat": "__auto", "range": true, "refId": "A" @@ -256,7 +256,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(irate(container_network_receive_bytes_total{pod=~\"prometheus-($cluster)-.*\"}[5m])) by (pod)", + "expr": "sum(irate(container_network_receive_bytes_total{namespace=~\".*-prometheus\"}[$__range])) by (pod)", "legendFormat": "{{pod}}", "range": true, "refId": "A" @@ -350,7 +350,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(irate(container_network_transmit_bytes_total{pod=~\"prometheus-($cluster)-.*\"}[5m])) by (pod)", + "expr": "sum(irate(container_network_transmit_bytes_total{namespace=~\".*-prometheus\"}[$__range])) by (pod)", "legendFormat": "{{pod}}", "range": true, "refId": "A" @@ -432,7 +432,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sum(sum(rate(container_cpu_usage_seconds_total{pod=~\"mimir-.*\", cluster_type=~\"management_cluster\"}[5m])) by (pod))", + "expr": "sum(sum(rate(container_cpu_usage_seconds_total{pod=~\"mimir-.*\", cluster_type=~\"management_cluster\"}[$__range])) by (pod))", "instant": false, "legendFormat": "__auto", "range": true, @@ -595,7 +595,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(irate(container_network_receive_bytes_total{pod=~\"mimir-.*\"}[5m])) by (pod)", + "expr": "sum(irate(container_network_receive_bytes_total{pod=~\"mimir-.*\"}[$__range])) by (pod)", "legendFormat": "{{pod}}", "range": true, "refId": "A" @@ -689,7 +689,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(irate(container_network_transmit_bytes_total{pod=~\"mimir-.*\"}[5m])) by (pod)", + "expr": "sum(irate(container_network_transmit_bytes_total{pod=~\"mimir-.*\"}[$__range])) by (pod)", "legendFormat": "{{pod}}", "range": true, "refId": "A" @@ -703,41 +703,6 @@ "schemaVersion": 38, "style": "dark", "tags": [], - "templating": { - "list": [ - { - "allValue": "", - "current": { - "selected": true, - "text": [ - "All" - ], - "value": [ - "$__all" - ] - }, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "definition": "label_values(kube_pod_container_info{image=~\".*prometheus.*\"},cluster_id)", - "hide": 0, - "includeAll": true, - "multi": true, - "name": "cluster", - "options": [], - "query": { - "query": "label_values(kube_pod_container_info{image=~\".*prometheus.*\"},cluster_id)", - "refId": "PrometheusVariableQueryEditor-VariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" - } - ] - }, "time": { "from": "now-7d", "to": "now"