diff --git a/configs/310014.yaml.in b/configs/310014.yaml.in index cbcf47791..79a38bf86 100644 --- a/configs/310014.yaml.in +++ b/configs/310014.yaml.in @@ -162,6 +162,9 @@ upf: subnet: - addr: 10.45.0.1/16 - addr: 2001:db8:cafe::1/48 + metrics: + - addr: 127.0.0.7 + port: 9090 hss: freeDiameter: @@ -226,6 +229,9 @@ pcf: sbi: - addr: 127.0.0.13 port: 7777 + metrics: + - addr: 127.0.0.13 + port: 9090 nssf: sbi: diff --git a/configs/csfb.yaml.in b/configs/csfb.yaml.in index b28f7af0d..6ec6b1f08 100644 --- a/configs/csfb.yaml.in +++ b/configs/csfb.yaml.in @@ -196,6 +196,9 @@ upf: subnet: - addr: 10.45.0.1/16 - addr: 2001:db8:cafe::1/48 + metrics: + - addr: 127.0.0.7 + port: 9090 hss: freeDiameter: @@ -255,6 +258,9 @@ pcf: sbi: - addr: 127.0.0.13 port: 7777 + metrics: + - addr: 127.0.0.13 + port: 9090 nssf: sbi: diff --git a/configs/non3gpp.yaml.in b/configs/non3gpp.yaml.in index abe0757d0..3c0c4c023 100644 --- a/configs/non3gpp.yaml.in +++ b/configs/non3gpp.yaml.in @@ -164,6 +164,9 @@ upf: subnet: - addr: 10.45.0.1/16 - addr: 2001:db8:cafe::1/48 + metrics: + - addr: 127.0.0.7 + port: 9090 hss: freeDiameter: @@ -225,6 +228,9 @@ pcf: sbi: - addr: 127.0.0.13 port: 7777 + metrics: + - addr: 127.0.0.13 + port: 9090 nssf: sbi: diff --git a/src/pcf/init.c b/src/pcf/init.c index b6a452681..09c46912c 100644 --- a/src/pcf/init.c +++ b/src/pcf/init.c @@ -28,8 +28,8 @@ int pcf_initialize() { int rv; - ogs_sbi_context_init(); ogs_metrics_context_init(); + ogs_sbi_context_init(); pcf_context_init(); rv = ogs_sbi_context_parse_config("pcf", "nrf", "scp"); @@ -41,13 +41,13 @@ int pcf_initialize() rv = pcf_context_parse_config(); if (rv != OGS_OK) return rv; - rv = pcf_metrics_open(); - if (rv != 0) return OGS_ERROR; - rv = ogs_log_config_domain( ogs_app()->logger.domain, ogs_app()->logger.level); if (rv != OGS_OK) return rv; + rv = pcf_metrics_open(); + if (rv != 0) return OGS_ERROR; + rv = ogs_dbi_init(ogs_app()->db_uri); if (rv != OGS_OK) return rv; @@ -93,13 +93,14 @@ void pcf_terminate(void) ogs_timer_delete(t_termination_holding); pcf_sbi_close(); + pcf_metrics_close(); ogs_dbi_final(); pcf_context_final(); - pcf_metrics_close(); ogs_sbi_context_final(); + ogs_metrics_context_final(); } static void pcf_main(void *data) diff --git a/src/upf/init.c b/src/upf/init.c index 2e80a02f3..d5c4622bc 100644 --- a/src/upf/init.c +++ b/src/upf/init.c @@ -31,10 +31,10 @@ int upf_initialize() { int rv; + ogs_metrics_context_init(); ogs_gtp_context_init(OGS_MAX_NUM_OF_GTPU_RESOURCE); ogs_pfcp_context_init(); - ogs_metrics_context_init(); upf_context_init(); upf_event_init(); upf_gtp_init(); @@ -54,9 +54,6 @@ int upf_initialize() rv = upf_context_parse_config(); if (rv != OGS_OK) return rv; - rv = upf_metrics_open(); - if (rv != 0) return OGS_ERROR; - rv = ogs_log_config_domain( ogs_app()->logger.domain, ogs_app()->logger.level); if (rv != OGS_OK) return rv; @@ -64,6 +61,9 @@ int upf_initialize() rv = ogs_pfcp_ue_pool_generate(); if (rv != OGS_OK) return rv; + rv = upf_metrics_open(); + if (rv != 0) return OGS_ERROR; + rv = upf_pfcp_open(); if (rv != OGS_OK) return rv; @@ -88,12 +88,12 @@ void upf_terminate(void) upf_pfcp_close(); upf_gtp_close(); + upf_metrics_close(); upf_context_final(); ogs_pfcp_context_final(); ogs_gtp_context_final(); - upf_metrics_close(); ogs_metrics_context_final(); ogs_pfcp_xact_final();