diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2023-05-29 22:10:27 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2023-05-29 22:10:27 +0200 |
commit | 52e32157c076a5c2999a49de8b524f50e35c665d (patch) | |
tree | e4b58c9e3daae2c75f4174dc7928abebc98c1db3 /hosts/vidhar | |
parent | f8b115bd2a43b24b451f546fc19463c85d9840a3 (diff) | |
download | nixos-52e32157c076a5c2999a49de8b524f50e35c665d.tar nixos-52e32157c076a5c2999a49de8b524f50e35c665d.tar.gz nixos-52e32157c076a5c2999a49de8b524f50e35c665d.tar.bz2 nixos-52e32157c076a5c2999a49de8b524f50e35c665d.tar.xz nixos-52e32157c076a5c2999a49de8b524f50e35c665d.zip |
prometheus-borg-exporter
Diffstat (limited to 'hosts/vidhar')
-rw-r--r-- | hosts/vidhar/borg/default.nix | 20 | ||||
-rw-r--r-- | hosts/vidhar/prometheus/default.nix | 12 |
2 files changed, 32 insertions, 0 deletions
diff --git a/hosts/vidhar/borg/default.nix b/hosts/vidhar/borg/default.nix index 922cbf02..c97c4216 100644 --- a/hosts/vidhar/borg/default.nix +++ b/hosts/vidhar/borg/default.nix | |||
@@ -48,6 +48,10 @@ let | |||
48 | 48 | ||
49 | baseDir = "/srv/backup/borg"; | 49 | baseDir = "/srv/backup/borg"; |
50 | in { | 50 | in { |
51 | imports = with flakeInputs; [ | ||
52 | prometheus-borg-exporter.nixosModules.default | ||
53 | ]; | ||
54 | |||
51 | config = { | 55 | config = { |
52 | services.borgsnap = { | 56 | services.borgsnap = { |
53 | enable = true; | 57 | enable = true; |
@@ -86,6 +90,22 @@ in { | |||
86 | }; | 90 | }; |
87 | }; | 91 | }; |
88 | 92 | ||
93 | services.prometheus-borg-exporter = { | ||
94 | enable = true; | ||
95 | gateway = "localhost:9091"; | ||
96 | target = "yggdrasil.borgbase:repo"; | ||
97 | inherit sshConfig; | ||
98 | keyfile = config.sops.secrets."yggdrasil.borgkey".path; | ||
99 | |||
100 | config = { | ||
101 | job = "yggdrasil.borgbase"; | ||
102 | groups = [ | ||
103 | { regex = "(?P<prefix>yggdrasil\.(surtr|vidhar|niflheim\.ymir))\.(?P<target>.+)-[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}"; } | ||
104 | ]; | ||
105 | }; | ||
106 | }; | ||
107 | |||
108 | |||
89 | # systemd.services."check-borg@${utils.escapeSystemdPath "${baseDir}/jotnar"}" = checkBorgUnit; | 109 | # systemd.services."check-borg@${utils.escapeSystemdPath "${baseDir}/jotnar"}" = checkBorgUnit; |
90 | # systemd.services."check-borg@${utils.escapeSystemdPath "yggdrasil.borgbase:repo"}" = recursiveUpdate checkBorgUnit { | 110 | # systemd.services."check-borg@${utils.escapeSystemdPath "yggdrasil.borgbase:repo"}" = recursiveUpdate checkBorgUnit { |
91 | # serviceConfig = { | 111 | # serviceConfig = { |
diff --git a/hosts/vidhar/prometheus/default.nix b/hosts/vidhar/prometheus/default.nix index 133ddbbc..d6d29c17 100644 --- a/hosts/vidhar/prometheus/default.nix +++ b/hosts/vidhar/prometheus/default.nix | |||
@@ -241,6 +241,13 @@ in { | |||
241 | ]; | 241 | ]; |
242 | scrape_interval = "5s"; | 242 | scrape_interval = "5s"; |
243 | } | 243 | } |
244 | { job_name = "pushgateway"; | ||
245 | honor_labels = true; | ||
246 | static_configs = [ | ||
247 | { targets = ["localhost:9091"];} | ||
248 | ]; | ||
249 | scrape_interval = "5s"; | ||
250 | } | ||
244 | ]; | 251 | ]; |
245 | 252 | ||
246 | rules = [ | 253 | rules = [ |
@@ -288,7 +295,12 @@ in { | |||
288 | ]; | 295 | ]; |
289 | }) | 296 | }) |
290 | ]; | 297 | ]; |
298 | |||
299 | pushgateway = { | ||
300 | enable = true; | ||
301 | }; | ||
291 | }; | 302 | }; |
303 | |||
292 | users.users.${config.services.prometheus.exporters.unbound.user} = { | 304 | users.users.${config.services.prometheus.exporters.unbound.user} = { |
293 | description = "Prometheus unbound exporter service user"; | 305 | description = "Prometheus unbound exporter service user"; |
294 | isSystemUser = true; | 306 | isSystemUser = true; |