feat: add prometheus config
This commit is contained in:
parent
3f517bbe7f
commit
5604bb6c98
2 changed files with 32 additions and 0 deletions
|
|
@ -11,4 +11,20 @@ rec {
|
|||
"processes"
|
||||
];
|
||||
};
|
||||
|
||||
prometheus = {
|
||||
port = 9090;
|
||||
scrapeConfigs = {
|
||||
node = {
|
||||
static_configs = [
|
||||
{
|
||||
targets = [
|
||||
"localhost:9100"
|
||||
"pi.home:9100"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
16
services/prometheus.nix
Normal file
16
services/prometheus.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{lib, ...}:
|
||||
let
|
||||
serv = import ../config/services.nix;
|
||||
scrapeConfig = lib.attrsets.mapAttrsToList (name: cfg: {
|
||||
job_name = name;
|
||||
|
||||
static_configs = cfg.static_configs;
|
||||
});
|
||||
in
|
||||
{
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
|
||||
scrapeConfigs = scrapeConfig;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue