feat(monitoring): support cgroup exporting of metrics #183

Merged
thubrecht merged 1 commit from cgroup-exporting into main 2024-12-11 11:13:14 +01:00
2 changed files with 27 additions and 1 deletions
Showing only changes of commit e0cf11276d - Show all commits

View file

@ -1,4 +1,10 @@
{ config, lib, ... }: {
pkgs,
sources,
config,
lib,
...
}:
let let
inherit (lib) inherit (lib)
mkEnableOption mkEnableOption
@ -24,6 +30,10 @@ in
}; };
}; };
imports = [
"${sources.cgroup-exporter}/nix/module.nix"
];
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.prometheus = { services.prometheus = {
exporters = { exporters = {
@ -36,6 +46,10 @@ in
inherit (cfg) port; inherit (cfg) port;
listenAddress = "0.0.0.0"; listenAddress = "0.0.0.0";
}; };
cgroup = {
enable = true;
package = pkgs.callPackage "${sources.cgroup-exporter}/nix/package.nix" { };
};
}; };
}; };
networking.firewall.interfaces.wt0.allowedTCPPorts = [ cfg.port ]; networking.firewall.interfaces.wt0.allowedTCPPorts = [ cfg.port ];

View file

@ -38,6 +38,18 @@
"url": null, "url": null,
"hash": "09z5l5yh4zm0mf9hb3xc18gjk2dgv3l1icywrsxax00y1i1zlvna" "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": { "colmena": {
"type": "Git", "type": "Git",
"repository": { "repository": {