monitoring02: enable alerting and add monitoring/alertmanager CNAMEs
Some checks failed
Run nix flake check / flake-check (push) Has been cancelled
Some checks failed
Run nix flake check / flake-check (push) Has been cancelled
- Switch vmalert from blackhole mode to sending alerts to local Alertmanager - Import alerttonotify service so alerts route to NATS notifications - Add monitoring and alertmanager CNAMEs to monitoring02 - Add Caddy reverse proxy for alertmanager.home.2rjus.net Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
role = "monitoring";
|
role = "monitoring";
|
||||||
};
|
};
|
||||||
|
|
||||||
homelab.dns.cnames = [ "grafana-test" "metrics" "vmalert" "loki" ];
|
homelab.dns.cnames = [ "monitoring" "alertmanager" "grafana-test" "metrics" "vmalert" "loki" ];
|
||||||
|
|
||||||
# Enable Vault integration
|
# Enable Vault integration
|
||||||
vault.enable = true;
|
vault.enable = true;
|
||||||
|
|||||||
@@ -4,5 +4,6 @@
|
|||||||
../../services/grafana
|
../../services/grafana
|
||||||
../../services/victoriametrics
|
../../services/victoriametrics
|
||||||
../../services/loki
|
../../services/loki
|
||||||
|
../../services/monitoring/alerttonotify.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -170,15 +170,12 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# vmalert for alerting rules - no notifier during parallel operation
|
# vmalert for alerting rules
|
||||||
services.vmalert.instances.default = {
|
services.vmalert.instances.default = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
"datasource.url" = "http://localhost:8428";
|
"datasource.url" = "http://localhost:8428";
|
||||||
# Blackhole notifications during parallel operation to prevent duplicate alerts.
|
"notifier.url" = [ "http://localhost:9093" ];
|
||||||
# Replace with notifier.url after cutover from monitoring01:
|
|
||||||
# "notifier.url" = [ "http://localhost:9093" ];
|
|
||||||
"notifier.blackhole" = true;
|
|
||||||
"rule" = [ ../monitoring/rules.yml ];
|
"rule" = [ ../monitoring/rules.yml ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -191,8 +188,11 @@ in
|
|||||||
reverse_proxy http://127.0.0.1:8880
|
reverse_proxy http://127.0.0.1:8880
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Alertmanager - same config as monitoring01 but will only receive
|
# Alertmanager
|
||||||
# alerts after cutover (vmalert notifier is disabled above)
|
services.caddy.virtualHosts."alertmanager.home.2rjus.net".extraConfig = ''
|
||||||
|
reverse_proxy http://127.0.0.1:9093
|
||||||
|
'';
|
||||||
|
|
||||||
services.prometheus.alertmanager = {
|
services.prometheus.alertmanager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configuration = {
|
configuration = {
|
||||||
|
|||||||
Reference in New Issue
Block a user