Skip to content
Snippets Groups Projects
Commit ebfe46cf authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

NBI component:

- Deactivated metrics as no endpoint uses them and they cause "address already in use" when launching multiple `gunicorn` workers.
parent 686b4086
No related branches found
No related tags found
4 merge requests!346Draft: support for restconf protocol,!345Draft: support ipinfusion devices via netconf,!322Resolve "(CTTC) Update NBI WebSocket endpoints to Flask-SocketIO and use gunicorn",!286Resolve "(CTTC) Implement integration test between E2E-IP-Optical SDN Controllers"
......@@ -33,7 +33,10 @@ spec:
imagePullPolicy: Always
ports:
- containerPort: 8080
- containerPort: 9192
# Metrics disabled for now. No NBI endpoint uses it and
# causes "address already in use" when deploying multiple
# gunicorn workers.
#- containerPort: 9192
env:
- name: LOG_LEVEL
value: "INFO"
......@@ -78,7 +81,10 @@ spec:
protocol: TCP
port: 8080
targetPort: 8080
- name: metrics
protocol: TCP
port: 9192
targetPort: 9192
# Metrics disabled for now. No NBI endpoint uses it and
# causes "address already in use" when deploying multiple
# gunicorn workers.
#- name: metrics
# protocol: TCP
# port: 9192
# targetPort: 9192
......@@ -14,12 +14,23 @@
import logging
from typing import Optional
from prometheus_client import start_http_server
# NOTE: Metrics disabled for now. No NBI endpoint uses it and
# causes "address already in use" when deploying multiple
# gunicorn workers.
#from prometheus_client import start_http_server
from common.Constants import ServiceNameEnum
from common.Settings import (
ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC,
get_env_var_name, get_http_bind_address, get_log_level,
get_metrics_port, get_service_baseurl_http, get_service_port_http,
# NOTE: Metrics disabled for now. No NBI endpoint uses it and
# causes "address already in use" when deploying multiple
# gunicorn workers.
#get_metrics_port,
get_service_baseurl_http, get_service_port_http,
wait_for_environment_variables
)
from .NbiApplication import NbiApplication
......@@ -73,8 +84,11 @@ def configure_nbi(
LOGGER.info('Starting...')
# Start metrics server
metrics_port = get_metrics_port()
start_http_server(metrics_port)
# NOTE: Metrics disabled for now. No NBI endpoint uses it and
# causes "address already in use" when deploying multiple
# gunicorn workers.
#metrics_port = get_metrics_port()
#start_http_server(metrics_port)
nbi_app = NbiApplication(base_url=base_url)
......@@ -85,7 +99,7 @@ def configure_nbi(
return nbi_app
nbi_app = configure_nbi(base_url=BASE_URL)
_nbi_app = configure_nbi(base_url=BASE_URL)
if __name__ == '__main__':
# Only used to run it locally during development stage;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment