pluh 🗣
This commit is contained in:
parent
3ad9944baa
commit
668140531b
59 changed files with 985 additions and 219 deletions
34
classes/headless/prometheus.nix
Normal file
34
classes/headless/prometheus.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
port = 3020;
|
||||
|
||||
exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
port = 3021;
|
||||
enabledCollectors = ["systemd"];
|
||||
};
|
||||
};
|
||||
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "nodes";
|
||||
static_configs = [
|
||||
{
|
||||
targets = let
|
||||
target = lib.formatHostPort {
|
||||
host = config.services.prometheus.exporters.node.listenAddr;
|
||||
inherit (config.services.prometheus.exporters.node) port;
|
||||
};
|
||||
in [target];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue