diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-01-06 20:53:52 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-01-06 20:53:52 +0100 |
commit | 7bdd17ff928d1ee7008a5b8b636b4b7df859768e (patch) | |
tree | 0f3091eae506e921edda03fb37f0e8ab9bf092ff | |
parent | 87d21f2e637614d8bc053b61c4fe601ff373edcb (diff) | |
download | nixos-7bdd17ff928d1ee7008a5b8b636b4b7df859768e.tar nixos-7bdd17ff928d1ee7008a5b8b636b4b7df859768e.tar.gz nixos-7bdd17ff928d1ee7008a5b8b636b4b7df859768e.tar.bz2 nixos-7bdd17ff928d1ee7008a5b8b636b4b7df859768e.tar.xz nixos-7bdd17ff928d1ee7008a5b8b636b4b7df859768e.zip |
vidhar: prometheus: ...
-rw-r--r-- | hosts/vidhar/prometheus/default.nix | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/hosts/vidhar/prometheus/default.nix b/hosts/vidhar/prometheus/default.nix index 3fd07bbe..31bc6b07 100644 --- a/hosts/vidhar/prometheus/default.nix +++ b/hosts/vidhar/prometheus/default.nix | |||
@@ -182,6 +182,29 @@ in { | |||
182 | scrape_interval = "1s"; | 182 | scrape_interval = "1s"; |
183 | } | 183 | } |
184 | ]; | 184 | ]; |
185 | |||
186 | rules = [ | ||
187 | (generators.toYAML { | ||
188 | groups = [ | ||
189 | { name = "systemd-starts"; | ||
190 | rules = [ | ||
191 | { record = "systemd_unit_runtime_seconds"; | ||
192 | expr = "timestamp(systemd_unit_start_time_seconds) - (systemd_unit_start_time_seconds > 0)"; | ||
193 | } | ||
194 | { record = "systemd_unit_runtime_seconds:resets_per_hour"; | ||
195 | expr = "resets(systemd_unit_start_time_seconds:uptime[1h])"; | ||
196 | } | ||
197 | { record = "systemd_unit_runtime_seconds:resets_per_day"; | ||
198 | expr = "resets(systemd_unit_start_time_seconds:uptime[1d])"; | ||
199 | } | ||
200 | { record = "systemd_unit_runtime_seconds:resets_per_week"; | ||
201 | expr = "resets(systemd_unit_start_time_seconds:uptime[1w])"; | ||
202 | } | ||
203 | ]; | ||
204 | } | ||
205 | ]; | ||
206 | }) | ||
207 | ]; | ||
185 | }; | 208 | }; |
186 | users.users.${config.services.prometheus.exporters.unbound.user} = { | 209 | users.users.${config.services.prometheus.exporters.unbound.user} = { |
187 | description = "Prometheus unbound exporter service user"; | 210 | description = "Prometheus unbound exporter service user"; |