alloy: Add assertions for log/metric collection dependencies

This commit is contained in:
SebastianStork 2025-09-21 17:38:53 +02:00
parent 45d6b5ee7c
commit 9bc7a2e737

View file

@ -29,6 +29,17 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
assertions = [
{
assertion = cfg.collect.victorialogsMetrics -> config.services.victorialogs.enable;
message = "Collecting VictoriaLogs metrics requires the VictoriaLogs service to be enabled.";
}
{
assertion = cfg.collect.sshdLogs -> config.services.openssh.enable;
message = "Collecting OpenSSH logs requires the OpenSSH service to be enabled.";
}
];
meta = { meta = {
domains.list = [ cfg.domain ]; domains.list = [ cfg.domain ];
ports.tcp.list = [ cfg.port ]; ports.tcp.list = [ cfg.port ];