cluster/services/monitoring: make blackbox targets configurable through cluster config

This commit is contained in:
Max Headroom 2023-06-04 23:06:53 +02:00
parent b499223e2a
commit 7f9742089b
3 changed files with 30 additions and 6 deletions

View file

@ -68,12 +68,7 @@ in
}; };
}; };
blackbox_targets = let blackbox_targets = let
regularTargets = mapTargets { regularTargets = mapTargets cluster.config.monitoring.blackbox.targets;
web = {
module = "https2xx";
address = "https://www.${domain}";
};
};
secretTargets = mkSecretTargets 1; secretTargets = mkSecretTargets 1;
in regularTargets ++ secretTargets; in regularTargets ++ secretTargets;
}; };

View file

@ -9,6 +9,10 @@ let
in in
{ {
imports = [
./options.nix
];
links = { links = {
loki-ingest = { loki-ingest = {
protocol = "http"; protocol = "http";

View file

@ -0,0 +1,25 @@
{ lib, ... }:
with lib;
{
options.monitoring = {
blackbox = {
targets = mkOption {
description = "Blackbox targets to be monitored by the cluster.";
default = {};
type = with types; attrsOf (submodule ({ ... }: {
options = {
module = mkOption {
description = "The Blackbox module to use.";
type = types.str;
};
address = mkOption {
description = "The target's address.";
type = types.str;
};
};
}));
};
};
};
}