From 84304b925a78404df6571c8553af74dd784f6fac Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sat, 29 Jan 2022 17:49:47 -0500 Subject: feat(whitby): Enable nginx prometheus exporter 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 Reviewed-by: tazjin Tested-by: BuildkiteCI Autosubmit: grfn --- ops/machines/whitby/default.nix | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'ops/machines/whitby/default.nix') diff --git a/ops/machines/whitby/default.nix b/ops/machines/whitby/default.nix index dbee33aa3f..968b5c4ea5 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}"]; + }]; }]; }; -- cgit 1.4.1