From 6219563873de17b748a04afeb29bc4615ded0871 Mon Sep 17 00:00:00 2001 From: Vunny Sodhi Date: Fri, 2 Aug 2024 17:18:30 +0300 Subject: [PATCH] logging: Collect journal logs from admin-vm This patch will start logging journal logs collected from admin-vm to grafana server in the cloud. Signed-off-by: Vunny Sodhi --- modules/common/logging/logs-aggregator.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/common/logging/logs-aggregator.nix b/modules/common/logging/logs-aggregator.nix index 9c5da6f62..cb5a4e5d8 100644 --- a/modules/common/logging/logs-aggregator.nix +++ b/modules/common/logging/logs-aggregator.nix @@ -27,6 +27,19 @@ in { // Alloy service can read file in this specific location filename = "${macAddressPath}" } + discovery.relabel "adminJournal" { + targets = [] + rule { + source_labels = ["__journal__hostname"] + target_label = "nodename" + } + } + + loki.source.journal "journal" { + path = "/var/log/journal" + relabel_rules = discovery.relabel.adminJournal.rules + forward_to = [loki.write.remote.receiver] + } loki.write "remote" { endpoint {