diff --git a/morph/lib/base.nix b/morph/lib/base.nix index aafbf4f4e62b064284e42b5a05905495380736dc..3bc6ae4c4205250a0e023a316b3159186ee78046 100644 --- a/morph/lib/base.nix +++ b/morph/lib/base.nix @@ -57,13 +57,6 @@ # qualified domain name. deployment.targetHost = config.networking.fqdn; - networking.hosts = { - # To stream logs to the monitoring host, all nodes need to know its address - ${nodes.monitoring.config.services.private-storage.monitoring.vpn.server.ip} = [ - "monitoring" "monitoring.monitoringvpn" - ]; - }; - services.private-storage.monitoring.exporters.promtail.enable = true; assertions = [ diff --git a/nixos/modules/monitoring/exporters/promtail.nix b/nixos/modules/monitoring/exporters/promtail.nix index e279b481862135c3ece61a4c28590698110cdb8a..ca22c4ac4dd674c7b50d08bd19bfdebef8e71e75 100644 --- a/nixos/modules/monitoring/exporters/promtail.nix +++ b/nixos/modules/monitoring/exporters/promtail.nix @@ -15,6 +15,14 @@ let in { options.services.private-storage.monitoring.exporters.promtail = { enable = lib.mkEnableOption "Promtail log exporter service"; + lokiUrl = lib.mkOption { + type = lib.types.str; + description = '' + The server URL that logs should be pushed to. + ''; + # Resolving names is hard, let's have breakfast + default = "http://172.23.23.1:3100/loki/api/v1/push"; + }; }; config = lib.mkIf cfg.enable { @@ -28,7 +36,7 @@ in { }; clients = [{ - url = "http://monitoring:3100/loki/api/v1/push"; + url = cfg.lokiUrl; }]; scrape_configs = [{