diff options
| author | Max Audron <audron@cocaine.farm> | 2025-07-30 16:28:28 +0200 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2025-07-30 16:28:28 +0200 |
| commit | 9b0c7227c17922d086b530989b38f50c88fb3211 (patch) | |
| tree | 123b495a1057b69cfcfa421431e7714a69caee88 /modules | |
| parent | update authentik (diff) | |
add initial prometheus deployment
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/monitoring/default.nix | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/modules/monitoring/default.nix b/modules/monitoring/default.nix new file mode 100644 index 0000000..ef27c7c --- /dev/null +++ b/modules/monitoring/default.nix @@ -0,0 +1,46 @@ +{ self, config, lib, pkgs, ... }: + +with self.lib.nginx; +{ + services.prometheus = { + enable = true; + enableReload = true; + retentionTime = "14d"; + + listenAddress = "10.10.0.1"; + webExternalUrl = "https://prometheus.vapor.systems"; + + exporters = { + node = { + enable = true; + enabledCollectors = [ "systemd" ]; + }; + }; + + globalConfig = { + scrape_interval = "10s"; + }; + + scrapeConfigs = [ + { + job_name = "node"; + static_configs = [ + { targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; } + ]; + } + ]; + }; + + security.acme.certs = { + "vapor.systems" = { + extraDomainNames = [ "*.vapor.systems" ]; + }; + }; + + services.nginx = { + enable = true; + virtualHosts = { + "prometheus.vapor.systems" = (proxyDomain "vapor.systems" "http://10.10.0.1:9090/"); + }; + }; +} |
