grafana: fix bootstrap and errors log panels
Some checks failed
Run nix flake check / flake-check (push) Has been cancelled

- 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 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 22:01:28 +01:00
parent d281f7e9ad
commit 4de3289a5f

View File

@@ -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"
}
],