Wei-Yu Chen | ad55cb8 | 2022-02-15 20:07:01 +0800 | [diff] [blame^] | 1 | // 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 | |
| 6 | syntax = "proto3"; |
| 7 | |
| 8 | package magma.orc8r; |
| 9 | |
| 10 | import "metrics.proto"; |
| 11 | import "orc8r/protos/common.proto"; |
| 12 | |
| 13 | option go_package = "magma/orc8r/lib/go/protos"; |
| 14 | |
| 15 | // For each metric name tracked, we use an enum |
| 16 | enum MetricName { |
| 17 | // Prometheus metrics |
| 18 | process_start_time_seconds = 0; |
| 19 | process_virtual_memory_bytes = 1; |
| 20 | process_resident_memory_bytes = 2; |
| 21 | process_cpu_seconds_total = 3; |
| 22 | process_open_fds = 4; |
| 23 | process_max_fds = 5; |
| 24 | |
| 25 | // subscriberdb metrics |
| 26 | s6a_auth_success = 6; |
| 27 | s6a_auth_failure = 7; |
| 28 | s6a_location_update = 8; |
| 29 | diameter_capabilities_exchange = 9; |
| 30 | diameter_watchdog = 10; |
| 31 | diameter_disconnect = 11; |
| 32 | |
| 33 | // More prometheus metrics |
| 34 | python_info = 50; |
| 35 | |
| 36 | // Metricsd metrics |
| 37 | service_metrics_collected = 60; |
| 38 | process_uptime_seconds = 61; |
| 39 | |
| 40 | // mobilityd metrics |
| 41 | ip_address_allocated = 100; |
| 42 | ip_address_released = 101; |
| 43 | ip_already_allocated = 102; |
| 44 | ip_allocation_failure = 103; |
| 45 | |
| 46 | // enodebd metrics |
| 47 | enodeb_mgmt_connected = 200; |
| 48 | enodeb_opstate_enabled = 201; |
| 49 | enodeb_rf_tx_enabled = 202; |
| 50 | enodeb_gps_connected = 203; |
| 51 | enodeb_ptp_connected = 204; |
| 52 | enodeb_mme_connected = 205; |
| 53 | rrc_estab_attempts = 206; |
| 54 | rrc_estab_successes = 207; |
| 55 | pdcp_user_plane_bytes_ul = 208; |
| 56 | pdcp_user_plane_bytes_dl = 209; |
| 57 | rrc_reestab_attempts = 210; |
| 58 | rrc_reestab_attempts_reconf_fail = 211; |
| 59 | rrc_reestab_attempts_ho_fail = 212; |
| 60 | rrc_reestab_attempts_other = 213; |
| 61 | rrc_reestab_successes = 214; |
| 62 | erab_estab_attempts = 215; |
| 63 | erab_estab_successes = 216; |
| 64 | erab_estab_failures = 217; |
| 65 | erab_release_requests = 218; |
| 66 | erab_release_requests_user_inactivity = 219; |
| 67 | erab_release_requests_normal = 220; |
| 68 | erab_release_requests_radio_resources_not_available = 221; |
| 69 | erab_release_requests_reduce_load = 222; |
| 70 | erab_release_requests_fail_in_radio_proc = 223; |
| 71 | erab_release_requests_eutran_reas = 224; |
| 72 | erab_release_requests_radio_radio_conn_lost = 225; |
| 73 | erab_release_requests_oam_intervention = 226; |
| 74 | enodeb_mgmt_configured = 227; |
| 75 | enodeb_reboot_timer_active = 228; |
| 76 | enodeb_reboots = 229; |
| 77 | enodeb_rf_tx_desired = 230; |
| 78 | |
| 79 | // Kernsnoopd metrics |
| 80 | magma_bytes_sent_total = 260; |
| 81 | linux_bytes_sent_total = 261; |
| 82 | |
| 83 | // Magmad metrics |
| 84 | magmad_ping_rtt_ms = 300; |
| 85 | cpu_percent = 301; |
| 86 | swap_memory_percent = 302; |
| 87 | virtual_memory_percent = 303; |
| 88 | disk_percent = 304; |
| 89 | bytes_sent = 305; |
| 90 | bytes_received = 306; |
| 91 | temperature = 307; |
| 92 | checkin_status = 308; |
| 93 | streamer_responses = 309; |
| 94 | mem_total = 310; |
| 95 | mem_available = 311; |
| 96 | mem_used = 312; |
| 97 | mem_free = 313; |
| 98 | bootstrap_exception = 314; |
| 99 | upgrader2_time_taken = 315; |
| 100 | upgrader2_error = 316; |
| 101 | upgrader2_prepared = 317; |
| 102 | upgrader2_downloaded = 318; |
| 103 | upgrader2_canary = 319; |
| 104 | upgrader2_stable = 320; |
| 105 | upgrader2_idle = 321; |
| 106 | unexpected_service_restarts = 322; |
| 107 | unattended_upgrade_status = 323; |
| 108 | service_restart_status = 324; |
| 109 | |
| 110 | // Pipelined metrics |
| 111 | dp_send_msg_error = 350; |
| 112 | arp_default_gw_mac_error = 351; |
| 113 | openflow_error_msg = 352; |
| 114 | unknown_pkt_direction = 353; |
| 115 | network_iface_status = 354; |
| 116 | enforcement_rule_install_fail = 355; |
| 117 | enforcement_stats_rule_install_fail = 356; |
| 118 | |
| 119 | /////////////////////////////// |
| 120 | // GATEWAY FAILURES & ALERTS // |
| 121 | /////////////////////////////// |
| 122 | mme_restarted = 400; |
| 123 | s1_reset_from_enb = 401; |
| 124 | |
| 125 | // SCTP |
| 126 | sctp_reset = 410; |
| 127 | sctp_shutdown = 411; |
| 128 | |
| 129 | // s6a |
| 130 | s6a_subscriberdb_connection_failure = 420; |
| 131 | s6a_auth_info_response_timer_expired = 421; |
| 132 | |
| 133 | // UE attach, Serivce Request |
| 134 | duplicate_attach_request = 430; |
| 135 | initial_context_setup_failure_received = 431; |
| 136 | initial_context_setup_request_timer_expired = 432; |
| 137 | nas_attach_accept_timer_expired = 433; |
| 138 | nas_auth_rsp_timer_expired = 434; |
| 139 | nas_security_mode_command_timer_expired = 435; |
| 140 | security_mode_reject_received = 436; |
| 141 | authentication_failure = 437; // cause=mac_failure,resync,amf |
| 142 | mme_spgw_create_session_req = 438; |
| 143 | mme_spgw_create_session_rsp = 439; |
| 144 | mme_spgw_delete_session_req = 440; |
| 145 | mme_spgw_delete_session_rsp = 441; |
| 146 | |
| 147 | // UE S1AP context |
| 148 | ue_context_release_request = 450; |
| 149 | ue_context_release_command_timer_expired = 451; |
| 150 | |
| 151 | // Detach |
| 152 | implicit_detach_timer_expired = 452; |
| 153 | |
| 154 | // eNB SCTP shutdown context clean up time |
| 155 | enb_sctp_shutdown_ue_clean_up_timer_expired = 453; |
| 156 | |
| 157 | // Other errors |
| 158 | s1ap_error_ind_received = 480; |
| 159 | gtpu_error_ind_received = 481; |
| 160 | nas_non_delivery_indication_received = 482; |
| 161 | emm_status_received = 483; |
| 162 | emm_status_sent = 484; |
| 163 | |
| 164 | //////////////////////// |
| 165 | // GATEWAY PROCEDURES // |
| 166 | //////////////////////// |
| 167 | mme_new_association = 500; |
| 168 | ue_attach = 501; // result=failure,accept,complete |
| 169 | service_request = 502; |
| 170 | ue_detach = 503; // cause=network_initiated, |
| 171 | // deregister_ue,implicit_detach, |
| 172 | // ue_initiated |
| 173 | spgw_create_session = 504; |
| 174 | spgw_delete_session = 505; |
| 175 | ue_pdn_connection = 506; |
| 176 | tracking_area_update = 507; |
| 177 | s1_setup = 508; |
| 178 | |
| 179 | // Generic service metrics |
| 180 | service_errors = 550; |
| 181 | } |
| 182 | |
| 183 | // Possible labels, used as metric_name{label_name=label_value} |
| 184 | enum MetricLabelName { |
| 185 | result = 0; |
| 186 | cause = 1; |
| 187 | tau_type = 2; |
| 188 | pdn_type = 3; |
| 189 | action = 4; |
| 190 | host = 5; // magmad_ping_rtt_ms |
| 191 | metric = 6; // magmad_ping_rtt_ms |
| 192 | patchlevel = 7; // python_info |
| 193 | minor = 8; // python_info |
| 194 | major = 9; // python_info |
| 195 | version = 10; // python_info |
| 196 | implementation = 11; // python_info |
| 197 | sensor = 12; // magmad_temperature |
| 198 | error_code = 13; |
| 199 | error_type = 14; |
| 200 | iface_name = 15; // pipelined network_iface_status |
| 201 | service_name = 16; // magmad unexpected_service_restarts |
| 202 | rule_id = 17; // pipelined rule install failures |
| 203 | imsi = 18; // pipelined rule install failures |
| 204 | dest_service = 19; // kernsnoopd name of destination service |
| 205 | binary_name = 20; // kernsnoopd name of linux binary |
| 206 | } |
| 207 | |
| 208 | message MetricsContainer { |
| 209 | string gatewayId = 1; |
| 210 | // TODO: we should strip this out of metricsd (or duplicate it ourselves) |
| 211 | // Prometheus 2 no longer supports protobuf client model |
| 212 | repeated io.prometheus.client.MetricFamily family = 2; |
| 213 | } |
| 214 | |
| 215 | message PushedMetric { |
| 216 | string metricName = 1; |
| 217 | double value = 2; |
| 218 | int64 timestampMS = 3; |
| 219 | repeated LabelPair labels = 4; |
| 220 | } |
| 221 | |
| 222 | message LabelPair { |
| 223 | string name = 1; |
| 224 | string value = 2; |
| 225 | } |
| 226 | |
| 227 | message PushedMetricsContainer { |
| 228 | string networkId = 1; |
| 229 | repeated PushedMetric metrics = 2; |
| 230 | } |
| 231 | |
| 232 | service MetricsController { |
| 233 | // Report a collection of metrics from a service |
| 234 | rpc Collect(MetricsContainer) returns (Void) {} |
| 235 | |
| 236 | // Push a collection of metrics to metricsd |
| 237 | rpc Push(PushedMetricsContainer) returns (Void) {} |
| 238 | } |