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
regularTargets = mapTargets {
web = {
module = "https2xx";
address = "https://www.${domain}";
};
};
regularTargets = mapTargets cluster.config.monitoring.blackbox.targets;
secretTargets = mkSecretTargets 1;
in regularTargets ++ secretTargets;
};

View file

@ -9,6 +9,10 @@ let
in
{
imports = [
./options.nix
];
links = {
loki-ingest = {
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;
};
};
}));
};
};
};
}