rico1: add alertmanager
This commit is contained in:
parent
e1556fa6cb
commit
139fb1816e
3 changed files with 51 additions and 1 deletions
49
hosts/rico1/services/apps/alertmanager.nix
Normal file
49
hosts/rico1/services/apps/alertmanager.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
_:
|
||||
let
|
||||
inherit (import ../../../shared/caddy-helpers.nix) logFormat;
|
||||
domainName = "alertmanager.labs.adtya.xyz";
|
||||
in
|
||||
{
|
||||
services = {
|
||||
caddy = {
|
||||
virtualHosts."${domainName}" = {
|
||||
logFormat = logFormat "${domainName}";
|
||||
extraConfig = ''
|
||||
reverse_proxy 127.0.0.1:9093
|
||||
'';
|
||||
};
|
||||
};
|
||||
prometheus.alertmanager = {
|
||||
enable = true;
|
||||
listenAddress = "127.0.0.1";
|
||||
port = 9093;
|
||||
webExternalUrl = "https://${domainName}/";
|
||||
configuration = {
|
||||
route = {
|
||||
group_by = [ "alertname" ];
|
||||
group_wait = "30s";
|
||||
group_interval = "5m";
|
||||
repeat_interval = "1h";
|
||||
receiver = "web.hook";
|
||||
};
|
||||
receivers = [
|
||||
{
|
||||
name = "web.hook";
|
||||
webhook_configs = [
|
||||
{ url = "http://127.0.0.1:5001/"; }
|
||||
];
|
||||
}
|
||||
];
|
||||
inhibit_rules = [
|
||||
{
|
||||
source_match =
|
||||
{ severity = "critical"; };
|
||||
target_match =
|
||||
{ severity = "warning"; };
|
||||
equal = [ "alertname" "dev" "instance" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -74,7 +74,7 @@ in
|
|||
"rico2.labs.adtya.xyz" = "10.10.10.12";
|
||||
"wynne.labs.adtya.xyz" = "10.10.10.13";
|
||||
"layne.labs.adtya.xyz" = "10.10.10.14";
|
||||
"alertmanager.labs.adtya.xyz" = "10.10.10.10";
|
||||
"alertmanager.labs.adtya.xyz" = "10.10.10.11";
|
||||
"blocky.labs.adtya.xyz" = "10.10.10.11";
|
||||
"frp.labs.adtya.xyz" = "10.10.10.10";
|
||||
"grafana.labs.adtya.xyz" = "10.10.10.10";
|
||||
|
|
|
@ -3,6 +3,7 @@ _: {
|
|||
./adtya.xyz.nix
|
||||
./proofs.nix
|
||||
./wiki.nix
|
||||
./alertmanager.nix
|
||||
./blocky.nix
|
||||
../../../shared/prometheus-exporters.nix
|
||||
../../../shared/promtail.nix
|
||||
|
|
Loading…
Reference in a new issue