hosts/library: extract prometheus config

This commit is contained in:
2025-06-02 22:49:53 +01:00
parent b4ef349c9c
commit 06a48940a9
2 changed files with 36 additions and 29 deletions

View File

@@ -0,0 +1,35 @@
{
config,
...
}:
{
services.prometheus = {
enable = true;
port = 9001;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 9002;
};
zfs = {
enable = true;
port = 9003;
};
};
scrapeConfigs = [
{
job_name = "node";
static_configs = [
{
targets = [
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
"127.0.0.1:${toString config.services.prometheus.exporters.zfs.port}"
];
}
];
}
];
};
}