cluster/services/monitoring: make blackbox targets configurable through cluster config
This commit is contained in:
parent
b499223e2a
commit
7f9742089b
3 changed files with 30 additions and 6 deletions
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,6 +9,10 @@ let
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
./options.nix
|
||||||
|
];
|
||||||
|
|
||||||
links = {
|
links = {
|
||||||
loki-ingest = {
|
loki-ingest = {
|
||||||
protocol = "http";
|
protocol = "http";
|
||||||
|
|
25
cluster/services/monitoring/options.nix
Normal file
25
cluster/services/monitoring/options.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue