prometheus/module.nix: add nginx
This commit is contained in:
parent
9454d21bbd
commit
1142f10c18
1 changed files with 9 additions and 4 deletions
|
@ -13,10 +13,6 @@ in {
|
|||
options.modules.system.services.prometheus.enable = mkEnableOption "Grafana, a graphing service";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
networking.firewall.allowedTCPPorts = [config.services.grafana.settings.server.http_port];
|
||||
|
||||
modules.system.services.database.postgresql.enable = true;
|
||||
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
package = pkgs.prometheus;
|
||||
|
@ -34,6 +30,10 @@ in {
|
|||
port = 4024;
|
||||
user = "postgres";
|
||||
};
|
||||
nginx = {
|
||||
enable = true;
|
||||
port = 4025;
|
||||
};
|
||||
};
|
||||
scrapeConfigs = [
|
||||
{
|
||||
|
@ -51,6 +51,11 @@ in {
|
|||
scrape_interval = "30s";
|
||||
static_configs = [{targets = ["localhost:${toString config.services.prometheus.exporters.postgres.port}"];}];
|
||||
}
|
||||
{
|
||||
job_name = "nginx";
|
||||
scrape_interval = "30s";
|
||||
static_configs = [{targets = ["localhost:${toString config.services.prometheus.exporters.nginx.port}"];}];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue