modules/prometheus: add blackbox exporter

This commit is contained in:
xinyangli 2024-07-31 15:37:42 +08:00
parent 5fe7ff0434
commit daeeb211a2
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
6 changed files with 105 additions and 14 deletions

View file

@ -4,7 +4,6 @@ with lib;
let
cfg = config.custom.prometheus;
exporterCfg = config.custom.prometheus.exporters;
mkExporterOption = enableOption: (mkOption {
type = types.bool;
default = enableOption;
@ -26,6 +25,7 @@ let
in
{
imports = [
./blackbox.nix
./caddy.nix
./gotosocial.nix
./ntfy-sh.nix
@ -43,6 +43,7 @@ in
};
restic.enable = mkExporterOption config.services.restic.server.enable;
blackbox.enable = mkExporterOption false;
caddy.enable = mkExporterOption config.services.caddy.enable;
gotosocial.enable = mkExporterOption config.services.gotosocial.enable;
ntfy-sh.enable = mkExporterOption config.services.gotosocial.enable;
@ -187,6 +188,13 @@ in
labels = { severity = "critical"; };
annotations = { summary = "Outbound network traffic exceed 300GB for last 30 day"; };
}
{
alert = "JobDown";
expr = "up == 0";
for = "1m";
labels = { severity = "critical"; };
annotations = { summary = "Job {{ $labels.job }} down for 1m."; };
}
];
}
];