blob: 6f180c5f5db29e81daf29e2b4584744b0c6fdcd6 [file] [log] [blame]
Zack Williams52209662019-02-07 10:15:31 -07001syntax = "proto3";
2
khenaidoo5fc5cea2021-08-11 17:39:16 -04003option go_package = "github.com/opencord/voltha-protos/v5/go/voltha";
khenaidoo4c6543e2021-10-19 17:25:58 -04004option java_package = "org.opencord.voltha.events";
Zack Williams52209662019-02-07 10:15:31 -07005
khenaidoo4c6543e2021-10-19 17:25:58 -04006package event;
Zack Williams52209662019-02-07 10:15:31 -07007
Zack Williams52209662019-02-07 10:15:31 -07008import "google/api/annotations.proto";
Scott Baker7c854aa2020-02-10 17:25:31 -08009import "google/protobuf/timestamp.proto";
Himani Chawla9499e952020-12-17 13:12:52 +053010import "voltha_protos/common.proto";
Zack Williams52209662019-02-07 10:15:31 -070011
khenaidoo4c6543e2021-10-19 17:25:58 -040012
13message 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
25message EventFilterRule {
26 EventFilterRuleKey.EventFilterRuleType key = 1;
27 string value = 2;
28}
29message 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
37message EventFilters {
38 repeated EventFilter filters = 1;
39}
40
Zack Williams52209662019-02-07 10:15:31 -070041message ConfigEventType {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030042 enum Types {
Zack Williams52209662019-02-07 10:15:31 -070043 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
49message ConfigEvent {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030050 ConfigEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -070051
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
56message KpiEventType {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +030057 enum Types {
Zack Williams52209662019-02-07 10:15:31 -070058 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 */
66message MetricMetaData {
Himani Chawla9499e952020-12-17 13:12:52 +053067 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 Williams52209662019-02-07 10:15:31 -070073
74 string logical_device_id = 3; // The logical device ID of the VOLTHA
Himani Chawla9499e952020-12-17 13:12:52 +053075 // (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 Williams52209662019-02-07 10:15:31 -070080
81 map<string, string> context = 6; // Name value pairs that provide additional
Himani Chawla9499e952020-12-17 13:12:52 +053082 // context information on the metrics being
83 // reported.
onkar.kundargi7b85fa12020-02-27 13:19:22 +053084
Himani Chawla9499e952020-12-17 13:12:52 +053085 string uuid = 7; // Transaction identifier used to match On
86 // Demand gRPC requests with kafka responses
Zack Williams52209662019-02-07 10:15:31 -070087}
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 */
93message 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 */
104message MetricInformation {
105 MetricMetaData metadata = 1;
106 map<string, float> metrics = 2;
107}
108
109/*
pnalmas90299422025-12-16 11:29:25 +0530110 * Struct to group metadata for a metric (or group of metrics) with the key-value
111 * pairs of collected metrics using 64-bit unsigned integers.
112 * This is used for counters that can exceed the precision of float (e.g., FEC, GEM counters).
113 */
114message MetricInformation64 {
115 MetricMetaData metadata = 1;
116 map<string, uint64> metrics = 2;
117}
118
119/*
Zack Williams52209662019-02-07 10:15:31 -0700120 * Legacy KPI Event structured. In mid-August, the KPI event format was updated
121 * to a more easily parsable format. See VOL-1140
122 * for more information.
123 */
124message KpiEvent {
125
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300126 KpiEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -0700127
128 // Fields used when for slice:
129
130 float ts = 2; // UTC time-stamp of data in slice mode (seconds since epoc)
131
132 map<string, MetricValuePairs> prefixes = 3;
133
134}
135
136message KpiEvent2 {
137 // Type of KPI Event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300138 KpiEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -0700139
140 // Fields used when for slice:
Himani Chawla9499e952020-12-17 13:12:52 +0530141 double ts = 2; // UTC time-stamp of data in slice mode (seconds since epoch)
142 // of the time this entire KpiEvent was published to the kafka bus
Zack Williams52209662019-02-07 10:15:31 -0700143
144 repeated MetricInformation slice_data = 3;
145}
146
147/*
pnalmas90299422025-12-16 11:29:25 +0530148 * KpiEvent3 with support for 64-bit unsigned integer counters.
149 * Use this for metrics that require full 64-bit precision (e.g., FEC counters, GEM counters).
150 */
151message KpiEvent3 {
152 // Type of KPI Event
153 KpiEventType.Types type = 1;
154
155 // Fields used when for slice:
156 double ts = 2; // UTC time-stamp of data in slice mode (seconds since epoch)
157 // of the time this entire KpiEvent was published to the kafka bus
158
159 repeated MetricInformation64 slice_data = 3;
160}
161
162/*
Devmalya Paulf98ca132019-07-09 06:14:19 -0400163 * Describes the events specific to device
164 */
165message DeviceEvent {
166 // Identifier of the originating resource of the event, for ex: device_id
167 string resource_id = 1;
168
169 // device_event_name indicates clearly the name of the device event
170 string device_event_name = 2;
171
172 // Textual explanation of the device event
173 string description = 3;
174
175 // Key/Value storage for extra information that may give context to the event
176 map<string, string> context = 4;
177
178}
Himani Chawla9499e952020-12-17 13:12:52 +0530179/*
180 * Describes the events specific to an RPC request
181 */
182message RPCEvent {
183 // RPC name
184 string rpc = 1;
185
186 // The operation id of that request. Can be a log correlation ID
187 string operation_id = 2;
188
189 // Identifies the service name originating the event
190 string service = 3;
191
192 // Identifies the stack originating the event
193 string stack_id = 4;
194
195 // Identifies the resource upon which the action is taken, e.g. device_id
196 string resource_id = 5;
197
198 // Textual explanation of the event
199 string description = 6;
200
201 // Key/Value storage for extra information that may give context to the event
202 map<string, string> context = 7;
203
204 // Status of the RPC Event
205 common.OperationResp status = 8;
206}
Devmalya Paulf98ca132019-07-09 06:14:19 -0400207
208/*
209 * Identify the area of the system impacted by the event.
210 */
211message EventCategory {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300212 enum Types {
Devmalya Paulf98ca132019-07-09 06:14:19 -0400213 COMMUNICATION = 0;
214 ENVIRONMENT = 1;
215 EQUIPMENT = 2;
216 SERVICE = 3;
217 PROCESSING = 4;
218 SECURITY = 5;
219 // Add new event areas here
220 }
221}
222
223/*
224 * Identify the functional category originating the event
225 */
226message EventSubCategory {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300227 enum Types {
Devmalya Paulf98ca132019-07-09 06:14:19 -0400228 PON = 0;
229 OLT = 1;
230 ONT = 2;
231 ONU = 3;
232 NNI = 4;
Himani Chawla78c19ec2021-01-18 18:07:40 +0530233 NONE = 5; //Adding None for RPC Events
Devmalya Paulf98ca132019-07-09 06:14:19 -0400234 // Add new event categories here.
235 }
236}
237
238/*
239 * Identify the type of event
240*/
241message EventType {
Himani Chawla9499e952020-12-17 13:12:52 +0530242 enum Types {
243 CONFIG_EVENT = 0;
244 KPI_EVENT = 1;
245 KPI_EVENT2 = 2;
246 DEVICE_EVENT = 3;
247 RPC_EVENT = 4;
pnalmas90299422025-12-16 11:29:25 +0530248 KPI_EVENT3 = 5;
Himani Chawla9499e952020-12-17 13:12:52 +0530249 }
Devmalya Paulf98ca132019-07-09 06:14:19 -0400250}
251
252/*
253 * Identify the functional category originating the event
254 */
255message EventHeader {
256 // Unique ID for this event. e.g. voltha.some_olt.1234
257 string id = 1;
258
259 // Refers to the functional area affect by the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300260 EventCategory.Types category = 2;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400261
262 // Refers to functional category of the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300263 EventSubCategory.Types sub_category = 3;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400264
265 // Refers to the type of the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300266 EventType.Types type = 4;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400267
268 // The version identifier for this event type, thus allowing each
269 // event type to evolve independently. The version should be in the
270 // format “MAJOR.MINOR” format and minor changes must only be additive
271 // and non-breaking.
272 string type_version = 5;
273
274 // Timestamp at which the event was first raised.
275 // This represents the UTC time stamp since epoch (in seconds) when the
276 // the event was first raised from the source entity.
277 // If the source entity doesn't send the raised_ts, this shall be set
278 // to timestamp when the event was received.
Scott Baker7c854aa2020-02-10 17:25:31 -0800279 google.protobuf.Timestamp raised_ts = 6;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400280
281 // Timestamp at which the event was reported.
282 // This represents the UTC time stamp since epoch (in seconds) when the
283 // the event was reported (this time stamp is >= raised_ts).
284 // If the source entity that reported this event doesn't send the
285 // reported_ts, this shall be set to the same value as raised_ts.
Scott Baker7c854aa2020-02-10 17:25:31 -0800286 google.protobuf.Timestamp reported_ts = 7;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400287}
288
289/*
290 * Event Structure
291 */
292message Event {
293 // event header
294 EventHeader header = 1;
295
296 // oneof event types referred by EventType.
297 oneof event_type {
298 // Refers to ConfigEvent
299 ConfigEvent config_event = 2;
300
301 // Refers to KpiEvent
Himani Chawla9499e952020-12-17 13:12:52 +0530302 KpiEvent kpi_event = 3;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400303
304 // Refers to KpiEvent2
Himani Chawla9499e952020-12-17 13:12:52 +0530305 KpiEvent2 kpi_event2 = 4;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400306
307 // Refers to DeviceEvent
308 DeviceEvent device_event = 5;
309
Himani Chawla9499e952020-12-17 13:12:52 +0530310 // Refers to an RPC Event
311 RPCEvent rpc_event = 6;
312
pnalmas90299422025-12-16 11:29:25 +0530313 // Refers to KpiEvent3 (64-bit counter support)
314 KpiEvent3 kpi_event3 = 7;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400315
316 }
317}
318