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 | ) |
Wei-Yu Chen | 678f0a5 | 2021-12-21 13:50:52 +0800 | [diff] [blame^] | 57 | STAT_ENODEB_LAST_CONFIGURED = Gauge( |
| 58 | 'enodeb_last_configured', |
| 59 | 'Information of configured eNodeB', ['serial_number', 'ip_address', 'gps_lat', 'gps_lon'] |
| 60 | ) |
Wei-Yu Chen | 49950b9 | 2021-11-08 19:19:18 +0800 | [diff] [blame] | 61 | |
| 62 | # Metrics that are accumulated by eNodeB. Use gauges to avoid 'double-counting', |
| 63 | # since eNodeB does accumulation. |
| 64 | STAT_RRC_ESTAB_ATT = Gauge( |
| 65 | 'rrc_estab_attempts', 'RRC establishment attempts', |
| 66 | ) |
| 67 | STAT_RRC_ESTAB_SUCC = Gauge( |
| 68 | 'rrc_estab_successes', 'RRC establishment successes', |
| 69 | ) |
| 70 | STAT_RRC_REESTAB_ATT = Gauge( |
| 71 | 'rrc_reestab_attempts', 'RRC re-establishment attempts', |
| 72 | ) |
| 73 | STAT_RRC_REESTAB_ATT_RECONF_FAIL = Gauge( |
| 74 | 'rrc_reestab_attempts_reconf_fail', |
| 75 | 'RRC re-establishment attempts due to reconfiguration failure', |
| 76 | ) |
| 77 | STAT_RRC_REESTAB_ATT_HO_FAIL = Gauge( |
| 78 | 'rrc_reestab_attempts_ho_fail', |
| 79 | 'RRC re-establishment attempts due to handover failure', |
| 80 | ) |
| 81 | STAT_RRC_REESTAB_ATT_OTHER = Gauge( |
| 82 | 'rrc_reestab_attempts_other', |
| 83 | 'RRC re-establishment attempts due to other cause', |
| 84 | ) |
| 85 | STAT_RRC_REESTAB_SUCC = Gauge( |
| 86 | 'rrc_reestab_successes', 'RRC re-establishment successes', |
| 87 | ) |
| 88 | STAT_ERAB_ESTAB_ATT = Gauge( |
| 89 | 'erab_estab_attempts', 'ERAB establishment attempts', |
| 90 | ) |
| 91 | STAT_ERAB_ESTAB_SUCC = Gauge( |
| 92 | 'erab_estab_successes', 'ERAB establishment successes', |
| 93 | ) |
| 94 | STAT_ERAB_ESTAB_FAIL = Gauge( |
| 95 | 'erab_estab_failures', 'ERAB establishment failures', |
| 96 | ) |
| 97 | STAT_ERAB_REL_REQ = Gauge( |
| 98 | 'erab_release_requests', 'ERAB release requests', |
| 99 | ) |
| 100 | STAT_ERAB_REL_REQ_USER_INAC = Gauge( |
| 101 | 'erab_release_requests_user_inactivity', |
| 102 | 'ERAB release requests due to user inactivity', |
| 103 | ) |
| 104 | STAT_ERAB_REL_REQ_NORMAL = Gauge( |
| 105 | 'erab_release_requests_normal', 'ERAB release requests due to normal cause', |
| 106 | ) |
| 107 | STAT_ERAB_REL_REQ_RES_NOT_AVAIL = Gauge( |
| 108 | 'erab_release_requests_radio_resources_not_available', |
| 109 | 'ERAB release requests due to radio resources not available', |
| 110 | ) |
| 111 | STAT_ERAB_REL_REQ_REDUCE_LOAD = Gauge( |
| 112 | 'erab_release_requests_reduce_load', |
| 113 | 'ERAB release requests due to reducing load in serving cell', |
| 114 | ) |
| 115 | STAT_ERAB_REL_REQ_FAIL_IN_RADIO = Gauge( |
| 116 | 'erab_release_requests_fail_in_radio_proc', |
| 117 | 'ERAB release requests due to failure in the radio interface procedure', |
| 118 | ) |
| 119 | STAT_ERAB_REL_REQ_EUTRAN_REAS = Gauge( |
| 120 | 'erab_release_requests_eutran_reas', |
| 121 | 'ERAB release requests due to EUTRAN generated reasons', |
| 122 | ) |
| 123 | STAT_ERAB_REL_REQ_RADIO_CONN_LOST = Gauge( |
| 124 | 'erab_release_requests_radio_radio_conn_lost', |
| 125 | 'ERAB release requests due to radio connection with UE lost', |
| 126 | ) |
| 127 | STAT_ERAB_REL_REQ_OAM_INTV = Gauge( |
| 128 | 'erab_release_requests_oam_intervention', |
| 129 | 'ERAB release requests due to OAM intervention', |
| 130 | ) |
| 131 | STAT_PDCP_USER_PLANE_BYTES_UL = Gauge( |
| 132 | 'pdcp_user_plane_bytes_ul', 'User plane uplink bytes at PDCP', ['enodeb'], |
| 133 | ) |
| 134 | STAT_PDCP_USER_PLANE_BYTES_DL = Gauge( |
| 135 | 'pdcp_user_plane_bytes_dl', 'User plane downlink bytes at PDCP', ['enodeb'], |
| 136 | ) |