From 9df1d75d03c9a5ed10465b8dd12ce95bfcc0ef41 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Tue, 7 May 2024 11:06:10 -0600 Subject: [PATCH] loki: fix config Signed-off-by: Sumner Evans --- nixos/modules/services/loki.nix | 56 ++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/nixos/modules/services/loki.nix b/nixos/modules/services/loki.nix index d540b42..ec2a0b7 100644 --- a/nixos/modules/services/loki.nix +++ b/nixos/modules/services/loki.nix @@ -3,7 +3,34 @@ let lokiCfg = config.services.loki; in lib.mkIf lokiCfg.enable { services.loki.configuration = { auth_enabled = false; - server = { http_listen_port = 3100; }; + server.http_listen_port = 3100; + + common = { + ring = { + instance_addr = "0.0.0.0"; + kvstore.store = "inmemory"; + }; + replication_factor = 1; + path_prefix = "/tmp/loki"; + }; + + schema_config = { + configs = [ + { + from = "2024-05-07"; + store = "tsdb"; + object_store = "filesystem"; + schema = "v13"; + index = { + prefix = "index_"; + period = "24h"; + }; + } + ]; + }; + + storage_config.filesystem.directory = "/var/lib/loki/chunks"; + ingester = { lifecycler.ring = { kvstore.store = "inmemory"; @@ -11,47 +38,24 @@ in lib.mkIf lokiCfg.enable { }; chunk_idle_period = "1h"; chunk_target_size = 1048576; - max_transfer_retries = 0; - }; - schema_config = { - configs = [{ - from = "2022-03-03"; - store = "boltdb-shipper"; - object_store = "filesystem"; - schema = "v11"; - index = { - prefix = "index_"; - period = "24h"; - }; - }]; - }; - storage_config = { - boltdb_shipper = { - active_index_directory = "/var/lib/loki/boltdb-shipper-active"; - cache_location = "/var/lib/loki/boltdb-shipper-cache"; - cache_ttl = "24h"; - shared_store = "filesystem"; - }; - filesystem.directory = "/var/lib/loki/chunks"; }; + limits_config = { retention_period = "744h"; reject_old_samples = true; reject_old_samples_max_age = "168h"; }; - chunk_store_config.max_look_back_period = "0s"; table_manager = { retention_deletes_enabled = false; retention_period = "0s"; }; compactor = { working_directory = "/var/lib/loki"; - shared_store = "filesystem"; - compactor_ring.kvstore.store = "inmemory"; compaction_interval = "10m"; retention_enabled = true; retention_delete_delay = "2h"; retention_delete_worker_count = 20; + delete_request_store = "filesystem"; }; };