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" ]; + }; + }; +}