From 38f9a3e1bb38e72066dfc3eef3c7b5819387ec85 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Fri, 26 Sep 2025 19:04:41 +0800 Subject: [PATCH] fix: vmalert - remoteWrite --- hosts/idols-aquamarine/monitoring/alert.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hosts/idols-aquamarine/monitoring/alert.nix b/hosts/idols-aquamarine/monitoring/alert.nix index 0013ac1b..f13db13b 100644 --- a/hosts/idols-aquamarine/monitoring/alert.nix +++ b/hosts/idols-aquamarine/monitoring/alert.nix @@ -1,12 +1,16 @@ -{ config, lib, ... }: +{ config, ... }: { - services.vmalert = { + # https://docs.victoriametrics.com/victoriametrics/vmalert/ + services.vmalert.instances."homelab" = { enable = true; settings = { "httpListenAddr" = "127.0.0.1:8880"; "datasource.url" = "http://localhost:9090"; "notifier.url" = [ "http://localhost:9093" ]; # alertmanager's api + # Recording rules results are persisted via remote write. + "remoteWrite.url" = "http://localhost:9090"; + "remoteRead.url" = "http://localhost:9090"; # Whether to disable long-lived connections to the datasource. "datasource.disableKeepAlive" = true;