This commit is contained in:
parent
ebc446116c
commit
7f52ad42cd
14 changed files with 290 additions and 2 deletions
33
modules/prometheus/default.nix
Normal file
33
modules/prometheus/default.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{config, ...}: let
|
||||
cfg = config.services.prometheus;
|
||||
in {
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
checkConfig = false; # Otherwise it will fail because it cannot access bearer_token_file
|
||||
webExternalUrl = "https://status.aciceri.dev";
|
||||
globalConfig.scrape_interval = "10s";
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "hass";
|
||||
metrics_path = "/api/prometheus";
|
||||
bearer_token_file = config.age.secrets.home-assistant-token.path;
|
||||
static_configs = [
|
||||
{
|
||||
targets = ["sisko.fleet:${builtins.toString config.services.home-assistant.config.http.server_port}"];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "node";
|
||||
static_configs = [
|
||||
{
|
||||
targets = builtins.map (host: "${host}.fleet:9100") ["sisko" "picard"];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
environment.persistence."/persist".directories = [
|
||||
"/var/lib/${cfg.stateDir}"
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue