From 514eca685c8e9fd82faa19ae4a8b67ead09e2fd3 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Thu, 18 Jul 2024 22:03:46 +0530 Subject: [PATCH] shared: add node-exporter config --- hosts/shared/node-exporter.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 hosts/shared/node-exporter.nix diff --git a/hosts/shared/node-exporter.nix b/hosts/shared/node-exporter.nix new file mode 100644 index 0000000..98caef4 --- /dev/null +++ b/hosts/shared/node-exporter.nix @@ -0,0 +1,18 @@ +{ config, ... }: { + services = { + caddy = { + virtualHosts."${config.networking.hostName}.labs.adtya.xyz" = { + extraConfig = '' + reverse_proxy /metrics 127.0.0.1:9100 + tls /persist/secrets/caddy/certs/default.crt /persist/secrets/caddy/certs/default.key + ''; + }; + }; + prometheus.exporters.node = { + enable = true; + listenAddress = "127.0.0.1"; + port = 9100; + enabledCollectors = [ "systemd" ]; + }; + }; +}