From e0cf11276d8b9704b8fa2e19a546d4cfdc485c60 Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Tue, 10 Dec 2024 01:55:20 +0100 Subject: [PATCH] feat(monitoring): support cgroup exporting of metrics This needs an update in our node_exporter dashboard but nothing too hard. Signed-off-by: Ryan Lahfa --- modules/nixos/dgn-node-monitoring.nix | 16 +++++++++++++++- npins/sources.json | 12 ++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/modules/nixos/dgn-node-monitoring.nix b/modules/nixos/dgn-node-monitoring.nix index a241f05..6540d80 100644 --- a/modules/nixos/dgn-node-monitoring.nix +++ b/modules/nixos/dgn-node-monitoring.nix @@ -1,4 +1,10 @@ -{ config, lib, ... }: +{ + pkgs, + sources, + config, + lib, + ... +}: let inherit (lib) mkEnableOption @@ -24,6 +30,10 @@ in }; }; + imports = [ + "${sources.cgroup-exporter}/nix/module.nix" + ]; + config = mkIf cfg.enable { services.prometheus = { exporters = { @@ -36,6 +46,10 @@ in inherit (cfg) port; listenAddress = "0.0.0.0"; }; + cgroup = { + enable = true; + package = pkgs.callPackage "${sources.cgroup-exporter}/nix/package.nix" { }; + }; }; }; networking.firewall.interfaces.wt0.allowedTCPPorts = [ cfg.port ]; diff --git a/npins/sources.json b/npins/sources.json index d376076..102de78 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -38,6 +38,18 @@ "url": null, "hash": "09z5l5yh4zm0mf9hb3xc18gjk2dgv3l1icywrsxax00y1i1zlvna" }, + "cgroup-exporter": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "arianvp", + "repo": "cgroup-exporter" + }, + "branch": "main", + "revision": "816bfe1bc881ae43cf392949c47d8516a48fceeb", + "url": "https://github.com/arianvp/cgroup-exporter/archive/816bfe1bc881ae43cf392949c47d8516a48fceeb.tar.gz", + "hash": "1axg15ixja9vk78kz6mlixcd16j6h1agb52jvlwhnj56jw4ifvq8" + }, "colmena": { "type": "Git", "repository": {