system/docker: enable monitoring

This commit is contained in:
Felix Buehler 2023-06-03 23:11:57 +02:00
parent dc7c6bce75
commit f8bb1d0886
2 changed files with 35 additions and 0 deletions

View file

@ -18,5 +18,33 @@ in
enable = true;
autoPrune.enable = true;
};
services.cadvisor.enable = config.services.prometheus.enable;
services.prometheus = {
scrapeConfigs = [
{
job_name = "docker";
static_configs = [
{
targets = [ "127.0.0.1:${toString config.services.cadvisor.port}" ];
labels = {
instance = config.networking.hostName;
};
}
];
}
];
};
# dashboard untested
services.grafana.provision = {
dashboards.settings.providers = [
{
name = "Docker";
options.path = pkgs.grafana-dashboards.cadvisor;
disableDeletion = true;
}
];
};
};
}