collector.collect_forever()
except Exception as e:
log.error("Failed to start MON Collector")
- log.debug("Exception: %s", str(e))
+ log.exception("Exception: %s", str(e))
else:
log.error("Failed to start MON Collector")
dashboarder.dashboard_forever()
except Exception as e:
log.error("Failed to start MON Dashboarder")
- log.debug("Exception: %s", str(e))
+ log.exception("Exception: %s", str(e))
else:
log.error("Failed to start MON Dashboarder")
evaluator.evaluate_forever()
except Exception as e:
log.error("Failed to start MON Evaluator")
- log.debug("Exception: %s", str(e))
+ log.exception("Exception: %s", str(e))
else:
log.error("Failed to start MON Evaluator")
server.run()
except Exception as e:
log.error("Failed to start MON Server")
- log.debug("Exception: %s", str(e))
+ log.exception("Exception: %s", str(e))
else:
log.error("Failed to start MON Server")
bootstrap_servers=[config.conf.get("message", {}).get("host",
"kafka") + ":" + config.conf["message"]
.get("port")])
- topics = consumer.topics()
- logging.debug("Number of topics found: %s", len(topics))
+ all_topics = consumer.topics()
+ logging.debug("Number of topics found: %s", len(all_topics))
+
+ # Send dummy message in kafka topics. If kafka is not ready exception will be thrown.
+ producer = kafka.KafkaProducer(bootstrap_servers=[config.conf.get("message", {}).get("host",
+ "kafka") + ":" + config.conf["message"]
+ .get("port")])
+ mon_topics = ["alarm_request", "users", "project"]
+ for mon_topic in mon_topics:
+ producer.send(mon_topic, key=b"echo", value=b"dummy message")
+
+ # Kafka is ready now
kafka_ready = True
except Exception as e:
logging.info("Error when trying to get kafka status.")
async def start(self):
topics = ["users", "project"]
- await self.msg_bus.aioread(topics, self._user_msg)
+ try:
+ await self.msg_bus.aioread(topics, self._user_msg)
+ except Exception as e:
+ # Failed to subscribe to kafka topics
+ log.error("Error when subscribing to topics %s", str(topics))
+ log.exception("Exception %s", str(e))
async def _user_msg(self, topic, key, values):
log.debug("Message from kafka bus received: topic: %s and values: %s and key: %s", topic, values, key)
topics = [
"alarm_request"
]
- await self.msg_bus.aioread(topics, self._process_msg)
+ try:
+ await self.msg_bus.aioread(topics, self._process_msg)
+ except Exception as e:
+ # Failed to subscribe to kafka topic
+ log.exception("Error when subscribing to topics %s", str(topics))
+ raise e
async def _process_msg(self, topic, key, values):
log.info("Message arrived: %s", values)
python-ceilometerclient==2.9.*
python-novaclient==12.0.*
python-neutronclient==5.1.*
+pymongo==3.11.*
+pycrypto==2.6.*
+juju==2.8.*
+kubernetes==12.0.*
git+https://osm.etsi.org/gerrit/osm/common.git#egg=osm-common
git+https://osm.etsi.org/gerrit/osm/N2VC.git#egg=n2vc