AETHER-2846 Support all parameters which lists in Aether Docs

AETHER-2847 Integrating with Prometheus and record eNB information
AETHER-2848 Move SAS configuration as enodeb base, not plugin in driver code
AETHER-2879 add gps information in prometheus
AETHER-2880 add ip and port as configurable parameter in enodebd
AETHER-2897 Firmware update feature over CWMP
AETHER-3022 Integrate firmware upgrade state into configuration workflow
AETHER-3120 Develop ACS state machine with firmware upgrade feature

Change-Id: I0bcbf2229ba3c1638f2a997f3c651f8d6240145d
diff --git a/main.py b/main.py
index aae8e96..c34aa0d 100644
--- a/main.py
+++ b/main.py
@@ -16,6 +16,7 @@
 from unittest import mock
 
 from lte.protos.mconfig import mconfigs_pb2
+from configuration.service_configs import load_service_config
 from common.sentry import sentry_init
 from common.service import MagmaService
 from enodeb_status import (
@@ -30,6 +31,7 @@
 from rpc_servicer import EnodebdRpcServicer
 from stats_manager import StatsManager
 from tr069.server import tr069_server
+from prometheus_client import start_http_server as prometheus_start_http_server
 
 
 def get_context(ip: str):
@@ -47,6 +49,19 @@
     service = MagmaService('enodebd', mconfigs_pb2.EnodebD())
     logger.init()
 
+    enodebd_cfg = load_service_config('enodebd')
+    prometheus_cfg = enodebd_cfg.get("prometheus", None)
+
+    if not prometheus_cfg:
+        logger.warning("Prometheus configuration wasn't found in enodebd configuration.")
+    else:
+        prometheus_ip = prometheus_cfg.get("ip")
+        prometheus_port = prometheus_cfg.get("port")
+        prometheus_start_http_server(prometheus_port, addr=prometheus_ip)
+        logger.info(
+            "Starting Prometheus server on address %s:%d",
+            prometheus_ip, prometheus_port)
+
     # Optionally pipe errors to Sentry
     sentry_init(service_name=service.name)