replace journald witrh loki+promtail
All checks were successful
Build hosts / build-hosts (pull_request) Successful in 20s
Flake check / flake-check (pull_request) Successful in 21s

This commit is contained in:
sid 2026-05-22 19:10:46 +02:00
parent ded81c4cdd
commit 4da48d5f99
9 changed files with 110 additions and 142 deletions

View file

@ -0,0 +1,43 @@
{ config, constants, ... }:
{
services.promtail = {
enable = true;
configuration = {
server = {
http_listen_port = 9080;
grpc_listen_port = 0;
};
clients = [
{
url = "http://${constants.hosts.sid.ip}:3100/loki/api/v1/push";
}
];
scrape_configs = [
{
job_name = "journal";
journal = {
max_age = "12h";
path = "/var/log/journal";
labels = {
job = "systemd-journal";
host = config.networking.hostName;
};
};
relabel_configs = [
{
source_labels = [ "__journal__systemd_unit" ];
target_label = "unit";
}
];
}
];
};
};
users.users.promtail.extraGroups = [ "systemd-journal" ];
}