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;
}
];
};
};
}

View file

@ -67,6 +67,13 @@ in
src = ./navidrome.json; # sadly data source is not detected
});
cadvisor = buildGrafanaDashboard {
id = 10619;
pname = "cadvisor";
version = "1";
hash = "sha256-T1HqWbwt+i/Wa+Y2B7hclaCijGxZF5QI38aPcXjk9y0=";
};
loki = (buildGrafanaDashboard {
id = 13407;
pname = "loki";