Make tcpsocket readiness and liveness configurable
[osm/devops.git] / installers / charm / prometheus / src / charm.py
index 40c4f4e..07793e0 100755 (executable)
@@ -107,7 +107,6 @@ class ConfigModel(ModelValidator):
 
 
 class PrometheusCharm(CharmedOsmBase):
-
     """Prometheus Charm."""
 
     def __init__(self, *args) -> NoReturn:
@@ -128,7 +127,13 @@ class PrometheusCharm(CharmedOsmBase):
         )
 
     def _publish_prometheus_info(self, event: EventBase) -> NoReturn:
-        self.prometheus.publish_info(self.app.name, PORT)
+        config = ConfigModel(**dict(self.config))
+        self.prometheus.publish_info(
+            self.app.name,
+            PORT,
+            user=config.web_config_username,
+            password=config.web_config_password,
+        )
 
     def _on_backup_action(self, event: EventBase) -> NoReturn:
         url = f"http://{self.model.app.name}:{PORT}/api/v1/admin/tsdb/snapshot"