Wei-Yu Chen | ad55cb8 | 2022-02-15 20:07:01 +0800 | [diff] [blame^] | 1 | # SPDX-FileCopyrightText: 2020 The Magma Authors. |
| 2 | # SPDX-FileCopyrightText: 2022 Open Networking Foundation <support@opennetworking.org> |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | |
Wei-Yu Chen | 49950b9 | 2021-11-08 19:19:18 +0800 | [diff] [blame] | 6 | """ |
| 7 | Copyright 2020 The Magma Authors. |
| 8 | |
| 9 | This source code is licensed under the BSD-style license found in the |
| 10 | LICENSE file in the root directory of this source tree. |
| 11 | |
| 12 | Unless required by applicable law or agreed to in writing, software |
| 13 | distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | See the License for the specific language governing permissions and |
| 16 | limitations under the License. |
| 17 | """ |
| 18 | |
| 19 | from prometheus_client import Counter, Gauge |
| 20 | |
| 21 | # Gauges for current eNodeB status |
| 22 | STAT_ENODEB_CONNECTED = Gauge( |
| 23 | 'enodeb_mgmt_connected', |
| 24 | 'ENodeB management plane connected', |
| 25 | ) |
| 26 | STAT_ENODEB_CONFIGURED = Gauge( |
| 27 | 'enodeb_mgmt_configured', |
| 28 | 'ENodeB is in configured state', |
| 29 | ) |
| 30 | STAT_OPSTATE_ENABLED = Gauge( |
| 31 | 'enodeb_opstate_enabled', |
| 32 | 'ENodeB operationally enabled', |
| 33 | ) |
| 34 | STAT_RF_TX_ENABLED = Gauge( |
| 35 | 'enodeb_rf_tx_enabled', |
| 36 | 'ENodeB RF transmitter enabled', |
| 37 | ) |
| 38 | STAT_RF_TX_DESIRED = Gauge( |
| 39 | 'enodeb_rf_tx_desired', |
| 40 | 'ENodeB RF transmitter desired state', |
| 41 | ) |
| 42 | STAT_GPS_CONNECTED = Gauge( |
| 43 | 'enodeb_gps_connected', |
| 44 | 'ENodeB GPS synchronized', |
| 45 | ) |
| 46 | STAT_PTP_CONNECTED = Gauge( |
| 47 | 'enodeb_ptp_connected', |
| 48 | 'ENodeB PTP/1588 synchronized', |
| 49 | ) |
| 50 | STAT_MME_CONNECTED = Gauge( |
| 51 | 'enodeb_mme_connected', |
| 52 | 'ENodeB connected to MME', |
| 53 | ) |
| 54 | STAT_ENODEB_REBOOT_TIMER_ACTIVE = Gauge( |
| 55 | 'enodeb_reboot_timer_active', |
| 56 | 'Timer for ENodeB reboot active', |
| 57 | ) |
| 58 | STAT_ENODEB_REBOOTS = Counter( |
| 59 | 'enodeb_reboots', |
| 60 | 'ENodeB reboots by enodebd', ['cause'], |
| 61 | ) |
Wei-Yu Chen | 678f0a5 | 2021-12-21 13:50:52 +0800 | [diff] [blame] | 62 | STAT_ENODEB_LAST_CONFIGURED = Gauge( |
| 63 | 'enodeb_last_configured', |
| 64 | 'Information of configured eNodeB', ['serial_number', 'ip_address', 'gps_lat', 'gps_lon'] |
| 65 | ) |
Wei-Yu Chen | 49950b9 | 2021-11-08 19:19:18 +0800 | [diff] [blame] | 66 | |
| 67 | # Metrics that are accumulated by eNodeB. Use gauges to avoid 'double-counting', |
| 68 | # since eNodeB does accumulation. |
| 69 | STAT_RRC_ESTAB_ATT = Gauge( |
| 70 | 'rrc_estab_attempts', 'RRC establishment attempts', |
| 71 | ) |
| 72 | STAT_RRC_ESTAB_SUCC = Gauge( |
| 73 | 'rrc_estab_successes', 'RRC establishment successes', |
| 74 | ) |
| 75 | STAT_RRC_REESTAB_ATT = Gauge( |
| 76 | 'rrc_reestab_attempts', 'RRC re-establishment attempts', |
| 77 | ) |
| 78 | STAT_RRC_REESTAB_ATT_RECONF_FAIL = Gauge( |
| 79 | 'rrc_reestab_attempts_reconf_fail', |
| 80 | 'RRC re-establishment attempts due to reconfiguration failure', |
| 81 | ) |
| 82 | STAT_RRC_REESTAB_ATT_HO_FAIL = Gauge( |
| 83 | 'rrc_reestab_attempts_ho_fail', |
| 84 | 'RRC re-establishment attempts due to handover failure', |
| 85 | ) |
| 86 | STAT_RRC_REESTAB_ATT_OTHER = Gauge( |
| 87 | 'rrc_reestab_attempts_other', |
| 88 | 'RRC re-establishment attempts due to other cause', |
| 89 | ) |
| 90 | STAT_RRC_REESTAB_SUCC = Gauge( |
| 91 | 'rrc_reestab_successes', 'RRC re-establishment successes', |
| 92 | ) |
| 93 | STAT_ERAB_ESTAB_ATT = Gauge( |
| 94 | 'erab_estab_attempts', 'ERAB establishment attempts', |
| 95 | ) |
| 96 | STAT_ERAB_ESTAB_SUCC = Gauge( |
| 97 | 'erab_estab_successes', 'ERAB establishment successes', |
| 98 | ) |
| 99 | STAT_ERAB_ESTAB_FAIL = Gauge( |
| 100 | 'erab_estab_failures', 'ERAB establishment failures', |
| 101 | ) |
| 102 | STAT_ERAB_REL_REQ = Gauge( |
| 103 | 'erab_release_requests', 'ERAB release requests', |
| 104 | ) |
| 105 | STAT_ERAB_REL_REQ_USER_INAC = Gauge( |
| 106 | 'erab_release_requests_user_inactivity', |
| 107 | 'ERAB release requests due to user inactivity', |
| 108 | ) |
| 109 | STAT_ERAB_REL_REQ_NORMAL = Gauge( |
| 110 | 'erab_release_requests_normal', 'ERAB release requests due to normal cause', |
| 111 | ) |
| 112 | STAT_ERAB_REL_REQ_RES_NOT_AVAIL = Gauge( |
| 113 | 'erab_release_requests_radio_resources_not_available', |
| 114 | 'ERAB release requests due to radio resources not available', |
| 115 | ) |
| 116 | STAT_ERAB_REL_REQ_REDUCE_LOAD = Gauge( |
| 117 | 'erab_release_requests_reduce_load', |
| 118 | 'ERAB release requests due to reducing load in serving cell', |
| 119 | ) |
| 120 | STAT_ERAB_REL_REQ_FAIL_IN_RADIO = Gauge( |
| 121 | 'erab_release_requests_fail_in_radio_proc', |
| 122 | 'ERAB release requests due to failure in the radio interface procedure', |
| 123 | ) |
| 124 | STAT_ERAB_REL_REQ_EUTRAN_REAS = Gauge( |
| 125 | 'erab_release_requests_eutran_reas', |
| 126 | 'ERAB release requests due to EUTRAN generated reasons', |
| 127 | ) |
| 128 | STAT_ERAB_REL_REQ_RADIO_CONN_LOST = Gauge( |
| 129 | 'erab_release_requests_radio_radio_conn_lost', |
| 130 | 'ERAB release requests due to radio connection with UE lost', |
| 131 | ) |
| 132 | STAT_ERAB_REL_REQ_OAM_INTV = Gauge( |
| 133 | 'erab_release_requests_oam_intervention', |
| 134 | 'ERAB release requests due to OAM intervention', |
| 135 | ) |
| 136 | STAT_PDCP_USER_PLANE_BYTES_UL = Gauge( |
| 137 | 'pdcp_user_plane_bytes_ul', 'User plane uplink bytes at PDCP', ['enodeb'], |
| 138 | ) |
| 139 | STAT_PDCP_USER_PLANE_BYTES_DL = Gauge( |
| 140 | 'pdcp_user_plane_bytes_dl', 'User plane downlink bytes at PDCP', ['enodeb'], |
| 141 | ) |