1
0

hosts/monitoring-3: Monitor uberspace hosts

This commit is contained in:
2025-03-07 22:03:34 +01:00
parent 7254525c8e
commit a8b084628f
2 changed files with 48 additions and 3 deletions

View File

@@ -55,6 +55,11 @@ let
eachWithEachOther = (f: x: y: lib.lists.flatten (lib.lists.forEach x (a: lib.lists.forEach y (b: f a b))));
in {
sops.secrets.uberspace-monitor-password = {
owner = "prometheus";
group = "prometheus";
};
networking.hosts = {
"::1" = [ "monitoring-3.mon.clerie.de" ]; # fd00:327:327:327::1
}
@@ -126,6 +131,45 @@ in {
relabelAddressToInstance
];
}
{
job_name = "node-exporter-uberspace";
scrape_interval = "20s";
metrics_path = "/.node-exporter/metrics";
basic_auth = {
username = "monitor";
password_file = config.sops.secrets.uberspace-monitor-password.path;
};
static_configs = [
{
targets = [
"clerie.uber.space;infra"
"cleriewi.uber.space;infra"
];
}
];
relabel_configs = [
{
source_labels = [ "__address__" ];
regex = "(.+);(.+)";
target_label = "service_level";
replacement = "\${2}";
}
{
source_labels = [ "__address__" ];
regex = "(.+);(.+)";
target_label = "__address__";
replacement = "\${1}";
}
{
source_labels = [ "__address__" ];
target_label = "instance";
}
{
target_label = "job";
replacement = "node-exporter";
}
];
}
{
job_name = "nixos-exporter";
scrape_interval = "1m";