ngosang / restic-exporter

Prometheus exporter for the Restic backup system
MIT License
79 stars 17 forks source link

The exporter can fail unexpectedly if is queried before collecting information the first time #28

Closed martonivan closed 1 month ago

martonivan commented 6 months ago

2024-03-25 09:59:06 INFO It could take a while if the repository is remote. 2024-03-25 09:59:59 ERROR Unable to collect metrics from Restic. Error: Error executing restic snapshot command. Exit code: -9 Traceback (most recent call last): File "/restic-exporter.py", line 226, in prometheus_client.core.REGISTRY.register(collector) File "/usr/local/lib/python3.11/site-packages/prometheus_client/registry.py", line 40, in register names = self._get_names(collector) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/prometheus_client/registry.py", line 80, in _get_names for metric in desc_func(): File "/restic-exporter.py", line 66, in collect check_success.add_metric([], self.metrics["check_success"])


KeyError: 'check_success'
ngosang commented 1 month ago

The Restic repository/server must be ready before starting this exporter.