about summary refs log tree commit diff
path: root/ops/machines/whitby/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'ops/machines/whitby/default.nix')
-rw-r--r--ops/machines/whitby/default.nix25
1 files changed, 24 insertions, 1 deletions
diff --git a/ops/machines/whitby/default.nix b/ops/machines/whitby/default.nix
index eb93aef69dac..df280b96f7c1 100644
--- a/ops/machines/whitby/default.nix
+++ b/ops/machines/whitby/default.nix
@@ -1,5 +1,5 @@
 { depot, lib, pkgs, ... }: # readTree options
-config: # passed by module system
+{ config, ... }: # passed by module system
 
 let
   inherit (builtins) listToAttrs;
@@ -357,6 +357,29 @@ in lib.fix(self: {
     applicationCredentials = "/var/lib/journaldriver/key.json";
   };
 
+  # Configure Prometheus & Grafana. Exporter configuration for
+  # Prometheus is inside the respective service modules.
+  services.prometheus = {
+    enable = true;
+    exporters.node = {
+      enable = true;
+
+      enabledCollectors = [
+        "logind"
+        "processes"
+        "systemd"
+      ];
+    };
+
+    scrapeConfigs = [{
+      job_name = "node";
+      scrape_interval = "5s";
+      static_configs = [{
+        targets = ["localhost:${toString config.services.prometheus.exporters.node.port}"];
+      }];
+    }];
+  };
+
   security.sudo.extraRules = [
     {
       groups = ["wheel"];