From d281f7e9ad85e6220d7282d4db37e94953671b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sun, 8 Feb 2026 21:55:41 +0100 Subject: [PATCH] grafana: drop MESSAGE label after formatting log line Use | drop MESSAGE to remove the extracted JSON field from labels while keeping stream labels like host visible. 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 628b8a8..6073c8b 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}}\"", + "expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |= \"Done. The new configuration is\" | json | line_format \"{{.MESSAGE}}\" | drop MESSAGE", "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}}\"", + "expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |= \"building\" | json | line_format \"{{.MESSAGE}}\" | drop MESSAGE", "refId": "A" } ], @@ -254,7 +254,7 @@ "datasource": {"type": "loki", "uid": "loki"}, "targets": [ { - "expr": "{job=\"bootstrap\", host=~\"$host\"} | json | line_format \"{{.MESSAGE}}\"", + "expr": "{job=\"bootstrap\", host=~\"$host\"} | json | line_format \"{{.MESSAGE}}\" | drop MESSAGE", "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}}\"", + "expr": "{systemd_unit=\"nixos-upgrade.service\", host=~\"$host\"} |~ \"(?i)error|failed\" | json | line_format \"{{.MESSAGE}}\" | drop MESSAGE", "refId": "A" } ],