diff --git a/modules/services/metrics.nix b/modules/services/metrics.nix index c727610..5926e0a 100644 --- a/modules/services/metrics.nix +++ b/modules/services/metrics.nix @@ -103,17 +103,23 @@ in { }; }; - scrapeConfigs = [ + scrapeConfigs = let + commonLabels = { + hostname = config.networking.hostName; + }; + in [ { job_name = "node"; static_configs = [{ targets = [ "127.0.0.1:${toString ports.node}" ]; + labels = commonLabels; }]; } { job_name = "nginx"; static_configs = [{ targets = [ "127.0.0.1:${toString ports.nginx}" ]; + labels = commonLabels; }]; } ]; @@ -215,7 +221,7 @@ in { max_age = "12h"; labels = { job = "systemd-journal"; - host = "${config.networking.hostName}"; + hostname = config.networking.hostName; }; }; relabel_configs = [