| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
| khenaidoo | 5fc5cea | 2021-08-11 17:39:16 -0400 | [diff] [blame] | 3 | option go_package = "github.com/opencord/voltha-protos/v5/go/voltha"; |
| khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 4 | option java_package = "org.opencord.voltha.events"; |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 5 | |
| khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 6 | package event; |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 7 | |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 8 | import "google/api/annotations.proto"; |
| Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 9 | import "google/protobuf/timestamp.proto"; |
| Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 10 | import "voltha_protos/common.proto"; |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 11 | |
| khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 12 | |
| 13 | message EventFilterRuleKey { |
| 14 | |
| 15 | enum EventFilterRuleType { |
| 16 | filter_all = 0; |
| 17 | category = 1; |
| 18 | sub_category = 2; |
| 19 | kpi_event_type = 3; |
| 20 | config_event_type = 4; |
| 21 | device_event_type = 5; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | message EventFilterRule { |
| 26 | EventFilterRuleKey.EventFilterRuleType key = 1; |
| 27 | string value = 2; |
| 28 | } |
| 29 | message EventFilter { |
| 30 | string id = 1 ; |
| 31 | bool enable = 2; |
| 32 | string device_id = 3; |
| 33 | string event_type = 4; |
| 34 | repeated EventFilterRule rules = 5; |
| 35 | } |
| 36 | |
| 37 | message EventFilters { |
| 38 | repeated EventFilter filters = 1; |
| 39 | } |
| 40 | |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 41 | message ConfigEventType { |
| Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 42 | enum Types { |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 43 | add = 0; // A new config has been added |
| 44 | remove = 1; // A config has been removed |
| 45 | update = 2; // A config has been updated |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | message ConfigEvent { |
| Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 50 | ConfigEventType.Types type = 1; |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 51 | |
| 52 | string hash = 2; // hash for this change, can be used for quick lookup |
| 53 | string data = 3; // the actual new data, in json format |
| 54 | } |
| 55 | |
| 56 | message KpiEventType { |
| Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 57 | enum Types { |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 58 | slice = 0; // slice: a set of path/metric data for same time-stamp |
| 59 | ts = 1; // time-series: array of data for same metric |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | /* |
| 64 | * Struct to convey a dictionary of metric metadata. |
| 65 | */ |
| 66 | message MetricMetaData { |
| Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 67 | string title = 1; // Metric group or individual metric name |
| 68 | double ts = 2; // UTC time-stamp of data (seconds since epoch) of |
| 69 | // when the metric or metric group was collected. |
| 70 | // If this is a 15-min historical group, it is the |
| 71 | // time of the collection and reporting, not the |
| 72 | // start or end of the 15-min group interval. |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 73 | |
| 74 | string logical_device_id = 3; // The logical device ID of the VOLTHA |
| Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 75 | // (equivalent to the DPID that ONOS has |
| 76 | // for the VOLTHA device without the |
| 77 | // 'of:' prefix |
| 78 | string serial_no = 4; // The OLT, ONU, ... device serial number |
| 79 | string device_id = 5; // The OLT, ONU, ... physical device ID |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 80 | |
| 81 | map<string, string> context = 6; // Name value pairs that provide additional |
| Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 82 | // context information on the metrics being |
| 83 | // reported. |
| onkar.kundargi | 7b85fa1 | 2020-02-27 13:19:22 +0530 | [diff] [blame] | 84 | |
| Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 85 | string uuid = 7; // Transaction identifier used to match On |
| 86 | // Demand gRPC requests with kafka responses |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | /* |
| 90 | * Struct to convey a dictionary of metric->value pairs. Typically used in |
| 91 | * pure shared-timestamp or shared-timestamp + shared object prefix situations. |
| 92 | */ |
| 93 | message MetricValuePairs { |
| 94 | |
| 95 | // Metric / value pairs. |
| 96 | map<string, float> metrics = 1; |
| 97 | |
| 98 | } |
| 99 | |
| 100 | /* |
| 101 | * Struct to group metadata for a metric (or group of metrics) with the key-value |
| 102 | * pairs of collected metrics |
| 103 | */ |
| 104 | message MetricInformation { |
| 105 | MetricMetaData metadata = 1; |
| 106 | map<string, float> metrics = 2; |
| 107 | } |
| 108 | |
| 109 | /* |
| pnalmas | 9029942 | 2025-12-16 11:29:25 +0530 | [diff] [blame] | 110 | * Struct to group metadata for a metric (or group of metrics) with the key-value |
| pnalmas | 3bb72f7 | 2026-02-02 19:45:17 +0530 | [diff] [blame^] | 111 | * pairs of collected metrics using 64-bit double precision floating point. |
| 112 | * This supports both floating-point metrics and large integer counters up to 2^53 |
| 113 | * (e.g., FEC counters, GEM counters, optical power levels). |
| pnalmas | 9029942 | 2025-12-16 11:29:25 +0530 | [diff] [blame] | 114 | */ |
| 115 | message MetricInformation64 { |
| 116 | MetricMetaData metadata = 1; |
| pnalmas | 3bb72f7 | 2026-02-02 19:45:17 +0530 | [diff] [blame^] | 117 | map<string, double> metrics = 2; |
| pnalmas | 9029942 | 2025-12-16 11:29:25 +0530 | [diff] [blame] | 118 | } |
| 119 | |
| 120 | /* |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 121 | * Legacy KPI Event structured. In mid-August, the KPI event format was updated |
| 122 | * to a more easily parsable format. See VOL-1140 |
| 123 | * for more information. |
| 124 | */ |
| 125 | message KpiEvent { |
| 126 | |
| Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 127 | KpiEventType.Types type = 1; |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 128 | |
| 129 | // Fields used when for slice: |
| 130 | |
| 131 | float ts = 2; // UTC time-stamp of data in slice mode (seconds since epoc) |
| 132 | |
| 133 | map<string, MetricValuePairs> prefixes = 3; |
| 134 | |
| 135 | } |
| 136 | |
| 137 | message KpiEvent2 { |
| 138 | // Type of KPI Event |
| Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 139 | KpiEventType.Types type = 1; |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 140 | |
| 141 | // Fields used when for slice: |
| Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 142 | double ts = 2; // UTC time-stamp of data in slice mode (seconds since epoch) |
| 143 | // of the time this entire KpiEvent was published to the kafka bus |
| Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 144 | |
| 145 | repeated MetricInformation slice_data = 3; |
| 146 | } |
| 147 | |
| 148 | /* |
| pnalmas | 9029942 | 2025-12-16 11:29:25 +0530 | [diff] [blame] | 149 | * KpiEvent3 with support for 64-bit unsigned integer counters. |
| 150 | * Use this for metrics that require full 64-bit precision (e.g., FEC counters, GEM counters). |
| 151 | */ |
| 152 | message KpiEvent3 { |
| 153 | // Type of KPI Event |
| 154 | KpiEventType.Types type = 1; |
| 155 | |
| 156 | // Fields used when for slice: |
| 157 | double ts = 2; // UTC time-stamp of data in slice mode (seconds since epoch) |
| 158 | // of the time this entire KpiEvent was published to the kafka bus |
| 159 | |
| 160 | repeated MetricInformation64 slice_data = 3; |
| 161 | } |
| 162 | |
| 163 | /* |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 164 | * Describes the events specific to device |
| 165 | */ |
| 166 | message DeviceEvent { |
| 167 | // Identifier of the originating resource of the event, for ex: device_id |
| 168 | string resource_id = 1; |
| 169 | |
| 170 | // device_event_name indicates clearly the name of the device event |
| 171 | string device_event_name = 2; |
| 172 | |
| 173 | // Textual explanation of the device event |
| 174 | string description = 3; |
| 175 | |
| 176 | // Key/Value storage for extra information that may give context to the event |
| 177 | map<string, string> context = 4; |
| 178 | |
| 179 | } |
| Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 180 | /* |
| 181 | * Describes the events specific to an RPC request |
| 182 | */ |
| 183 | message RPCEvent { |
| 184 | // RPC name |
| 185 | string rpc = 1; |
| 186 | |
| 187 | // The operation id of that request. Can be a log correlation ID |
| 188 | string operation_id = 2; |
| 189 | |
| 190 | // Identifies the service name originating the event |
| 191 | string service = 3; |
| 192 | |
| 193 | // Identifies the stack originating the event |
| 194 | string stack_id = 4; |
| 195 | |
| 196 | // Identifies the resource upon which the action is taken, e.g. device_id |
| 197 | string resource_id = 5; |
| 198 | |
| 199 | // Textual explanation of the event |
| 200 | string description = 6; |
| 201 | |
| 202 | // Key/Value storage for extra information that may give context to the event |
| 203 | map<string, string> context = 7; |
| 204 | |
| 205 | // Status of the RPC Event |
| 206 | common.OperationResp status = 8; |
| 207 | } |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 208 | |
| 209 | /* |
| 210 | * Identify the area of the system impacted by the event. |
| 211 | */ |
| 212 | message EventCategory { |
| Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 213 | enum Types { |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 214 | COMMUNICATION = 0; |
| 215 | ENVIRONMENT = 1; |
| 216 | EQUIPMENT = 2; |
| 217 | SERVICE = 3; |
| 218 | PROCESSING = 4; |
| 219 | SECURITY = 5; |
| 220 | // Add new event areas here |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | /* |
| 225 | * Identify the functional category originating the event |
| 226 | */ |
| 227 | message EventSubCategory { |
| Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 228 | enum Types { |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 229 | PON = 0; |
| 230 | OLT = 1; |
| 231 | ONT = 2; |
| 232 | ONU = 3; |
| 233 | NNI = 4; |
| Himani Chawla | 78c19ec | 2021-01-18 18:07:40 +0530 | [diff] [blame] | 234 | NONE = 5; //Adding None for RPC Events |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 235 | // Add new event categories here. |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | /* |
| 240 | * Identify the type of event |
| 241 | */ |
| 242 | message EventType { |
| Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 243 | enum Types { |
| 244 | CONFIG_EVENT = 0; |
| 245 | KPI_EVENT = 1; |
| 246 | KPI_EVENT2 = 2; |
| 247 | DEVICE_EVENT = 3; |
| 248 | RPC_EVENT = 4; |
| pnalmas | 9029942 | 2025-12-16 11:29:25 +0530 | [diff] [blame] | 249 | KPI_EVENT3 = 5; |
| Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 250 | } |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 251 | } |
| 252 | |
| 253 | /* |
| 254 | * Identify the functional category originating the event |
| 255 | */ |
| 256 | message EventHeader { |
| 257 | // Unique ID for this event. e.g. voltha.some_olt.1234 |
| 258 | string id = 1; |
| 259 | |
| 260 | // Refers to the functional area affect by the event |
| Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 261 | EventCategory.Types category = 2; |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 262 | |
| 263 | // Refers to functional category of the event |
| Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 264 | EventSubCategory.Types sub_category = 3; |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 265 | |
| 266 | // Refers to the type of the event |
| Serkant Uluderya | cbcfaa4 | 2019-10-18 13:25:08 +0300 | [diff] [blame] | 267 | EventType.Types type = 4; |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 268 | |
| 269 | // The version identifier for this event type, thus allowing each |
| 270 | // event type to evolve independently. The version should be in the |
| 271 | // format “MAJOR.MINOR” format and minor changes must only be additive |
| 272 | // and non-breaking. |
| 273 | string type_version = 5; |
| 274 | |
| 275 | // Timestamp at which the event was first raised. |
| 276 | // This represents the UTC time stamp since epoch (in seconds) when the |
| 277 | // the event was first raised from the source entity. |
| 278 | // If the source entity doesn't send the raised_ts, this shall be set |
| 279 | // to timestamp when the event was received. |
| Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 280 | google.protobuf.Timestamp raised_ts = 6; |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 281 | |
| 282 | // Timestamp at which the event was reported. |
| 283 | // This represents the UTC time stamp since epoch (in seconds) when the |
| 284 | // the event was reported (this time stamp is >= raised_ts). |
| 285 | // If the source entity that reported this event doesn't send the |
| 286 | // reported_ts, this shall be set to the same value as raised_ts. |
| Scott Baker | 7c854aa | 2020-02-10 17:25:31 -0800 | [diff] [blame] | 287 | google.protobuf.Timestamp reported_ts = 7; |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 288 | } |
| 289 | |
| 290 | /* |
| 291 | * Event Structure |
| 292 | */ |
| 293 | message Event { |
| 294 | // event header |
| 295 | EventHeader header = 1; |
| 296 | |
| 297 | // oneof event types referred by EventType. |
| 298 | oneof event_type { |
| 299 | // Refers to ConfigEvent |
| 300 | ConfigEvent config_event = 2; |
| 301 | |
| 302 | // Refers to KpiEvent |
| Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 303 | KpiEvent kpi_event = 3; |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 304 | |
| 305 | // Refers to KpiEvent2 |
| Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 306 | KpiEvent2 kpi_event2 = 4; |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 307 | |
| 308 | // Refers to DeviceEvent |
| 309 | DeviceEvent device_event = 5; |
| 310 | |
| Himani Chawla | 9499e95 | 2020-12-17 13:12:52 +0530 | [diff] [blame] | 311 | // Refers to an RPC Event |
| 312 | RPCEvent rpc_event = 6; |
| 313 | |
| pnalmas | 9029942 | 2025-12-16 11:29:25 +0530 | [diff] [blame] | 314 | // Refers to KpiEvent3 (64-bit counter support) |
| 315 | KpiEvent3 kpi_event3 = 7; |
| Devmalya Paul | f98ca13 | 2019-07-09 06:14:19 -0400 | [diff] [blame] | 316 | |
| 317 | } |
| 318 | } |
| 319 | |