garage: add monitoring, connect to grafana + loki

https://garagehq.deuxfleurs.fr/documentation/reference-manual/monitoring/
This commit is contained in:
teutat3s 2024-08-25 00:15:06 +02:00
parent d32abd7a7f
commit f236962e17
Signed by untrusted user: teutat3s
GPG key ID: 4FA1D3FA524F22C1
5 changed files with 1082 additions and 4 deletions

View file

@ -96,8 +96,8 @@
self.nixosModules.overlays
self.nixosModules.unlock-luks-on-boot
self.nixosModules.core
#self.nixosModules.prometheus-exporters
#self.nixosModules.promtail
self.nixosModules.prometheus-exporters
self.nixosModules.promtail
self.nixosModules.garage
self.nixosModules.nginx

View file

@ -27,6 +27,8 @@
3902
];
networking.firewall.interfaces.wg-ssh.allowedTCPPorts = [ 3903 ];
security.acme = {
defaults = {
environmentFile = config.age.secrets.acme-namecheap-env.path;
@ -103,6 +105,9 @@
root_domain = ".web.${config.pub-solar-os.networking.domain}";
index = "index.html";
};
admin = {
api_bind_addr = "[::]:3903";
};
};
};

View file

@ -33,6 +33,11 @@
group = "grafana";
user = "grafana";
};
"grafana-dashboards/grafana-garage-dashboard-prometheus.json" = {
source = ./grafana-dashboards/grafana-garage-dashboard-prometheus.json;
group = "grafana";
user = "grafana";
};
};
services.caddy.virtualHosts."grafana.${config.pub-solar-os.networking.domain}" = {

File diff suppressed because it is too large Load diff

View file

@ -69,6 +69,14 @@
instance = "tankstelle";
};
}
{
targets = [
"trinkgenossin.wg.${config.pub-solar-os.networking.domain}:${toString config.services.prometheus.exporters.node.port}"
];
labels = {
instance = "trinkgenossin";
};
}
];
}
{
@ -83,6 +91,18 @@
}
];
}
{
job_name = "garage";
static_configs = [
{
targets = [
"trinkgenossin.wg.${config.pub-solar-os.networking.domain}:3903"
"delite.wg.${config.pub-solar-os.networking.domain}:3903"
"blue-shell.wg.${config.pub-solar-os.networking.domain}:3903"
];
}
];
}
];
ruleFiles = [