- self.framework.observe(self.on["prometheus"].relation_changed, self.configure_pod)
- self.framework.observe(self.on["prometheus"].relation_broken, self.configure_pod)
+ self.grafana_cluster = GrafanaCluster(self, "cluster")
+ self.mysql_client = MysqlClient(self, "db")
+ # Observe events
+ event_observer_mapping = {
+ self.on["prometheus"].relation_changed: self.configure_pod,
+ self.on["prometheus"].relation_broken: self.configure_pod,
+ self.on["db"].relation_changed: self.configure_pod,
+ self.on["db"].relation_broken: self.configure_pod,
+ }
+ for event, observer in event_observer_mapping.items():
+ self.framework.observe(event, observer)