From 780bc8ba5292cccc94a96c5b2b4ba0373a7333b5 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Thu, 18 Jul 2024 23:00:17 +0530 Subject: [PATCH] shared: enable systemd-exporter --- hosts/shared/node-exporter.nix | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/hosts/shared/node-exporter.nix b/hosts/shared/node-exporter.nix index 98caef4..903f725 100644 --- a/hosts/shared/node-exporter.nix +++ b/hosts/shared/node-exporter.nix @@ -3,16 +3,30 @@ caddy = { virtualHosts."${config.networking.hostName}.labs.adtya.xyz" = { extraConfig = '' - reverse_proxy /metrics 127.0.0.1:9100 + handle /metrics { + reverse_proxy 127.0.0.1:9100 + } + handle /systemd-metrics { + uri replace /systemd-metrics /metrics + reverse_proxy 127.0.0.1:9558 + } 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" ]; + prometheus.exporters = { + node = { + enable = true; + listenAddress = "127.0.0.1"; + port = 9100; + enabledCollectors = [ "systemd" ]; + }; + systemd = { + enable = true; + listenAddress = "127.0.0.1"; + port = 9558; + }; + }; }; }