Skip to content

Commit

Permalink
Export metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
peterablehmann committed Sep 19, 2024
1 parent 841a9a9 commit 43d03da
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions modules/monitoring/prometheus.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@
}
];
}
{
job_name = "restic";
scrape_interval = "30s";
scheme = "https";
basic_auth = {
username = "prometheus";
password_file = config.sops.secrets."prometheus/basic_auth".path;
};
static_configs = [{
targets = lib.mapAttrsToList (name: host: "restic.${host.config.networking.fqdn}") (
lib.filterAttrs (name: host: host.config.services.restic.server.enable) inputs.self.nixosConfigurations
);
}];
}
{
job_name = "blackbox_exporter";
scrape_interval = "1m";
Expand Down
1 change: 1 addition & 0 deletions modules/restic-server/.htpasswd
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
nix-servers:$2y$05$zmUOmy.QLI6Wv2sz5vUjGeNNl/61LIuEZLgsubiS/CYIK/8wRlkSm
flake:$2y$05$grLQrENY59mxIhTTgveO5ux99v.BQOUBWDqvg5Rem.P6.HhG/sI3O
metrics:$apr1$lm6SMO4f$RfW8WouGcGpAeBrWT0gXD.
3 changes: 2 additions & 1 deletion modules/restic-server/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ in
"--tls"
"--tls-cert=${tls-dir}/fullchain.pem"
"--tls-key=${tls-dir}/key.pem"
];
"--prometheus"
];
};
}

0 comments on commit 43d03da

Please sign in to comment.