From 9148963c1f6d3ee6569d084737247450d0863b70 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Thu, 23 May 2024 04:20:44 +0100 Subject: [PATCH] fix: final set of changes to get it working --- applications/grafana.nix | 3 ++- applications/prometheus.nix | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/applications/grafana.nix b/applications/grafana.nix index a1c67b7..4e42f81 100644 --- a/applications/grafana.nix +++ b/applications/grafana.nix @@ -67,9 +67,10 @@ in { datasources.settings.datasources = [ { name = cfg.datasource.name; - type = "Prometheus"; + type = "prometheus"; url = cfg.datasource.url; isDefault = true; + editable = true; } ]; }; diff --git a/applications/prometheus.nix b/applications/prometheus.nix index 207863b..7c53f77 100644 --- a/applications/prometheus.nix +++ b/applications/prometheus.nix @@ -61,7 +61,7 @@ in { job_name = "node_exporter"; static_configs = [ { - targets = (map (hostname: "${hostname}:${cfg.port_collecter}") (lib.attrsets.mapAttrsToList (server: server.deployment.hostname)) nodes) ++ cfg.other_nodes; + targets = (lib.attrsets.mapAttrsToList (key: value: "${value.config.deployment.targetHost}:${toString cfg.port_collecter}") nodes) ++ cfg.server.other_nodes; } ]; }