blob: 17b83a37b258d2e4826691800202bb7c38b0b154 [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
pnalmas3bb72f72026-02-02 19:45:17 +0530111 * 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).
pnalmas90299422025-12-16 11:29:25 +0530114 */
115message MetricInformation64 {
116 MetricMetaData metadata = 1;
pnalmas3bb72f72026-02-02 19:45:17 +0530117 map<string, double> metrics = 2;
pnalmas90299422025-12-16 11:29:25 +0530118}
119
120/*
Zack Williams52209662019-02-07 10:15:31 -0700121 * 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 */
125message KpiEvent {
126
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300127 KpiEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -0700128
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
137message KpiEvent2 {
138 // Type of KPI Event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300139 KpiEventType.Types type = 1;
Zack Williams52209662019-02-07 10:15:31 -0700140
141 // Fields used when for slice:
Himani Chawla9499e952020-12-17 13:12:52 +0530142 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 Williams52209662019-02-07 10:15:31 -0700144
145 repeated MetricInformation slice_data = 3;
146}
147
148/*
pnalmas90299422025-12-16 11:29:25 +0530149 * 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 */
152message 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 Paulf98ca132019-07-09 06:14:19 -0400164 * Describes the events specific to device
165 */
166message 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 Chawla9499e952020-12-17 13:12:52 +0530180/*
181 * Describes the events specific to an RPC request
182 */
183message 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 Paulf98ca132019-07-09 06:14:19 -0400208
209/*
210 * Identify the area of the system impacted by the event.
211 */
212message EventCategory {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300213 enum Types {
Devmalya Paulf98ca132019-07-09 06:14:19 -0400214 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 */
227message EventSubCategory {
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300228 enum Types {
Devmalya Paulf98ca132019-07-09 06:14:19 -0400229 PON = 0;
230 OLT = 1;
231 ONT = 2;
232 ONU = 3;
233 NNI = 4;
Himani Chawla78c19ec2021-01-18 18:07:40 +0530234 NONE = 5; //Adding None for RPC Events
Devmalya Paulf98ca132019-07-09 06:14:19 -0400235 // Add new event categories here.
236 }
237}
238
239/*
240 * Identify the type of event
241*/
242message EventType {
Himani Chawla9499e952020-12-17 13:12:52 +0530243 enum Types {
244 CONFIG_EVENT = 0;
245 KPI_EVENT = 1;
246 KPI_EVENT2 = 2;
247 DEVICE_EVENT = 3;
248 RPC_EVENT = 4;
pnalmas90299422025-12-16 11:29:25 +0530249 KPI_EVENT3 = 5;
Himani Chawla9499e952020-12-17 13:12:52 +0530250 }
Devmalya Paulf98ca132019-07-09 06:14:19 -0400251}
252
253/*
254 * Identify the functional category originating the event
255 */
256message 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 Uluderyacbcfaa42019-10-18 13:25:08 +0300261 EventCategory.Types category = 2;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400262
263 // Refers to functional category of the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300264 EventSubCategory.Types sub_category = 3;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400265
266 // Refers to the type of the event
Serkant Uluderyacbcfaa42019-10-18 13:25:08 +0300267 EventType.Types type = 4;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400268
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 Baker7c854aa2020-02-10 17:25:31 -0800280 google.protobuf.Timestamp raised_ts = 6;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400281
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 Baker7c854aa2020-02-10 17:25:31 -0800287 google.protobuf.Timestamp reported_ts = 7;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400288}
289
290/*
291 * Event Structure
292 */
293message 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 Chawla9499e952020-12-17 13:12:52 +0530303 KpiEvent kpi_event = 3;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400304
305 // Refers to KpiEvent2
Himani Chawla9499e952020-12-17 13:12:52 +0530306 KpiEvent2 kpi_event2 = 4;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400307
308 // Refers to DeviceEvent
309 DeviceEvent device_event = 5;
310
Himani Chawla9499e952020-12-17 13:12:52 +0530311 // Refers to an RPC Event
312 RPCEvent rpc_event = 6;
313
pnalmas90299422025-12-16 11:29:25 +0530314 // Refers to KpiEvent3 (64-bit counter support)
315 KpiEvent3 kpi_event3 = 7;
Devmalya Paulf98ca132019-07-09 06:14:19 -0400316
317 }
318}
319