diff options
Diffstat (limited to 'krebs/2configs/shack/prometheus/server.nix')
-rw-r--r-- | krebs/2configs/shack/prometheus/server.nix | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/krebs/2configs/shack/prometheus/server.nix b/krebs/2configs/shack/prometheus/server.nix index c936f253..7f6f3861 100644 --- a/krebs/2configs/shack/prometheus/server.nix +++ b/krebs/2configs/shack/prometheus/server.nix @@ -3,18 +3,23 @@ { networking = { firewall.allowedTCPPorts = [ - 3000 # grafana 9090 # prometheus 9093 # alertmanager ]; - useDHCP = true; }; - services = { + nginx.virtualHosts = { + "prometheus.shack" = { + locations."/".proxyPass = "http://localhost:9090"; + }; + "alert.prometheus.shack" = { + locations."/".proxyPass = "http://localhost:9093"; + }; + }; prometheus = { enable = true; extraFlags = [ - "-storage.local.retention 8760h" + "-storage.local.retention 720h" "-storage.local.series-file-shrink-ratio 0.3" "-storage.local.memory-chunks 2097152" "-storage.local.max-chunks-to-persist 1048576" @@ -23,7 +28,6 @@ "-storage.local.index-cache-size.label-name-to-label-values 2097152" "-storage.local.index-cache-size.label-pair-to-fingerprints 41943040" ]; - alertmanagerURL = [ "http://localhost:9093" ]; rules = [ '' ALERT node_down @@ -156,6 +160,12 @@ ]; } ]; + alertmanagers = [ + { scheme = "http"; + path_prefix = "/"; + static_configs = [ { targets = [ "localhost:9093" ]; } ]; + } + ]; alertmanager = { enable = true; listenAddress = "0.0.0.0"; |