From 8a1c18b2deb836a6564f9b13f01308c2d36d57d2 Mon Sep 17 00:00:00 2001
From: Florian Sesser <florian@private.storage>
Date: Mon, 14 Feb 2022 14:57:44 +0000
Subject: [PATCH] Payments dashboard log fix & fine tune

- (tryfix) Switch to Loki datasource;
- Filter requests to metrics instead of all GET;
- Show the last week by default
- Show log times

Interesting and not quickly fixable as it looks like: the
GET ... line comes *after*  the result.  We might be logging
this wrong to begin with, but probably this is some next
gen AI line ordering intelligence
---
 .../server/grafana-dashboards/payments.json     | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/nixos/modules/monitoring/server/grafana-dashboards/payments.json b/nixos/modules/monitoring/server/grafana-dashboards/payments.json
index ffad8e9c..174a145e 100644
--- a/nixos/modules/monitoring/server/grafana-dashboards/payments.json
+++ b/nixos/modules/monitoring/server/grafana-dashboards/payments.json
@@ -1031,7 +1031,7 @@
     {
       "datasource": {
         "type": "loki",
-        "uid": "P8E80F9AEF21F6940"
+        "uid": "000000002"
       },
       "description": "Exercise in counting maybe interesting lines. This can be alerted on.",
       "fieldConfig": {
@@ -1107,10 +1107,9 @@
         {
           "datasource": {
             "type": "loki",
-            "uid": "P8E80F9AEF21F6940"
+            "uid": "000000002"
           },
-          "expr": "count_over_time({host=\"payments\",unit=\"zkapissuer.service\"} !~ \"200|GET|Accept\" [5m])",
-          "maxLines": 0,
+          "expr": "count_over_time({host=\"payments\",unit=\"zkapissuer.service\"} !~ \"200|/metrics|Accept\" [5m])",
           "refId": "A"
         }
       ],
@@ -1121,7 +1120,7 @@
     {
       "datasource": {
         "type": "loki",
-        "uid": "P8E80F9AEF21F6940"
+        "uid": "000000002"
       },
       "description": "Exercise in filtering the payment server logs.",
       "gridPos": {
@@ -1137,7 +1136,7 @@
         "prettifyLogMessage": false,
         "showCommonLabels": false,
         "showLabels": false,
-        "showTime": false,
+        "showTime": true,
         "sortOrder": "Descending",
         "wrapLogMessage": false
       },
@@ -1145,9 +1144,9 @@
         {
           "datasource": {
             "type": "loki",
-            "uid": "P8E80F9AEF21F6940"
+            "uid": "000000002"
           },
-          "expr": "{host=\"payments\",unit=\"zkapissuer.service\"} !~ \"200|GET|Accept\"",
+          "expr": "{host=\"payments\",unit=\"zkapissuer.service\"} !~ \"200|/metrics|Accept\"",
           "refId": "A"
         }
       ],
@@ -1163,7 +1162,7 @@
     "list": []
   },
   "time": {
-    "from": "now-3h",
+    "from": "now-7d",
     "to": "now"
   },
   "timepicker": {
-- 
GitLab