monitor containers
This commit is contained in:
parent
3a4ed070f2
commit
b890a69e30
13 changed files with 134 additions and 97 deletions
nixos/components/monitor
32
nixos/components/monitor/metrics-export-zfs.nix
Normal file
32
nixos/components/monitor/metrics-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.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" ];
|
||||
};
|
||||
|
||||
})
|
||||
];
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue