modules: services: monitoring: add scrape interval
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a3293277d9
commit
820b52314f
|
@ -39,6 +39,13 @@ in
|
||||||
example = 3002;
|
example = 3002;
|
||||||
description = "Internal port";
|
description = "Internal port";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
scrapeInterval = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "15s";
|
||||||
|
example = "1m";
|
||||||
|
description = "Scrape interval";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,6 +69,9 @@ in
|
||||||
name = "Prometheus";
|
name = "Prometheus";
|
||||||
type = "prometheus";
|
type = "prometheus";
|
||||||
url = "http://localhost:${toString cfg.prometheus.port}";
|
url = "http://localhost:${toString cfg.prometheus.port}";
|
||||||
|
jsonData = {
|
||||||
|
timeInterval = cfg.prometheus.scrapeInterval;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -91,6 +101,10 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
globalConfig = {
|
||||||
|
scrape_interval = cfg.prometheus.scrapeInterval;
|
||||||
|
};
|
||||||
|
|
||||||
scrapeConfigs = [
|
scrapeConfigs = [
|
||||||
{
|
{
|
||||||
job_name = config.networking.hostName;
|
job_name = config.networking.hostName;
|
||||||
|
|
Loading…
Reference in a new issue