X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fserver%2Fservice.py;h=d1b408b478df404cd70458f17ca94e76a4f62657;hb=0ccdba94d5ca1de0ff26c6aaf5a16aacc3c2fd0d;hp=94bdf4e912cdf2c6756be4631736df334bb11c47;hpb=088fbd3cc60029c62ae83a44f39f907890f832c7;p=osm%2FMON.git diff --git a/osm_mon/server/service.py b/osm_mon/server/service.py index 94bdf4e..d1b408b 100755 --- a/osm_mon/server/service.py +++ b/osm_mon/server/service.py @@ -41,11 +41,12 @@ class ServerService: severity: str, statistic: str, metric_name: str, + action: str, tags: dict, ) -> Alarm: log.debug("create_alarm") alarm = Alarm( - name, severity, threshold, operation, statistic, metric_name, tags + name, severity, threshold, operation, statistic, metric_name, action, tags ) self.common_db.create_alarm(alarm) log.info("Alarm %s created", alarm.name) @@ -59,7 +60,8 @@ class ServerService: def populate_prometheus(self): # This method can be executed infinite number of times # without side-effects. - self.common_db.common_db.set_one( + log.info("Setting up MON Exporter in prometheus") + result = self.common_db.common_db.set_one( "prometheus_jobs", {"job_name": "mon_exporter"}, { "job_name": "mon_exporter", "static_configs": [ @@ -73,3 +75,4 @@ class ServerService: fail_on_empty=False, upsert=True ) + log.info("Prometheus Jobs added > {}".format(result))