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.overlays
self.nixosModules.unlock-luks-on-boot self.nixosModules.unlock-luks-on-boot
self.nixosModules.core self.nixosModules.core
#self.nixosModules.prometheus-exporters self.nixosModules.prometheus-exporters
#self.nixosModules.promtail self.nixosModules.promtail
self.nixosModules.garage self.nixosModules.garage
self.nixosModules.nginx self.nixosModules.nginx

View file

@ -27,6 +27,8 @@
3902 3902
]; ];
networking.firewall.interfaces.wg-ssh.allowedTCPPorts = [ 3903 ];
security.acme = { security.acme = {
defaults = { defaults = {
environmentFile = config.age.secrets.acme-namecheap-env.path; environmentFile = config.age.secrets.acme-namecheap-env.path;
@ -59,7 +61,7 @@
"[::1]:3902" = { }; "[::1]:3902" = { };
}; };
virtualHosts."buckets.${config.pub-solar-os.networking.domain}" = { virtualHosts."buckets.${config.pub-solar-os.networking.domain}" = {
serverAliases = ["*.buckets.${config.pub-solar-os.networking.domain}"]; serverAliases = [ "*.buckets.${config.pub-solar-os.networking.domain}" ];
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -72,7 +74,7 @@
}; };
}; };
virtualHosts."web.${config.pub-solar-os.networking.domain}" = { virtualHosts."web.${config.pub-solar-os.networking.domain}" = {
serverAliases = ["*.web.${config.pub-solar-os.networking.domain}"]; serverAliases = [ "*.web.${config.pub-solar-os.networking.domain}" ];
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -103,6 +105,9 @@
root_domain = ".web.${config.pub-solar-os.networking.domain}"; root_domain = ".web.${config.pub-solar-os.networking.domain}";
index = "index.html"; index = "index.html";
}; };
admin = {
api_bind_addr = "[::]:3903";
};
}; };
}; };

View file

@ -33,6 +33,11 @@
group = "grafana"; group = "grafana";
user = "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}" = { 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"; 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 = [ ruleFiles = [