diff --git a/restic_exporter/restic_exporter.py b/restic_exporter/restic_exporter.py index 006f360..ea89e02 100644 --- a/restic_exporter/restic_exporter.py +++ b/restic_exporter/restic_exporter.py @@ -57,7 +57,8 @@ class restic_exporter: print(f"# HELP {self.metric_name} {self.metric_description}.") print(f"# TYPE {self.metric_name} counter") for counter in counters: - print(f"{self.metric_name}_{counter}{labels} {float(self.summary[counter])} {self.summary['timestamp']}") + if counter in self.summary: + print(f"{self.metric_name}_{counter}{labels} {float(self.summary[counter])} {self.summary['timestamp']}") def _read_summary_from_json(self, json_file): try: