services: monitoring: set prometheus scrape interval
This commit is contained in:
parent
40bb8ff33b
commit
0f4ae45828
|
@ -15,6 +15,13 @@ in {
|
||||||
example = "monitoring.example.com";
|
example = "monitoring.example.com";
|
||||||
description = "Domain to use in reverse proxy";
|
description = "Domain to use in reverse proxy";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
scrapeInterval = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "15s";
|
||||||
|
example = "1m";
|
||||||
|
description = "prometheus scrape interval";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -32,6 +39,9 @@ in {
|
||||||
name = "Prometheus";
|
name = "Prometheus";
|
||||||
type = "prometheus";
|
type = "prometheus";
|
||||||
url = "http://localhost:${toString config.services.prometheus.port}";
|
url = "http://localhost:${toString config.services.prometheus.port}";
|
||||||
|
jsonData = {
|
||||||
|
timeInterval = cfg.scrapeInterval;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -66,6 +76,10 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
globalConfig = {
|
||||||
|
scrape_interval = cfg.scrapeInterval;
|
||||||
|
};
|
||||||
|
|
||||||
scrapeConfigs = [
|
scrapeConfigs = [
|
||||||
{
|
{
|
||||||
job_name = config.networking.hostName;
|
job_name = config.networking.hostName;
|
||||||
|
|
Loading…
Reference in a new issue