From 40d78422cf8ffe55b8327a986d881a8d6011d12d Mon Sep 17 00:00:00 2001 From: Katharina Heidenreich Date: Sat, 11 Apr 2026 12:53:19 +0200 Subject: [PATCH] feat: add prometheus exporter --- config/services.nix | 8 ++++++++ services/node-exporter.nix | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 services/node-exporter.nix diff --git a/config/services.nix b/config/services.nix index c0ab036..fe3e0c1 100644 --- a/config/services.nix +++ b/config/services.nix @@ -39,4 +39,12 @@ rec { port = 8081; }; + "metric-exporter" = { + port = 9100; + collectors = [ + "systemd" + "processes" + "thermal_zone" + ]; + }; } diff --git a/services/node-exporter.nix b/services/node-exporter.nix new file mode 100644 index 0000000..c313e8e --- /dev/null +++ b/services/node-exporter.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: +let + serv = import ../config/services.nix; +in { + services.prometheus.exporters.node = { + enable = true; + port = serv."metric-exporter".port; + enabledCollectors = serv."metric-exporter".collectors; + }; + + networking.firewall.allowedTCPPorts = [ serv."metric-exporter".port ]; +}