2023-07-12 01:45:59 +02:00
|
|
|
{ config, ... }: let
|
|
|
|
cfg = config.services.prometheus;
|
|
|
|
in {
|
|
|
|
services.prometheus = {
|
|
|
|
scrapeConfigs = [{
|
|
|
|
job_name = "nginx";
|
|
|
|
scrape_interval = "15s";
|
|
|
|
static_configs = [{
|
|
|
|
targets = [ "${cfg.exporters.nginx.listenAddress}:${toString cfg.exporters.nginx.port}" ];
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
|
|
|
|
exporters.nginx = {
|
|
|
|
enable = true;
|
|
|
|
listenAddress = "127.0.0.1";
|
|
|
|
};
|
|
|
|
};
|
2024-01-23 05:26:22 +01:00
|
|
|
|
|
|
|
systemd.services.prometheus-nginx-exporter.serviceConfig.Slice = "system-prometheus.slice";
|
2023-07-12 01:45:59 +02:00
|
|
|
}
|