summaryrefslogtreecommitdiff
path: root/os/srv/loki.nix
diff options
context:
space:
mode:
Diffstat (limited to 'os/srv/loki.nix')
-rw-r--r--os/srv/loki.nix93
1 files changed, 49 insertions, 44 deletions
diff --git a/os/srv/loki.nix b/os/srv/loki.nix
index 2388432..84b94d8 100644
--- a/os/srv/loki.nix
+++ b/os/srv/loki.nix
@@ -1,9 +1,4 @@
-{
- config,
- lib,
- pkgs,
- ...
-}:
+{ config, lib, ... }:
let
cfg = config.os.srv.loki;
in
@@ -12,46 +7,56 @@ in
config = lib.mkIf cfg.enable {
services.loki = {
enable = true;
- configFile = pkgs.writeText "loki-config.yaml" (
- builtins.toJSON {
- auth_enabled = false;
- server = {
- http_listen_port = 3100;
- };
- common = {
- ring = {
- kvstore = {
- store = "inmemory";
- };
- };
- instance_interface_names = [ "lo" ];
+ configuration = {
+ server = {
+ http_listen_address = "0.0.0.0";
+ http_compress_responses = true;
+ };
+
+ common = {
+ instance_addr = "127.0.0.1";
+ path_prefix = "/var/lib/loki";
+ replication_factor = 1;
+
+ storage.filesystem = {
+ chunks_directory = "/var/lib/loki/chunks";
+ rules_directory = "/var/lib/loki/rules";
};
- ingester = {
- lifecycler = {
- address = "127.0.0.1";
+ };
+
+ schema_config.configs = [
+ {
+ from = "2026-01-01";
+ store = "tsdb";
+ object_store = "filesystem";
+ schema = "v13";
+ index = {
+ prefix = "loki_index_";
+ period = "24h";
};
- };
- storage_config = {
- filesystem = {
- directory = "/var/lib/loki/chunks";
- };
- };
- schema_config = {
- configs = [
- {
- from = "2020-10-24";
- store = "tsdb";
- object_store = "filesystem";
- schema = "v13";
- index = {
- prefix = "index_";
- period = "24h";
- };
- }
- ];
- };
- }
- );
+ }
+ ];
+
+ ingester.wal.enabled = true;
+
+ limits_config = {
+ max_entries_limit_per_query = 10000;
+ reject_old_samples_max_age = "720h";
+ retention_period = "90d";
+ volume_enabled = true;
+ };
+
+ compactor = {
+ enabled = true;
+ retention_enabled = true;
+ retention_delete_delay = "1h";
+ compactor_window = "168h";
+ };
+
+ querier.query_timeout = "5m";
+ query_range.out_of_order_time_shifting = "5m";
+ analytics.reporting_enabled = false;
+ };
};
};
}