infra/services/monitoring/exporters/cadvisor.nix

23 lines
475 B
Nix

{
config,
lib,
...
}:
let
cfg = config.bagel.monitoring.exporters.cadvisor;
inherit (lib) mkEnableOption mkIf;
in
{
options.bagel.monitoring.exporters.cadvisor.enable = (mkEnableOption "Standard cAdvisor") // { default = !config.boot.isContainer; };
config = mkIf cfg.enable {
services.cadvisor = {
enable = true;
port = 9102;
listenAddress = "0.0.0.0";
};
bagel.monitoring.grafana-agent.exporters = [ { port = 9102; } ];
};
}