From f65223efe20b7f97cd509118e16e191b603569b2 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Mon, 4 Apr 2022 23:34:40 +0200
Subject: [PATCH] L2SS-685: Annotate alerts better on home dashboard

---
 docker-compose/grafana/dashboards/home.json | 45 +++++++++++----------
 1 file changed, 24 insertions(+), 21 deletions(-)

diff --git a/docker-compose/grafana/dashboards/home.json b/docker-compose/grafana/dashboards/home.json
index ef3b8e02d..7aa5d7aad 100644
--- a/docker-compose/grafana/dashboards/home.json
+++ b/docker-compose/grafana/dashboards/home.json
@@ -21,7 +21,7 @@
   "editable": true,
   "fiscalYearStartMonth": 0,
   "graphTooltip": 0,
-  "id": 5,
+  "id": 8,
   "links": [],
   "liveNow": false,
   "panels": [
@@ -83,7 +83,7 @@
           "value": "first_last_numbers"
         }
       ],
-      "panelHeight": 137,
+      "panelHeight": 130,
       "pluginVersion": "8.4.5",
       "rowNumbersEnabled": false,
       "rowsPerPage": 5,
@@ -119,20 +119,6 @@
           "pattern": "Time",
           "type": "date"
         },
-        {
-          "$$hashKey": "object:20",
-          "colors": [
-            "rgba(245, 54, 54, 0.9)",
-            "rgba(237, 129, 40, 0.89)",
-            "rgba(50, 172, 45, 0.97)"
-          ],
-          "decimals": 2,
-          "pattern": "/.*/",
-          "splitPattern": "/ /",
-          "thresholds": [],
-          "type": "number",
-          "unit": "short"
-        },
         {
           "$$hashKey": "object:45",
           "colors": [
@@ -143,7 +129,7 @@
           "dateFormat": "YYYY-MM-DD HH:mm:ss",
           "decimals": 2,
           "mappingType": 1,
-          "pattern": "Panel",
+          "pattern": "Panel|Dashboard|Alert",
           "sanitize": true,
           "splitPattern": "/ /",
           "thresholds": [],
@@ -162,7 +148,7 @@
           "decimals": 2,
           "link": true,
           "mappingType": 1,
-          "pattern": "Alerta",
+          "pattern": "Alerta Link",
           "splitPattern": "/ /",
           "thresholds": [],
           "type": "string",
@@ -224,14 +210,24 @@
               "text": "Attribute",
               "type": "string"
             },
+            {
+              "selector": "attributes.grafanaDashboardHtml",
+              "text": "Dashboard",
+              "type": "string"
+            },
             {
               "selector": "attributes.grafanaPanelHtml",
               "text": "Panel",
               "type": "string"
             },
+            {
+              "selector": "attributes.grafanaAlertHtml",
+              "text": "Alert",
+              "type": "string"
+            },
             {
               "selector": "href",
-              "text": "Alerta",
+              "text": "Alerta Link",
               "type": "string"
             }
           ],
@@ -297,6 +293,13 @@
         "y": 6
       },
       "id": 60,
+      "links": [
+        {
+          "targetBlank": true,
+          "title": "Details",
+          "url": "/alerting/list"
+        }
+      ],
       "options": {
         "alertInstanceLabelFilter": "",
         "alertName": "",
@@ -314,7 +317,7 @@
           "pending": true
         }
       },
-      "title": "Grafana Alerts",
+      "title": "Firing Alerts",
       "type": "alertlist"
     },
     {
@@ -2810,6 +2813,6 @@
   "timezone": "",
   "title": "Home",
   "uid": "nC8N_kO7k",
-  "version": 6,
+  "version": 1,
   "weekStart": ""
 }
-- 
GitLab