blob: 90c4b4f08fd6a1aaf4fb9924f99e86ba5fbff34b [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)
57
58# Metrics that are accumulated by eNodeB. Use gauges to avoid 'double-counting',
59# since eNodeB does accumulation.
60STAT_RRC_ESTAB_ATT = Gauge(
61 'rrc_estab_attempts', 'RRC establishment attempts',
62)
63STAT_RRC_ESTAB_SUCC = Gauge(
64 'rrc_estab_successes', 'RRC establishment successes',
65)
66STAT_RRC_REESTAB_ATT = Gauge(
67 'rrc_reestab_attempts', 'RRC re-establishment attempts',
68)
69STAT_RRC_REESTAB_ATT_RECONF_FAIL = Gauge(
70 'rrc_reestab_attempts_reconf_fail',
71 'RRC re-establishment attempts due to reconfiguration failure',
72)
73STAT_RRC_REESTAB_ATT_HO_FAIL = Gauge(
74 'rrc_reestab_attempts_ho_fail',
75 'RRC re-establishment attempts due to handover failure',
76)
77STAT_RRC_REESTAB_ATT_OTHER = Gauge(
78 'rrc_reestab_attempts_other',
79 'RRC re-establishment attempts due to other cause',
80)
81STAT_RRC_REESTAB_SUCC = Gauge(
82 'rrc_reestab_successes', 'RRC re-establishment successes',
83)
84STAT_ERAB_ESTAB_ATT = Gauge(
85 'erab_estab_attempts', 'ERAB establishment attempts',
86)
87STAT_ERAB_ESTAB_SUCC = Gauge(
88 'erab_estab_successes', 'ERAB establishment successes',
89)
90STAT_ERAB_ESTAB_FAIL = Gauge(
91 'erab_estab_failures', 'ERAB establishment failures',
92)
93STAT_ERAB_REL_REQ = Gauge(
94 'erab_release_requests', 'ERAB release requests',
95)
96STAT_ERAB_REL_REQ_USER_INAC = Gauge(
97 'erab_release_requests_user_inactivity',
98 'ERAB release requests due to user inactivity',
99)
100STAT_ERAB_REL_REQ_NORMAL = Gauge(
101 'erab_release_requests_normal', 'ERAB release requests due to normal cause',
102)
103STAT_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)
107STAT_ERAB_REL_REQ_REDUCE_LOAD = Gauge(
108 'erab_release_requests_reduce_load',
109 'ERAB release requests due to reducing load in serving cell',
110)
111STAT_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)
115STAT_ERAB_REL_REQ_EUTRAN_REAS = Gauge(
116 'erab_release_requests_eutran_reas',
117 'ERAB release requests due to EUTRAN generated reasons',
118)
119STAT_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)
123STAT_ERAB_REL_REQ_OAM_INTV = Gauge(
124 'erab_release_requests_oam_intervention',
125 'ERAB release requests due to OAM intervention',
126)
127STAT_PDCP_USER_PLANE_BYTES_UL = Gauge(
128 'pdcp_user_plane_bytes_ul', 'User plane uplink bytes at PDCP', ['enodeb'],
129)
130STAT_PDCP_USER_PLANE_BYTES_DL = Gauge(
131 'pdcp_user_plane_bytes_dl', 'User plane downlink bytes at PDCP', ['enodeb'],
132)