commit 10dbb311d1f9d00a984f7a259d428c1a9269cf89 parent dd1c586138b721f839761410e283934b0042dd94 Author: mtmn <miro@haravara.org> Date: Tue, 7 Apr 2026 12:46:36 +0200 modules/services/monitoring.nix Diffstat:
| M | modules/services/monitoring.nix | | | 20 | +++++++++++--------- |
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/modules/services/monitoring.nix b/modules/services/monitoring.nix @@ -326,26 +326,28 @@ in { alloy = { enable = true; configPath = pkgs.writeText "alloy-config.river" '' - loki.source.journal "systemd_logs" { - max_age = "12h" - format_as_json = false - + loki.relabel "journal" { forward_to = [loki.write.default.receiver] - relabel { + rule { source_labels = ["__journal__systemd_unit"] target_label = "unit" } } + loki.source.journal "systemd_logs" { + max_age = "12h" + forward_to = [loki.relabel.journal.receiver] + labels = { + job = "systemd-journal" + host = "${config.networking.hostName}" + } + } + loki.write "default" { endpoint { url = "http://127.0.0.1:3100/loki/api/v1/push" } - external_labels { - host = "${config.networking.hostName}" - job = "systemd-journal" - } } ''; };