modules: services: monitoring: add scrape interval

This commit is contained in:
Bruno BELANYI 2021-07-15 18:50:04 +02:00
parent 2bfbda9942
commit eba977b582

View file

@ -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;