nix-infra/hosts/monitoring/loki.nix
2026-09-10 23:39:52 +02:00

50 lines
1.2 KiB
Nix

{
services.loki = {
enable = true;
extraFlags = [ "--target=all" ];
configuration = {
server = {
http_listen_address = "127.0.0.1";
http_listen_port = 3100;
};
auth_enabled = false;
# from https://grafana.com/docs/loki/latest/configure/examples/configuration-examples/#1-local-configuration-exampleyaml
common = {
ring = {
instance_addr = "127.0.0.1";
kvstore.store = "inmemory";
};
replication_factor = 1;
path_prefix = "/var/lib/loki";
};
schema_config.configs = [
{
from = "2020-10-24";
store = "tsdb";
object_store = "filesystem";
schema = "v13";
index = {
prefix = "index_";
period = "24h";
};
}
];
storage_config.filesystem.directory = "/var/lib/loki/chunks";
compactor = {
retention_enabled = true;
compaction_interval = "1h";
retention_delete_delay = "2h";
retention_delete_worker_count = 10;
delete_request_store = "filesystem";
};
limits_config = {
retention_period = "17520h"; # 2 Years
};
analytics.reporting_enabled = false;
};
};
}