diff --git a/hosts/nixos/common/optional/services/nginx.nix b/hosts/nixos/common/optional/services/nginx.nix index 8eddfaa..78fa5ec 100644 --- a/hosts/nixos/common/optional/services/nginx.nix +++ b/hosts/nixos/common/optional/services/nginx.nix @@ -6,5 +6,6 @@ recommendedOptimisation = true; recommendedProxySettings = true; recommendedTlsSettings = true; + statusPage = true; # Necessary for prometheus exporter }; } diff --git a/hosts/nixos/lapetus/services/prometheus.nix b/hosts/nixos/lapetus/services/prometheus.nix index f284089..b4b775a 100644 --- a/hosts/nixos/lapetus/services/prometheus.nix +++ b/hosts/nixos/lapetus/services/prometheus.nix @@ -10,19 +10,28 @@ in port = 8410; webExternalUrl = "https://${host}"; - # {{{ Node exporter (system info) + # {{{ Base exporters exporters = { + # System info node = { enable = true; enabledCollectors = [ "systemd" ]; port = 8411; }; + + nginx = { + enable = true; + port = 8412; + }; }; scrapeConfigs = [{ job_name = "lapetus"; static_configs = [{ - targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ]; + targets = [ + "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" + "127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}" + ]; }]; }]; # }}}