modules/prometheus: split exporters and alerts to seperate files

This commit is contained in:
xinyangli 2024-07-31 14:27:03 +08:00
parent 9b38853216
commit 5fe7ff0434
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
7 changed files with 317 additions and 246 deletions

View file

@ -0,0 +1,17 @@
{ config, lib, ... }:
let
cfg = config.custom.prometheus;
in
{
config = lib.mkIf cfg.enable {
services.ntfy-sh.settings.enable-metrics = true;
services.prometheus.scrapeConfigs = [
(lib.mkIf cfg.exporters.ntfy-sh.enable {
job_name = "ntfy-sh";
static_configs = [
{ targets = [ "ntfy.xinyang.life" ]; }
];
})
];
};
}