From e0e9addb55874b4f726a99c06a60d55ecc97641c Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Sat, 8 Oct 2022 01:57:48 +0200
Subject: [PATCH] fix(mail): Fix broken loki dashboard

Apparently only hardcoded datasource uid work in this case, otherwise
it'll try to use Prometheus, which will fail hilariously.
---
 apps/k8s01/mail/dashboards/logs.json | 55 +++++-----------------------
 1 file changed, 9 insertions(+), 46 deletions(-)

diff --git a/apps/k8s01/mail/dashboards/logs.json b/apps/k8s01/mail/dashboards/logs.json
index 66c38a090..28ac414df 100644
--- a/apps/k8s01/mail/dashboards/logs.json
+++ b/apps/k8s01/mail/dashboards/logs.json
@@ -1,41 +1,4 @@
 {
-  "__inputs": [
-    {
-      "name": "DS_LOKI",
-      "label": "Loki",
-      "description": "",
-      "type": "datasource",
-      "pluginId": "loki",
-      "pluginName": "Loki"
-    }
-  ],
-  "__elements": {},
-  "__requires": [
-    {
-      "type": "grafana",
-      "id": "grafana",
-      "name": "Grafana",
-      "version": "9.1.6"
-    },
-    {
-      "type": "panel",
-      "id": "logs",
-      "name": "Logs",
-      "version": ""
-    },
-    {
-      "type": "datasource",
-      "id": "loki",
-      "name": "Loki",
-      "version": "1.0.0"
-    },
-    {
-      "type": "panel",
-      "id": "stat",
-      "name": "Stat",
-      "version": ""
-    }
-  ],
   "annotations": {
     "list": [
       {
@@ -61,14 +24,14 @@
   "editable": true,
   "fiscalYearStartMonth": 0,
   "graphTooltip": 0,
-  "id": null,
+  "id": 41,
   "links": [],
   "liveNow": false,
   "panels": [
     {
       "datasource": {
         "type": "loki",
-        "uid": "${DS_LOKI}"
+        "uid": "loki-system"
       },
       "description": "",
       "fieldConfig": {
@@ -119,7 +82,7 @@
         {
           "datasource": {
             "type": "loki",
-            "uid": "${DS_LOKI}"
+            "uid": "loki-system"
           },
           "editorMode": "code",
           "expr": "sum(count_over_time({namespace=\"mail\"} |= `NOQUEUE: reject` [$__range]))",
@@ -133,7 +96,7 @@
     {
       "datasource": {
         "type": "loki",
-        "uid": "${DS_LOKI}"
+        "uid": "loki-system"
       },
       "fieldConfig": {
         "defaults": {
@@ -183,7 +146,7 @@
         {
           "datasource": {
             "type": "loki",
-            "uid": "${DS_LOKI}"
+            "uid": "loki-system"
           },
           "editorMode": "builder",
           "expr": "sum(count_over_time({namespace=\"mail\", container=\"postfix\"} |= `status=sent (250 2.0.0` [$__range]))",
@@ -197,7 +160,7 @@
     {
       "datasource": {
         "type": "loki",
-        "uid": "${DS_LOKI}"
+        "uid": "loki-system"
       },
       "gridPos": {
         "h": 22,
@@ -220,7 +183,7 @@
         {
           "datasource": {
             "type": "loki",
-            "uid": "${DS_LOKI}"
+            "uid": "loki-system"
           },
           "editorMode": "builder",
           "expr": "{namespace=\"mail\"} |= ``",
@@ -246,7 +209,7 @@
   "timepicker": {},
   "timezone": "",
   "title": "Mail logs",
-  "uid": "b5TQlE4Vz",
-  "version": 2,
+  "uid": "b5TQlE4Vy",
+  "version": 1,
   "weekStart": ""
 }
-- 
GitLab