diff options
Diffstat (limited to 'hosts/vidhar/prometheus/default.nix')
-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"; |