From eba977b582d2c21330d95197227d4451f3a7b1f2 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 15 Jul 2021 18:50:04 +0200 Subject: [PATCH] modules: services: monitoring: add scrape interval --- modules/services/monitoring.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/services/monitoring.nix b/modules/services/monitoring.nix index 8146eca..f76337a 100644 --- a/modules/services/monitoring.nix +++ b/modules/services/monitoring.nix @@ -39,6 +39,13 @@ in example = 3002; description = "Internal port"; }; + + scrapeInterval = mkOption { + type = types.str; + default = "15s"; + example = "1m"; + description = "Scrape interval"; + }; }; }; @@ -62,6 +69,9 @@ in name = "Prometheus"; type = "prometheus"; url = "http://localhost:${toString cfg.prometheus.port}"; + jsonData = { + timeInterval = cfg.prometheus.scrapeInterval; + }; } ]; @@ -91,6 +101,10 @@ in }; }; + globalConfig = { + scrape_interval = cfg.prometheus.scrapeInterval; + }; + scrapeConfigs = [ { job_name = config.networking.hostName;