diff --git a/aviso-server/monitoring/aviso_monitoring/reporter/aviso_auth_reporter.py b/aviso-server/monitoring/aviso_monitoring/reporter/aviso_auth_reporter.py index 8d50cd9..7a118f8 100644 --- a/aviso-server/monitoring/aviso_monitoring/reporter/aviso_auth_reporter.py +++ b/aviso-server/monitoring/aviso_monitoring/reporter/aviso_auth_reporter.py @@ -198,7 +198,6 @@ def __init__(self, *args, **kwargs): self.critical_t = kwargs["critical_t"] self.req_timeout = kwargs["req_timeout"] self.metric_server_url = kwargs["metric_server_url"] - self.opsview_reporter = OpsviewReporter() super().__init__(*args, **kwargs) def metric(self): @@ -210,13 +209,13 @@ def metric(self): # fetch the cluster metrics if self.metric_server_url: - metrics = self.opsview_reporter.retrieve_metrics([self.metric_server_url], self.req_timeout)[ + metrics = OpsviewReporter.retrieve_metrics([self.metric_server_url], self.req_timeout)[ self.metric_server_url ] if metrics: logger.debug(f"Processing tlm {self.metric_name}...") - av_pod = self.opsview_reporter.read_from_metrics(metrics, pattern) + av_pod = OpsviewReporter.read_from_metrics(metrics, pattern) if av_pod: av_pod = int(av_pod) if av_pod <= self.critical_t: diff --git a/aviso-server/monitoring/aviso_monitoring/reporter/aviso_rest_reporter.py b/aviso-server/monitoring/aviso_monitoring/reporter/aviso_rest_reporter.py index cfa1e66..da520a8 100644 --- a/aviso-server/monitoring/aviso_monitoring/reporter/aviso_rest_reporter.py +++ b/aviso-server/monitoring/aviso_monitoring/reporter/aviso_rest_reporter.py @@ -179,7 +179,6 @@ def __init__(self, *args, **kwargs): self.critical_t = kwargs["critical_t"] self.req_timeout = kwargs["req_timeout"] self.metric_server_url = kwargs["metric_server_url"] - self.opsview_reporter = OpsviewReporter() super().__init__(*args, **kwargs) def metric(self): @@ -191,13 +190,13 @@ def metric(self): # fetch the cluster metrics if self.metric_server_url: - metrics = self.opsview_reporter.retrieve_metrics([self.metric_server_url], self.req_timeout)[ + metrics = OpsviewReporter.retrieve_metrics([self.metric_server_url], self.req_timeout)[ self.metric_server_url ] if metrics: logger.debug(f"Processing tlm {self.metric_name}...") - av_pod = self.opsview_reporter.read_from_metrics(metrics, pattern) + av_pod = OpsviewReporter.read_from_metrics(metrics, pattern) if av_pod: av_pod = int(av_pod) if av_pod <= self.critical_t: diff --git a/aviso-server/monitoring/aviso_monitoring/reporter/etcd_reporter.py b/aviso-server/monitoring/aviso_monitoring/reporter/etcd_reporter.py index bb705c7..6d6900b 100644 --- a/aviso-server/monitoring/aviso_monitoring/reporter/etcd_reporter.py +++ b/aviso-server/monitoring/aviso_monitoring/reporter/etcd_reporter.py @@ -23,7 +23,6 @@ def __init__(self, config, *args, **kwargs): self.req_timeout = self.etcd_config["req_timeout"] self.member_urls = self.etcd_config["member_urls"] self.tlms = self.etcd_config["tlms"] - self.opsview_reporter = OpsviewReporter() super().__init__(config, *args, **kwargs) def process_messages(self): @@ -34,7 +33,7 @@ def process_messages(self): logger.debug("Etcd processing metrics...") # fetch the raw tlms provided by etcd - raw_tlms = self.opsview_reporter.retrieve_metrics(self.member_urls, self.req_timeout) # noqa: F841 + raw_tlms = OpsviewReporter.retrieve_metrics(self.member_urls, self.req_timeout) # noqa: F841 # array of metric to return metrics = []