dotfiles/nixos/boxes/bolty/logs.nix

102 lines
2.2 KiB
Nix
Raw Normal View History

2023-10-29 11:36:28 +00:00
{
config,
lib,
...
}: let
lokiPort = 3030;
2023-10-29 12:21:13 +00:00
promtailPort = 3031;
2023-10-29 11:36:28 +00:00
path = "/data/loki";
in {
services.loki = {
enable = true;
configuration = {
2023-10-29 12:21:13 +00:00
server.http_listen_address = "0.0.0.0";
2023-10-29 11:36:28 +00:00
server.http_listen_port = lokiPort;
auth_enabled = false;
ingester = {
lifecycler = {
address = "127.0.0.1";
ring = {
kvstore = {
store = "inmemory";
};
replication_factor = 1;
};
};
chunk_idle_period = "1h";
max_chunk_age = "1h";
chunk_target_size = 999999;
chunk_retain_period = "30s";
};
schema_config = {
configs = [
{
from = "2023-10-28";
store = "tsdb";
object_store = "filesystem";
2024-06-13 17:13:54 +01:00
schema = "v13";
2023-10-29 11:36:28 +00:00
index = {
prefix = "index_";
period = "24h";
};
}
];
};
storage_config = {
tsdb_shipper = {
active_index_directory = "${path}/tsdb-index";
cache_location = "${path}/tsdb-cache";
cache_ttl = "24h";
};
filesystem = {
directory = "${path}/chunks";
};
};
limits_config = {
reject_old_samples = true;
reject_old_samples_max_age = "168h";
split_queries_by_interval = "24h";
max_query_parallelism = 100;
};
query_scheduler = {
max_outstanding_requests_per_tenant = 4096;
};
frontend = {
max_outstanding_per_tenant = 4096;
};
table_manager = {
retention_deletes_enabled = true;
retention_period = "48h";
};
compactor = {
working_directory = "${path}";
compactor_ring = {
kvstore = {
store = "inmemory";
};
};
};
ruler = {
enable_api = true;
enable_alertmanager_v2 = true;
ring.kvstore.store = "inmemory";
rule_path = "${path}/rules-temp";
alertmanager_url = "http://127.0.0.1:${toString config.services.prometheus.alertmanager.port}";
storage = {
type = "local";
local.directory = "${path}/rules";
};
};
};
};
}