add node exporter

This commit is contained in:
XenGi 2025-12-05 23:40:43 +01:00
parent 736aa3a9ef
commit b5c58f9c5b
Signed by: xengi
SSH key fingerprint: SHA256:dM+fLZGsDvyv6kunjE8bGduL24VsCFB4LEOSdmRHdG0
2 changed files with 23 additions and 3 deletions

View file

@ -25,6 +25,12 @@
in
{
formatter.${system} = pkgs.nixfmt-tree;
apps.${system}.connect = {
type = "app";
program = "${pkgs.writeShellScript "connect.sh" ''
${pkgs.openssh}/bin/ssh root@matrix.berlin.ccc.de -L 3000:[::1]:3000 -L 9090:[::1]:9090 -N
''}";
};
devShells.${system}.default = pkgs.mkShell {
packages = [
(agenix.packages.${system}.default)

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
{
services.prometheus = {
@ -6,7 +6,10 @@
retentionTime = "14d";
listenAddress = "[::1]";
exporters = {
#node = {};
node = {
enable = true;
listenAddress = services.prometheus.listenAddress;
};
#nginx = {};
#postgres = {};
};
@ -16,10 +19,21 @@
scrape_interval = "15s";
static_configs = [
{
targets = [ "[::1]:9009" ];
target = lib.pipe config.services.matrix-synapse.settings.listeners [
(lib.filter (l: l.type == "metrics"))
builtins.head
(l: "[${l.listenAddress}]:${l.port}")
];
}
];
}
{
job_name = "node";
scrape_interval = "15s";
static_configs = [
{ targets = [ "${config.services.prometheus.exporters.node.listenAddress}:${toString config.services.prometheus.exporters.node.port}" ]; }
];
}
];
ruleFiles = [
# https://github.com/element-hq/synapse/tree/master/contrib/prometheus