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