diff --git a/flake.lock b/flake.lock index 889ccc4..8658e30 100644 --- a/flake.lock +++ b/flake.lock @@ -9,11 +9,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1744897914, - "narHash": "sha256-GIVU92o2TZBnKQXTb76zpQbWR4zjU2rFqWKNIIpXnqA=", + "lastModified": 1741508717, + "narHash": "sha256-iQf1WdNxaApOFHIx4RLMRZ4f8g+8Xp0Z1/E/Mz2rLxY=", "owner": "yaxitech", "repo": "ragenix", - "rev": "40f2e17ecaeab4d78ec323e96a04548c0aaa5223", + "rev": "2a2bea99d74927e54adf53cbf113219def67d5c9", "type": "github" }, "original": { @@ -169,11 +169,11 @@ ] }, "locked": { - "lastModified": 1747020534, - "narHash": "sha256-D/6rkiC6w2p+4SwRiVKrWIeYzun8FBg7NlMKMwQMxO0=", + "lastModified": 1744117652, + "narHash": "sha256-t7dFCDl4vIOOUMhEZnJF15aAzkpaup9x4ZRGToDFYWI=", "owner": "nix-community", "repo": "home-manager", - "rev": "b4bbdc6fde16fc2051fcde232f6e288cd22007ca", + "rev": "b4e98224ad1336751a2ac7493967a4c9f6d9cb3f", "type": "github" }, "original": { @@ -201,11 +201,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1746957726, - "narHash": "sha256-k9ut1LSfHCr0AW82ttEQzXVCqmyWVA5+SHJkS5ID/Jo=", + "lastModified": 1744309437, + "narHash": "sha256-QZnNHM823am8apCqKSPdtnzPGTy2ZB4zIXOVoBp5+W0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a39ed32a651fdee6842ec930761e31d1f242cb94", + "rev": "f9ebe33a928b5d529c895202263a5ce46bdf12f7", "type": "github" }, "original": { diff --git a/services/grafana/default.nix b/services/grafana/default.nix index 01386de..172ff0e 100644 --- a/services/grafana/default.nix +++ b/services/grafana/default.nix @@ -55,6 +55,20 @@ in { ]; }; }; + rsyslogd = { + enable = true; + extraConfig = '' + ruleset(name="remote"){ + action(type="omfwd" Target="localhost" Port="1514" Protocol="tcp" Template="RSYSLOG_SyslogProtocol23Format" TCP_Framing="octet-counted") + } + + module(load="imudp") + input(type="imudp" port="514" ruleset="remote") + + module(load="imtcp") + input(type="imtcp" port="514" ruleset="remote") + ''; + }; influxdb2 = { enable = true; }; @@ -256,20 +270,59 @@ in { loki = { enable = true; configuration = { + server.http_listen_port = 3100; + server.grpc_listen_port = 9096; auth_enabled = false; - server = { - http_listen_port = 3100; - grpc_listen_port = 9096; - }; - common = { - instance_addr = "0.0.0.0"; - path_prefix = "/tmp/loki"; - storage.filesystem = { - chunks_directory = "/tmp/loki/chunks"; - rules_directory = "/tmp/loki/rules"; + ingester = { + lifecycler = { + address = "192.168.1.27"; + ring = { + kvstore = { + store = "inmemory"; + }; + replication_factor = 1; + }; }; - replication_factor = 1; - ring.kvstore.store = "inmemory"; + chunk_idle_period = "1h"; + max_chunk_age = "1h"; + chunk_target_size = 999999; + chunk_retain_period = "30s"; + }; + schema_config = { + configs = [ + { + from = "2022-06-06"; + store = "boltdb-shipper"; + object_store = "filesystem"; + schema = "v13"; + 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"; + }; + + filesystem = { + directory = "/var/lib/loki/chunks"; + }; + }; + + limits_config = { + reject_old_samples = true; + reject_old_samples_max_age = "168h"; + allow_structured_metadata = false; + }; + + table_manager = { + retention_deletes_enabled = false; + retention_period = "0s"; }; compactor = { working_directory = "/var/lib/loki"; @@ -279,24 +332,6 @@ in { }; }; }; - query_range.results_cache.cache.embedded_cache = { - enabled = true; - max_size_mb = 100; - }; - schema_config.configs = [ - { - from = "2025-05-13"; - store = "tsdb"; - object_store = "filesystem"; - schema = "v13"; - index = { - prefix = "index_"; - period = "24h"; - }; - } - ]; - ruler.alertmanager_url = "http://localhost:9093"; - analytics.reporting_enabled = false; }; }; promtail = { diff --git a/systems/minimalLXCConfig.nix b/systems/minimalLXCConfig.nix index 2834477..9de7c03 100644 --- a/systems/minimalLXCConfig.nix +++ b/systems/minimalLXCConfig.nix @@ -128,9 +128,7 @@ }; rsyslogd = { enable = true; - extraConfig = '' - *.* action(type="omfwd" target="192.168.1.27" port="1514" protocol="tcp") - ''; + extraConfig = "*.*@192.168.1.27:514;RSYSLOG_SyslogProtocol23Format"; }; prometheus = { exporters = { diff --git a/systems/minimalMicrovmConfig.nix b/systems/minimalMicrovmConfig.nix index e0bc8d5..0284417 100644 --- a/systems/minimalMicrovmConfig.nix +++ b/systems/minimalMicrovmConfig.nix @@ -181,7 +181,7 @@ in { }; rsyslogd = { enable = true; - extraConfig = "*.*@192.168.1.27:1514;RSYSLOG_SyslogProtocol23Format"; + extraConfig = "*.*@192.168.1.27:514;RSYSLOG_SyslogProtocol23Format"; }; prometheus = { exporters = { diff --git a/systems/minimalVMConfig.nix b/systems/minimalVMConfig.nix index c8cf91b..8eeb24e 100644 --- a/systems/minimalVMConfig.nix +++ b/systems/minimalVMConfig.nix @@ -115,7 +115,7 @@ }; rsyslogd = { enable = true; - extraConfig = "*.*@192.168.1.27:1514;RSYSLOG_SyslogProtocol23Format"; + extraConfig = "*.*@192.168.1.27:514;RSYSLOG_SyslogProtocol23Format"; }; prometheus = { exporters = {