From d3fedd84e9eb9019ecd6cc4f53045f51bbe21325 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 8 Jun 2024 23:53:43 +0200 Subject: [PATCH] loki: tune settings, enable cache --- modules/loki/default.nix | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/modules/loki/default.nix b/modules/loki/default.nix index bd28afe8..0c3ea193 100644 --- a/modules/loki/default.nix +++ b/modules/loki/default.nix @@ -33,9 +33,36 @@ }; }; }; + ingester = { + chunk_encoding = "snappy"; + chunk_idle_period = "1h"; + }; + query_range = { + results_cache = { + cache = { + embedded_cache = { + enabled = true; + max_size_mb = 500; + }; + }; + }; + }; + chunk_store_config = { + max_look_back_period = "0s"; + chunk_cache_config = { + embedded_cache = { + enabled = true; + max_size_mb = 500; + ttl = "24h"; + }; + }; + }; # Keep logs for 4 weeks # https://grafana.com/docs/loki/latest/operations/storage/retention/ - limits_config.retention_period = "4w"; + limits_config = { + retention_period = "4w"; + split_queries_by_interval = "0"; + }; compactor = { shared_store = "filesystem"; compaction_interval = "10m";