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