journald, loki: set log retention to 3 days on host,

7 days in loki
This commit is contained in:
teutat3s 2025-04-22 21:23:36 +02:00
parent 34d69445f5
commit 237013c41d
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
3 changed files with 15 additions and 2 deletions

View file

@ -7,6 +7,7 @@
}:
{
imports = [
./logging.nix
./nix.nix
./networking.nix
./terminal-tooling.nix

12
modules/core/logging.nix Normal file
View file

@ -0,0 +1,12 @@
{
config,
pkgs,
lib,
flake,
...
}:
{
services.journald.extraConfig = ''
MaxRetentionSec=3day
'';
}

View file

@ -57,13 +57,13 @@
};
};
};
# Keep logs for 4 weeks
# Keep logs for 1 week
# https://grafana.com/docs/loki/latest/operations/storage/retention/
limits_config = {
allow_structured_metadata = true;
ingestion_rate_mb = 8;
ingestion_burst_size_mb = 12;
retention_period = "4w";
retention_period = "1w";
split_queries_by_interval = "0";
volume_enabled = true;
};