feat: add prometheus monitoring service
This commit is contained in:
31
sp-modules/monitoring/module.nix
Normal file
31
sp-modules/monitoring/module.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{config, lib, ...}: let
|
||||
cfg = config.selfprivacy.modules.monitoring;
|
||||
in {
|
||||
options.selfprivacy.modules.monitoring = {
|
||||
enable = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
port = 9001;
|
||||
exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
enabledCollectors = [ "systemd" ];
|
||||
port = 9002;
|
||||
};
|
||||
};
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "node-exporter";
|
||||
static_configs = [{
|
||||
targets = [ "127.0.0.1:9002" ];
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user