some improvements
This commit is contained in:
parent
9f6d63cabe
commit
a5234a2a84
3 changed files with 35 additions and 0 deletions
|
@ -11,6 +11,7 @@ with types;
|
||||||
};
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
./export-zfs.nix
|
||||||
./netdata.nix
|
./netdata.nix
|
||||||
./opentelemetry.nix
|
./opentelemetry.nix
|
||||||
./prometheus.nix
|
./prometheus.nix
|
||||||
|
@ -19,4 +20,5 @@ with types;
|
||||||
];
|
];
|
||||||
|
|
||||||
config = mkIf config.components.monitor.enable { };
|
config = mkIf config.components.monitor.enable { };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
32
nixos/components/monitor/export-zfs.nix
Normal file
32
nixos/components/monitor/export-zfs.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ pkgs, config, lib, ... }:
|
||||||
|
with lib;
|
||||||
|
with types;
|
||||||
|
{
|
||||||
|
options.components.monitor.exporters.zfs.enable = mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = config.components.monitor.enable;
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkMerge [
|
||||||
|
(mkIf config.components.monitor.exporters.zfs.enable {
|
||||||
|
|
||||||
|
services.telegraf.extraConfig.inputs.zfs = {};
|
||||||
|
|
||||||
|
services.prometheus.exporters.zfs.enable = true;
|
||||||
|
services.opentelemetry-collector.settings = {
|
||||||
|
receivers.prometheus.config.scrape_configs = [
|
||||||
|
{
|
||||||
|
job_name = "zfs";
|
||||||
|
scrape_interval = "10s";
|
||||||
|
static_configs = [{
|
||||||
|
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.zfs.port}" ];
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
service.pipelines.metrics.receivers = [ "prometheus" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
components.monitor.enable = true;
|
components.monitor.enable = true;
|
||||||
components.monitor.opentelemetry.exporter.endpoint = "10.100.0.1:4317"; # orbi
|
components.monitor.opentelemetry.exporter.endpoint = "10.100.0.1:4317"; # orbi
|
||||||
|
components.monitor.exporters.zfs.enable = false;
|
||||||
|
|
||||||
home-manager.users.mainUser.home.sessionPath = [ "$HOME/.timewarrior/scripts" ];
|
home-manager.users.mainUser.home.sessionPath = [ "$HOME/.timewarrior/scripts" ];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue