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