about summary refs log tree commit diff
path: root/ops/machines
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2022-01-29T22·49-0500
committergrfn <grfn@gws.fyi>2022-01-29T23·00+0000
commit84304b925a78404df6571c8553af74dd784f6fac (patch)
treef7993edbb2066565cde64e0fca311a93aabd9258 /ops/machines
parent63b09a6466d19efb2535f679e3ff5fc9893cbfae (diff)
feat(whitby): Enable nginx prometheus exporter r/3715
Might be nice to look at rates of requests etc.

Change-Id: I4d12ab0c1a555793e803de4a9614e616951a94e5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5125
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: grfn <grfn@gws.fyi>
Diffstat (limited to 'ops/machines')
-rw-r--r--ops/machines/whitby/default.nix29
1 files changed, 22 insertions, 7 deletions
diff --git a/ops/machines/whitby/default.nix b/ops/machines/whitby/default.nix
index dbee33aa3f1f..968b5c4ea58d 100644
--- a/ops/machines/whitby/default.nix
+++ b/ops/machines/whitby/default.nix
@@ -483,14 +483,23 @@ in {
   # Prometheus is inside the respective service modules.
   services.prometheus = {
     enable = true;
-    exporters.node = {
-      enable = true;
 
-      enabledCollectors = [
-        "logind"
-        "processes"
-        "systemd"
-      ];
+    exporters = {
+      node = {
+        enable = true;
+
+        enabledCollectors = [
+          "logind"
+          "processes"
+          "systemd"
+        ];
+      };
+
+      nginx = {
+        enable = true;
+        sslVerify = false;
+        constLabels = [ "host=whitby" ];
+      };
     };
 
     scrapeConfigs = [{
@@ -499,6 +508,12 @@ in {
       static_configs = [{
         targets = ["localhost:${toString config.services.prometheus.exporters.node.port}"];
       }];
+    } {
+      job_name = "nginx";
+      scrape_interval = "5s";
+      static_configs = [{
+        targets = ["localhost:${toString config.services.prometheus.exporters.nginx.port}"];
+      }];
     }];
   };