diff --git a/restic_exporter/restic_exporter.py b/restic_exporter/restic_exporter.py index 1f30793..d3f4efd 100644 --- a/restic_exporter/restic_exporter.py +++ b/restic_exporter/restic_exporter.py @@ -25,6 +25,7 @@ class restic_exporter: self._init_log() self.metric_name = metric_name.replace(' ', '_') + self.job_name = job_name.replace(' ', '_') self.metric_description = metric_description self.labels= {"job_name": job_name} @@ -54,8 +55,8 @@ class restic_exporter: 'total_bytes_processed', 'total_duration' ] - print(f"# HELP {self.metric_name} {self.metric_description}.") - print(f"# TYPE {self.metric_name} counter") + print(f"# HELP {self.metric_name}_{self.job_name} {self.metric_description}.") + print(f"# TYPE {self.metric_name}_{self.job_name} counter") for counter in counters: if counter in self.summary: print(f"{self.metric_name}_{counter}{labels} {float(self.summary[counter])}") # {self.summary['timestamp']}")