# Options both halves need to agree on. # # The collectors bind these ports; the server scrapes them and pushes to them. When the # two halves live in separate NixOS configurations (host + container) there is no shared # `config` to read, so each side sets its own copy and it is on you to keep them equal — # which is why they are gathered in one small file rather than scattered. # # Imported by both modules/collectors.nix and modules/server.nix. Importing the same # path twice is harmless: the module system deduplicates imports by path, so a # configuration that uses both halves does not end up declaring these twice. { lib, ... }: let inherit (lib) mkOption types; portOption = default: description: mkOption { inherit default description; type = types.port; }; in { options.services.telemetry.ports = { node = portOption 9100 '' Port the Prometheus node exporter listens on. Also where the server's `node` scrape job points. ''; smartctl = portOption 9633 '' Port the smartctl exporter listens on. Also where the server's `smartctl` scrape job points. ''; loki = portOption 3100 '' Port Loki listens on. Also where the collectors' log shipper pushes to. ''; prometheus = portOption 9090 '' Port Prometheus listens on. ''; alertmanager = portOption 9093 '' Port Alertmanager listens on. Only Prometheus talks to it, but the web UI is where you silence alerts. ''; grafana = portOption 3000 '' Port Grafana listens on. If the reverse proxy is enabled this stays internal and the proxy is what you connect to. ''; }; }