diff --git a/services/monitoring.nix b/services/monitoring.nix index ff37171..930743e 100644 --- a/services/monitoring.nix +++ b/services/monitoring.nix @@ -15,6 +15,13 @@ in { example = "monitoring.example.com"; description = "Domain to use in reverse proxy"; }; + + scrapeInterval = mkOption { + type = types.str; + default = "15s"; + example = "1m"; + description = "prometheus scrape interval"; + }; }; config = mkIf cfg.enable { @@ -32,6 +39,9 @@ in { name = "Prometheus"; type = "prometheus"; url = "http://localhost:${toString config.services.prometheus.port}"; + jsonData = { + timeInterval = cfg.scrapeInterval; + }; } ]; @@ -66,6 +76,10 @@ in { }; }; + globalConfig = { + scrape_interval = cfg.scrapeInterval; + }; + scrapeConfigs = [ { job_name = config.networking.hostName;