SIENTIAPDE-1083: add env HTTP_SERVER_PORT for prometheus metrics.
This commit is contained in:
@@ -58,8 +58,9 @@ def signal_handler(_signum, _frame):
|
||||
|
||||
def start_prometheus_server():
|
||||
try:
|
||||
start_http_server(8000)
|
||||
print("Prometheus server started on port 8000.")
|
||||
port = int(os.getenv("HTTP_SERVER_PORT", 4840))
|
||||
start_http_server(port)
|
||||
print(f"Prometheus server started on port {port}.")
|
||||
metrics.APP_UP.labels(pod_id=POD_ID).set(1) # Mark app as UP
|
||||
except Exception as e:
|
||||
print(f"Failed to start Prometheus server: {e}")
|
||||
|
||||
Reference in New Issue
Block a user