From d79aaf039c474e88b1831b702b3aad548086992e Mon Sep 17 00:00:00 2001 From: Bruno Bressi Date: Thu, 25 Jan 2024 11:52:09 +0100 Subject: [PATCH] fix: fixed last dashboards and removed double escapes Signed-off-by: Bruno Bressi --- chart/files/caas-carbon-dashboard.json | 2 +- chart/files/kepler-dashboard.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/chart/files/caas-carbon-dashboard.json b/chart/files/caas-carbon-dashboard.json index 61b26a3..c2e9723 100644 --- a/chart/files/caas-carbon-dashboard.json +++ b/chart/files/caas-carbon-dashboard.json @@ -1696,7 +1696,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "sum by (container_namespace) (\\n (\\n increase(kepler_container_dram_joules_total{container_namespace=~\\\"$namespace\\\", pod_name=~\\\"$pod\\\"}[24h:1m]) +\\n increase(kepler_container_other_joules_total{container_namespace=~\\\"$namespace\\\", pod_name=~\\\"$pod\\\"}[24h:1m]) +\\n increase(kepler_container_package_joules_total{container_namespace=~\\\"$namespace\\\", pod_name=~\\\"$pod\\\"}[24h:1m])\\n ) * $watt_per_second_to_kWh\\n)\\n\"", + "expr": "sum by (container_namespace)(\n (\n increase(kepler_container_dram_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m]) +\n increase(kepler_container_other_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m]) +\n increase(kepler_container_package_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n ) * $watt_per_second_to_kWh\n)", "interval": "", "legendFormat": "{{container_namespace}}", "range": true, diff --git a/chart/files/kepler-dashboard.json b/chart/files/kepler-dashboard.json index 6f6a737..d95d8b1 100644 --- a/chart/files/kepler-dashboard.json +++ b/chart/files/kepler-dashboard.json @@ -100,7 +100,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "( sum(\n increase(\n (kepler_container_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n )\n ) * $watt_per_second_to_kWh \n) * $coal", + "expr": "sum by (container_namespace)(\n (\n increase(kepler_container_dram_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m]) +\n increase(kepler_container_other_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m]) +\n increase(kepler_container_package_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n ) * $watt_per_second_to_kWh * $coal\n)\n", "hide": false, "legendFormat": "CO2 Coal", "range": true, @@ -112,7 +112,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "( sum(\n increase(\n (kepler_container_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n )\n ) * $watt_per_second_to_kWh \n) * $petroleum", + "expr": "sum by (container_namespace)(\n (\n increase(kepler_container_dram_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m]) +\n increase(kepler_container_other_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m]) +\n increase(kepler_container_package_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n ) * $watt_per_second_to_kWh * $petroleum\n)\n", "hide": false, "legendFormat": "CO2 Petroleum", "range": true, @@ -124,7 +124,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "( sum(\n increase(\n (kepler_container_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n )\n ) * $watt_per_second_to_kWh \n) * $natural_gas", + "expr": "sum by (container_namespace)(\n (\n increase(kepler_container_dram_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m]) +\n increase(kepler_container_other_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m]) +\n increase(kepler_container_package_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n ) * $watt_per_second_to_kWh * $natural_gas\n)\n", "hide": false, "legendFormat": "CO2 Natural Gas", "range": true, @@ -794,7 +794,7 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "sum by (container_namespace) (\n increase(\n (kepler_container_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n )\n) * $watt_per_second_to_kWh ", + "expr": "sum by (container_namespace)(\n (\n increase(kepler_container_dram_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m]) +\n increase(kepler_container_other_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m]) +\n increase(kepler_container_package_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n ) * $watt_per_second_to_kWh\n)", "interval": "", "legendFormat": "{{container_namespace}}", "range": true,