Added loki for logging to eko

This commit is contained in:
2025-07-01 21:15:02 +03:00
parent 3e0e3605af
commit 766bbafbf7
2 changed files with 28 additions and 3 deletions

View File

@@ -0,0 +1,19 @@
local.file_match "eko_logs" {
path_targets = [
{ __path__ = "/srv/eko/logs/eko-server-*.log" },
]
sync_period = "3s"
}
loki.source.file "eko_tail" {
targets = local.file_match.eko_logs.targets
forward_to = [loki.write.eko.receiver]
tail_from_end = true
}
loki.write "eko" {
endpoint {
url = "http://localhost:3100/loki/api/v1/push"
}
external_labels = { app = "eko-server" }
}

View File

@@ -5,9 +5,6 @@
};
config = lib.mkIf config.eko.enable {
grafana.enable = true;
loki.enable = true;
users.groups.eko = { };
users.users.eko = {
createHome = false;
@@ -67,5 +64,14 @@
};
};
# Enable metrics/logging
grafana.enable = true;
loki.enable = true;
services.alloy.enable = true;
environment.etc = {
"alloy/eko-config.alloy".text = builtins.readFile ./eko-config.alloy;
};
};
}