From 996bbcb2e6d86b46982bcb72d1b4cadce03f80ce Mon Sep 17 00:00:00 2001
From: Florian Sesser <florian@private.storage>
Date: Tue, 30 Jan 2024 16:10:29 +0000
Subject: [PATCH] Beautify Backup Set Size panel a bit more

---
 .../monitoring/server/grafana-dashboards/backups.json  | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/nixos/modules/monitoring/server/grafana-dashboards/backups.json b/nixos/modules/monitoring/server/grafana-dashboards/backups.json
index 63487881..b3d45448 100644
--- a/nixos/modules/monitoring/server/grafana-dashboards/backups.json
+++ b/nixos/modules/monitoring/server/grafana-dashboards/backups.json
@@ -1050,7 +1050,6 @@
             "type": "loki",
             "uid": "LocalLoki"
           },
-          "editorMode": "code",
           "expr": "{unit=\"borgbackup-job-daily.service\"} |= \"duration\" | pattern \"<_>\\\"duration\\\": <duration>,\"",
           "legendFormat": "{{host}}",
           "queryType": "range",
@@ -1085,6 +1084,7 @@
         "type": "loki",
         "uid": "LocalLoki"
       },
+      "description": "\"compressed_size\" is size of last archive, \"unique_csize\" is deduplicated size of all archives.",
       "fieldConfig": {
         "defaults": {
           "color": {
@@ -1144,7 +1144,7 @@
           "placement": "bottom",
           "showLegend": true
         },
-        "orientation": "auto",
+        "orientation": "vertical",
         "showValue": "auto",
         "stacking": "none",
         "tooltip": {
@@ -1152,7 +1152,7 @@
           "sort": "none"
         },
         "xField": "host",
-        "xTickLabelRotation": 0,
+        "xTickLabelRotation": -45,
         "xTickLabelSpacing": 0
       },
       "pluginVersion": "8.4.7",
@@ -1162,9 +1162,11 @@
             "type": "loki",
             "uid": "LocalLoki"
           },
+          "editorMode": "code",
           "expr": "{unit=\"borgbackup-job-daily.service\"} |= \"compressed_size\" | pattern \"<_>\\\"compressed_size\\\": <compressed_size>,\"",
           "hide": false,
           "legendFormat": "{{host}} archive",
+          "queryType": "range",
           "refId": "This archive size in bytes"
         },
         {
@@ -1172,9 +1174,11 @@
             "type": "loki",
             "uid": "LocalLoki"
           },
+          "editorMode": "code",
           "expr": "{unit=\"borgbackup-job-daily.service\"} |= \"unique_csize\" | pattern \"<_>\\\"unique_csize\\\": <unique_csize>,\"",
           "hide": false,
           "legendFormat": "{{host}} all archives",
+          "queryType": "range",
           "refId": "All archives deduplicated size"
         }
       ],
-- 
GitLab