diff --git a/nixos/modules/monitoring/exporters/promtail.nix b/nixos/modules/monitoring/exporters/promtail.nix index b068d9eed6e898fe75230e109569dd7aab0b0bc4..6668f180e77c6a6a9733ca6925b17f0d244891b0 100644 --- a/nixos/modules/monitoring/exporters/promtail.nix +++ b/nixos/modules/monitoring/exporters/promtail.nix @@ -6,7 +6,12 @@ # exporters, but it is very similar in what it is doing - # preparing local data and sending it off to a TSDB. -{ +{ config, ... }: + +let + hostName = config.networking.hostName; + +in { config.services.promtail.enable = true; config.networking.firewall.interfaces.monitoringvpn.allowedTCPPorts = [ 9080 ]; config.services.promtail.configuration = { @@ -25,6 +30,7 @@ journal = { labels = { job = "systemd-journal"; + host = hostName; }; }; relabel_configs = [{