service/home-assistant: fix monitoring

This commit is contained in:
Felix Buehler 2023-11-20 21:48:44 +01:00
parent 2807feac41
commit 67be64d3dd

View file

@ -103,32 +103,29 @@ in
"::1"
];
};
prometheus.requires_auth = false;
};
extraComponents = [
"backup"
"deutsche_bahn"
"prometheus"
] ++ cfg.extraComponents;
};
# services.prometheus.scrapeConfigs = [
# {
# job_name = "home-assistant";
# metrics_path = "/api/prometheus";
# authorization.credentials: "your.longlived.token";
# static_configs = [
# {
# targets = [ "127.0.0.1:${toString cfg.port}" ];
# labels = {
# instance = config.networking.hostName;
# };
# }
# ];
# }
# ];
services.prometheus.scrapeConfigs = [
{
job_name = "home-assistant";
metrics_path = "/api/prometheus";
static_configs = [
{
targets = [ "127.0.0.1:${toString cfg.port}" ];
labels = {
instance = config.networking.hostName;
};
}
];
}
];
my.services.prometheus.rules = {
homeassistant = {