From c4124b1b050da5b079a2966b6572ca6211e513aa Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Wed, 13 Mar 2024 13:17:46 +0000 Subject: [PATCH] fix monitoring topic --- wis2_gdc/registrar.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wis2_gdc/registrar.py b/wis2_gdc/registrar.py index ab77999..752e9c9 100644 --- a/wis2_gdc/registrar.py +++ b/wis2_gdc/registrar.py @@ -88,7 +88,7 @@ def register(self, metadata: dict) -> None: self.metadata = metadata self.centre_id = self.metadata['id'].split(':')[3] - topic = f"report/a/wis2/{self.centre_id}" + topic = f'monitor/a/wis2/{CENTRE_ID}/{self.centre_id}' centre_id_labels = [self.centre_id, CENTRE_ID] LOGGER.debug(f'Metadata: {json.dumps(self.metadata, indent=4)}') @@ -96,7 +96,7 @@ def register(self, metadata: dict) -> None: LOGGER.info('Running ETS') ets_results = self._run_ets() - if self.broker is not None: + if PUBLISH_REPORTS: LOGGER.info('Publishing ETS report to broker') self.broker.pub(topic, json.dumps(ets_results)) @@ -129,8 +129,9 @@ def register(self, metadata: dict) -> None: if RUN_KPI: LOGGER.info('Running KPI') kpi_results = self._run_kpi() + LOGGER.info(f'RESULTS {kpi_results}') - if self.broker is not None: + if PUBLISH_REPORTS: LOGGER.info('Publishing KPI report to broker') self.broker.pub(topic, json.dumps(kpi_results))