open5gs/src/upf/metrics.h

70 lines
2.0 KiB
C
Raw Permalink Normal View History

[UPF] Add metrics support Expose metrics with labels according to ETSI TS 128 552 V16.13.0 in UPF by using hash. The metrics are named respecting the rule: <generation>_<measurement_object_class>_<measurement_family_name>_<metric_name_as_in_TS_128_552> 5qi is not available in UPF. To present 5qi to the user, MN will have to maintain a table qfi->5qi for each QoS flow (will have to get information from SMF). So UPF has to expose qfi. qfi itself is not useful. When used, UPF will have to expose additional label to define the session (e.g. source interface). Label dnn is set to value of APN/DNN received in Establishment. Since SMF does not add APN/DNN to Establishment, the label is empty. When APN/DNN will be set by SMF, it should be added to sess in UPF and used in metrics on Modification and Deletion. Both datavolumeqosleveln3upf are exposed in bytes. MN is providing the transformation to kbits. fivegs_upffunction_upf_qosflows should expose the number of QFIs used in sessions, but exposes number of QER rules, which is currently equal to QFIs. The label snsssai is not provided since the slice is not available on UPF. Exposed metrics example: Standard counters: fivegs_ep_n3_gtp_indatapktn3upf 28637 fivegs_ep_n3_gtp_outdatapktn3upf 14729 fivegs_upffunction_sm_n4sessionestabreq 4 fivegs_upffunction_sm_n4sessionestabfail{cause="66"} 1 fivegs_upffunction_sm_n4sessionestabfail{cause="71"} 68 fivegs_upffunction_sm_n4sessionestabfail{cause="68"} 4 fivegs_upffunction_sm_n4sessionestabfail{cause="72"} 15 fivegs_upffunction_sm_n4sessionestabfail{cause="75"} 3 fivegs_upffunction_sm_n4sessionestabfail{cause="65"} 4 fivegs_upffunction_sm_n4sessionreport 0 fivegs_upffunction_sm_n4sessionreportsucc 0 fivegs_ep_n3_gtp_indatavolumeqosleveln3upf{qfi="1"} 39792997 fivegs_ep_n3_gtp_outdatavolumeqosleveln3upf{qfi="1"} 737548 Nonstandard gauge (added for controlling purposes - same metric as existing metric on AMF and SMF): fivegs_upffunction_upf_sessionnbr 1 Standard gauge: fivegs_upffunction_upf_qosflows{dnn=""} 1
2022-08-19 12:08:27 +00:00
#ifndef UPF_METRICS_H
#define UPF_METRICS_H
#include "ogs-metrics.h"
#ifdef __cplusplus
extern "C" {
#endif
/* GLOBAL */
typedef enum upf_metric_type_global_s {
UPF_METR_GLOB_CTR_GTP_INDATAPKTN3UPF = 0,
UPF_METR_GLOB_CTR_GTP_OUTDATAPKTN3UPF,
UPF_METR_GLOB_CTR_SM_N4SESSIONESTABREQ,
UPF_METR_GLOB_CTR_SM_N4SESSIONREPORT,
UPF_METR_GLOB_CTR_SM_N4SESSIONREPORTSUCC,
UPF_METR_GLOB_GAUGE_UPF_SESSIONNBR,
_UPF_METR_GLOB_MAX,
} upf_metric_type_global_t;
extern ogs_metrics_inst_t *upf_metrics_inst_global[_UPF_METR_GLOB_MAX];
int upf_metrics_init_inst_global(void);
int upf_metrics_free_inst_global(void);
[UPF] Add metrics support Expose metrics with labels according to ETSI TS 128 552 V16.13.0 in UPF by using hash. The metrics are named respecting the rule: <generation>_<measurement_object_class>_<measurement_family_name>_<metric_name_as_in_TS_128_552> 5qi is not available in UPF. To present 5qi to the user, MN will have to maintain a table qfi->5qi for each QoS flow (will have to get information from SMF). So UPF has to expose qfi. qfi itself is not useful. When used, UPF will have to expose additional label to define the session (e.g. source interface). Label dnn is set to value of APN/DNN received in Establishment. Since SMF does not add APN/DNN to Establishment, the label is empty. When APN/DNN will be set by SMF, it should be added to sess in UPF and used in metrics on Modification and Deletion. Both datavolumeqosleveln3upf are exposed in bytes. MN is providing the transformation to kbits. fivegs_upffunction_upf_qosflows should expose the number of QFIs used in sessions, but exposes number of QER rules, which is currently equal to QFIs. The label snsssai is not provided since the slice is not available on UPF. Exposed metrics example: Standard counters: fivegs_ep_n3_gtp_indatapktn3upf 28637 fivegs_ep_n3_gtp_outdatapktn3upf 14729 fivegs_upffunction_sm_n4sessionestabreq 4 fivegs_upffunction_sm_n4sessionestabfail{cause="66"} 1 fivegs_upffunction_sm_n4sessionestabfail{cause="71"} 68 fivegs_upffunction_sm_n4sessionestabfail{cause="68"} 4 fivegs_upffunction_sm_n4sessionestabfail{cause="72"} 15 fivegs_upffunction_sm_n4sessionestabfail{cause="75"} 3 fivegs_upffunction_sm_n4sessionestabfail{cause="65"} 4 fivegs_upffunction_sm_n4sessionreport 0 fivegs_upffunction_sm_n4sessionreportsucc 0 fivegs_ep_n3_gtp_indatavolumeqosleveln3upf{qfi="1"} 39792997 fivegs_ep_n3_gtp_outdatavolumeqosleveln3upf{qfi="1"} 737548 Nonstandard gauge (added for controlling purposes - same metric as existing metric on AMF and SMF): fivegs_upffunction_upf_sessionnbr 1 Standard gauge: fivegs_upffunction_upf_qosflows{dnn=""} 1
2022-08-19 12:08:27 +00:00
static inline void upf_metrics_inst_global_set(upf_metric_type_global_t t, int val)
{ ogs_metrics_inst_set(upf_metrics_inst_global[t], val); }
static inline void upf_metrics_inst_global_add(upf_metric_type_global_t t, int val)
{ ogs_metrics_inst_add(upf_metrics_inst_global[t], val); }
static inline void upf_metrics_inst_global_inc(upf_metric_type_global_t t)
{ ogs_metrics_inst_inc(upf_metrics_inst_global[t]); }
static inline void upf_metrics_inst_global_dec(upf_metric_type_global_t t)
{ ogs_metrics_inst_dec(upf_metrics_inst_global[t]); }
/* BY QFI */
typedef enum upf_metric_type_by_qfi_s {
UPF_METR_CTR_GTP_INDATAVOLUMEQOSLEVELN3UPF = 0,
UPF_METR_CTR_GTP_OUTDATAVOLUMEQOSLEVELN3UPF,
_UPF_METR_BY_QFI_MAX,
} upf_metric_type_by_qfi_t;
void upf_metrics_inst_by_qfi_add(
uint8_t qfi, upf_metric_type_by_qfi_t t, int val);
/* BY CAUSE */
typedef enum upf_metric_type_by_cause_s {
UPF_METR_CTR_SM_N4SESSIONESTABFAIL = 0,
_UPF_METR_BY_CAUSE_MAX,
} upf_metric_type_by_cause_t;
void upf_metrics_inst_by_cause_add(
uint8_t cause, upf_metric_type_by_cause_t t, int val);
/* BY DNN */
typedef enum upf_metric_type_by_dnn_s {
UPF_METR_GAUGE_UPF_QOSFLOWS = 0,
_UPF_METR_BY_DNN_MAX,
} upf_metric_type_by_dnn_t;
void upf_metrics_inst_by_dnn_add(
char *dnn, upf_metric_type_by_dnn_t t, int val);
void upf_metrics_init(void);
void upf_metrics_final(void);
[UPF] Add metrics support Expose metrics with labels according to ETSI TS 128 552 V16.13.0 in UPF by using hash. The metrics are named respecting the rule: <generation>_<measurement_object_class>_<measurement_family_name>_<metric_name_as_in_TS_128_552> 5qi is not available in UPF. To present 5qi to the user, MN will have to maintain a table qfi->5qi for each QoS flow (will have to get information from SMF). So UPF has to expose qfi. qfi itself is not useful. When used, UPF will have to expose additional label to define the session (e.g. source interface). Label dnn is set to value of APN/DNN received in Establishment. Since SMF does not add APN/DNN to Establishment, the label is empty. When APN/DNN will be set by SMF, it should be added to sess in UPF and used in metrics on Modification and Deletion. Both datavolumeqosleveln3upf are exposed in bytes. MN is providing the transformation to kbits. fivegs_upffunction_upf_qosflows should expose the number of QFIs used in sessions, but exposes number of QER rules, which is currently equal to QFIs. The label snsssai is not provided since the slice is not available on UPF. Exposed metrics example: Standard counters: fivegs_ep_n3_gtp_indatapktn3upf 28637 fivegs_ep_n3_gtp_outdatapktn3upf 14729 fivegs_upffunction_sm_n4sessionestabreq 4 fivegs_upffunction_sm_n4sessionestabfail{cause="66"} 1 fivegs_upffunction_sm_n4sessionestabfail{cause="71"} 68 fivegs_upffunction_sm_n4sessionestabfail{cause="68"} 4 fivegs_upffunction_sm_n4sessionestabfail{cause="72"} 15 fivegs_upffunction_sm_n4sessionestabfail{cause="75"} 3 fivegs_upffunction_sm_n4sessionestabfail{cause="65"} 4 fivegs_upffunction_sm_n4sessionreport 0 fivegs_upffunction_sm_n4sessionreportsucc 0 fivegs_ep_n3_gtp_indatavolumeqosleveln3upf{qfi="1"} 39792997 fivegs_ep_n3_gtp_outdatavolumeqosleveln3upf{qfi="1"} 737548 Nonstandard gauge (added for controlling purposes - same metric as existing metric on AMF and SMF): fivegs_upffunction_upf_sessionnbr 1 Standard gauge: fivegs_upffunction_upf_qosflows{dnn=""} 1
2022-08-19 12:08:27 +00:00
#ifdef __cplusplus
}
#endif
#endif /* UPF_METRICS_H */