check for counter existing
This commit is contained in:
parent
5e1c1c7fd9
commit
1f72d8f0b7
1 changed files with 2 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue