nixos-config/components/monitor/metrics-export-zfs.nix
Ingolf Wagner 7a6510a4e6
Some checks are pending
Build all NixOS Configurations / nix build (push) Waiting to run
nix fmt
2024-08-29 08:26:04 +07:00

40 lines
880 B
Nix

{
pkgs,
config,
lib,
...
}:
with lib;
with types;
{
options.components.monitor.exporters.zfs.enable = mkOption {
type = lib.types.bool;
default = config.components.monitor.metrics.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" ];
};
})
];
}