From 4de3289a5f628d21ffbc1e87ce2e02f5d1d09daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sun, 8 Feb 2026 22:01:28 +0100 Subject: [PATCH] grafana: fix bootstrap and errors log panels - Bootstrap logs are plain text, not JSON - remove json parsing - Use | keep host instead of | drop MESSAGE to explicitly show only the host label for upgrade log panels Co-Authored-By: Claude Opus 4.5 --- services/grafana/dashboards/nixos-operations.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/grafana/dashboards/nixos-operations.json b/services/grafana/dashboards/nixos-operations.json index 6073c8b..feb35a5 100644 --- a/services/grafana/dashboards/nixos-operations.json +++ b/services/grafana/dashboards/nixos-operations.json @@ -208,7 +208,7 @@ "datasource": {"type": "loki", "uid": "loki"}, "targets": [ { - "expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |= \"Done. The new configuration is\" | json | line_format \"{{.MESSAGE}}\" | drop MESSAGE", + "expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |= \"Done. The new configuration is\" | json | line_format \"{{.MESSAGE}}\" | keep host", "refId": "A" } ], @@ -231,7 +231,7 @@ "datasource": {"type": "loki", "uid": "loki"}, "targets": [ { - "expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |= \"building\" | json | line_format \"{{.MESSAGE}}\" | drop MESSAGE", + "expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |= \"building\" | json | line_format \"{{.MESSAGE}}\" | keep host", "refId": "A" } ], @@ -254,7 +254,7 @@ "datasource": {"type": "loki", "uid": "loki"}, "targets": [ { - "expr": "{job=\"bootstrap\", host=~\"$host\"} | json | line_format \"{{.MESSAGE}}\" | drop MESSAGE", + "expr": "{job=\"bootstrap\", host=~\"$host\"}", "refId": "A" } ], @@ -277,7 +277,7 @@ "datasource": {"type": "loki", "uid": "loki"}, "targets": [ { - "expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |~ \"(?i)error|failed\" | json | line_format \"{{.MESSAGE}}\" | drop MESSAGE", + "expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |~ \"(?i)error|failed\" | json | line_format \"{{.MESSAGE}}\" | keep host", "refId": "A" } ],