From 9f158f15a411d89e74eb108f0b78fa788a3f4583 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 3 Aug 2024 00:12:15 +0200 Subject: [PATCH] cluster/services/monitoring: run loki over ways --- cluster/services/monitoring/default.nix | 16 +++++++++++++--- cluster/services/monitoring/grafana-ha.nix | 2 +- cluster/services/monitoring/logging.nix | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/cluster/services/monitoring/default.nix b/cluster/services/monitoring/default.nix index 80a73ae..80f1ebb 100644 --- a/cluster/services/monitoring/default.nix +++ b/cluster/services/monitoring/default.nix @@ -87,8 +87,18 @@ in }; }; - ways.monitoring = { - consulService = "grafana"; - extras.locations."/".proxyWebsockets = true; + ways = { + monitoring = { + consulService = "grafana"; + extras.locations."/".proxyWebsockets = true; + }; + monitoring-logs = { + internal = true; + consulService = "loki"; + extras.extraConfig = '' + client_max_body_size 4G; + proxy_read_timeout 3600s; + ''; + }; }; } diff --git a/cluster/services/monitoring/grafana-ha.nix b/cluster/services/monitoring/grafana-ha.nix index 6451617..b0ea108 100644 --- a/cluster/services/monitoring/grafana-ha.nix +++ b/cluster/services/monitoring/grafana-ha.nix @@ -70,7 +70,7 @@ in { name = "Loki"; uid = "P8E80F9AEF21F6940"; - inherit (loki-ingest) url; + inherit (cluster.config.ways.monitoring-logs) url; type = "loki"; } ]; diff --git a/cluster/services/monitoring/logging.nix b/cluster/services/monitoring/logging.nix index 089e0cb..2f52332 100644 --- a/cluster/services/monitoring/logging.nix +++ b/cluster/services/monitoring/logging.nix @@ -104,4 +104,20 @@ in querier.max_concurrent = 16; }; }; + + consul.services.loki = { + definition = { + name = "loki"; + address = loki-ingest.ipv4; + inherit (loki-ingest) port; + checks = [ + { + name = "Loki"; + id = "service:loki:backend"; + interval = "5s"; + http = "${loki-ingest.url}/ready"; + } + ]; + }; + }; }