summary refs log tree commit diff
path: root/modules/foundation
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-12-20 03:39:28 +0100
committerMel <einebeere@gmail.com>2024-12-20 03:39:28 +0100
commitbb5f031130a62825911657ec962f3c51d9ef8555 (patch)
treea8982308c2ad5ad37d18016acaa8d32f59a2f553 /modules/foundation
parent25f79f137d6870af1a78379d196fb951589a67b7 (diff)
downloadnetwork-bb5f031130a62825911657ec962f3c51d9ef8555.tar.zst
network-bb5f031130a62825911657ec962f3c51d9ef8555.zip
Combine node-exporter instances into 1 job + 3 targets
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'modules/foundation')
-rw-r--r--modules/foundation/monitoring.nix14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/foundation/monitoring.nix b/modules/foundation/monitoring.nix
index 34ff810..0f367d9 100644
--- a/modules/foundation/monitoring.nix
+++ b/modules/foundation/monitoring.nix
@@ -44,13 +44,13 @@ in
             scrape_interval = "15s";
           };
 
-          scrape_configs = map ({ name, ip, ... }: {
-            job_name = "${name}-node";
-            static_configs = [{
-              targets = [ "${ip}:9001" ];
-              labels = { type = "node"; host = name; };
-            }];
-          }) cfg.server.hosts;
+          scrape_configs = [{
+            job_name = "node";
+            static_configs = map ({ name, ip }: {
+              targets = [ "${ip}:${toString nodeExporterPort}" ];
+              labels = { instance = name; };
+            }) cfg.server.hosts;
+          }];
         };
       };
     })