/
collector_uve.sandesh
349 lines (310 loc) · 10.3 KB
/
collector_uve.sandesh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
/*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
/**
* Definitions of structures added by collector related to data received from
* the sandesh generators
*/
include "io/io.sandesh"
include "sandesh/library/common/sandesh_uve.sandesh"
include "database/gendb.sandesh"
include "database/cassandra/cql/cql.sandesh"
/**
* structure to store sandesh stats on a per message type
*/
struct SandeshStats {
1: string message_type
2: i64 messages
3: i64 bytes
4: u64 last_msg_timestamp
}
/**
* structure to store sandesh stats on a per level
*/
struct SandeshLogLevelStats {
1: string level
2: u64 messages
3: u64 bytes
4: u64 last_msg_timestamp
}
/**
* structure to store list of sandesh stats
*/
struct SandeshStatsInfo {
1: string hostname
2: list<SandeshStats> msgtype_stats
3: list<SandeshLogLevelStats> log_level_stats
}
/**
* structure to store generator's connection info
*/
struct GeneratorInfoAttr {
1: u32 connects
5: u64 connect_time
2: u32 resets
6: u64 reset_time
4: bool in_clear
}
struct GeneratorInfo {
1: string hostname
3: GeneratorInfoAttr gen_attr
}
/**
* @description: This structure send statistics data related to adds to the Database
* on a per generator basis
* @object: generator
*/
objectlog sandesh GeneratorDbStats {
1: string name (key="ObjectGeneratorInfo")
2: optional list<gendb.DbTableInfo> table_info (tags=".table_name")
3: optional gendb.DbErrors errors (tags="")
4: optional list<gendb.DbTableInfo> statistics_table_info (tags=".table_name")
}
/**
* This structure send statistics data related to Database
* additions on a per generator basis
*/
struct ModuleServerState {
1: string name (key="ObjectGeneratorInfo")
2: optional bool deleted
3: optional list<SandeshStatsInfo> msg_stats (aggtype="union")
4: optional list<GeneratorInfo> generator_info (aggtype="union")
5: optional u64 sm_queue_count
6: optional sandesh_uve.SandeshStateMachineStats sm_stats
7: optional u64 db_queue_count
8: optional u64 db_enqueues
9: optional sandesh_uve.SandeshSessionStats session_stats
10: optional io.SocketIOStats session_rx_socket_stats
11: optional io.SocketIOStats session_tx_socket_stats
12: optional sandesh_uve.SandeshGeneratorBasicStats sm_msg_stats
13: optional string db_drop_level
14: optional list<SandeshStats> db_dropped_msg_stats
15: optional string sm_drop_level
}
/**
* @description: UVE to send generator statistics
* @object: generator
*/
uve sandesh SandeshModuleServerTrace {
1: ModuleServerState data
}
/**
* structure to store generator summary
*/
struct GeneratorSummaryInfo {
1: string source
2: string module_id
3: string state
4: string instance_id
5: string node_type
6: u64 sm_queue_count
7: optional u64 db_queue_count
8: optional string db_drop_level
9: optional bool sm_back_pressure
10: optional u64 max_sm_queue_count
}
/**
* structure to store collector errors
*/
struct CollectorStats {
1: u64 no_session_error
2: u64 no_generator_error
3: u64 redis_error
4: u64 session_mismatch_error
5: u64 sandesh_type_mismatch_error
}
/**
* @description: This structure is used to send statistics data related to
* database operations in the contrail-collector
* @object: analytics-node
*/
objectlog sandesh CollectorDbStats {
1: string name (key="ObjectCollectorInfo")
2: optional list<gendb.DbTableInfo> table_info (tags=".table_name")
3: optional gendb.DbErrors errors (tags="")
4: optional list<gendb.DbTableInfo> statistics_table_info (tags=".table_name")
5: optional cql.DbStats cql_stats (tags="")
}
/**
* @description: This structure used to send statistics data related to Protobuf
* Receiver in the contrail-collector
* @object: analytics-node
*/
objectlog sandesh ProtobufCollectorStats {
1: string name (key="ObjectCollectorInfo")
2: optional list<io.SocketIOStats> rx_socket_stats (tags="")
3: optional list<io.SocketIOStats> tx_socket_stats (tags="")
4: optional list<io.SocketEndpointMessageStats> rx_message_stats (tags=".endpoint_name,.message_name")
5: optional list<gendb.DbTableInfo> db_table_info (tags=".table_name")
6: optional list<gendb.DbErrors> db_errors (tags="")
7: optional list<gendb.DbTableInfo> db_statistics_table_info (tags=".table_name")
8: optional u64 db_queue_count
9: optional u64 db_enqueues
}
/**
* @description: sandesh request to get collector info through introspect
*/
request sandesh ShowCollectorServerReq {
}
/**
* @description: sandesh response to provide collector info through introspect
*/
response sandesh ShowCollectorServerResp {
1: io.SocketIOStats rx_socket_stats
2: io.SocketIOStats tx_socket_stats
3: u64 num_generators
4: list<GeneratorSummaryInfo> generators
5: CollectorStats stats
6: optional cql.Metrics cql_metrics
7: optional list<gendb.DbTableInfo> table_info
8: optional gendb.DbErrors errors
9: optional list<gendb.DbTableInfo> statistics_table_info
}
// This struct is part of the CollectorInfo UVE. (key is hostname on which this
// instance of Vizd is running)
// This part of the UVE externally refers to all generator attached to this instance
// of Vizd.
//
// - Vizd will update the generator_infos attribute periodically
//
/**
* structure to carry generator info and other info that collector sends
*/
struct CollectorState {
1: string name (key="ObjectCollectorInfo")
2: optional bool deleted
4: optional list<GeneratorSummaryInfo> generator_infos
5: optional string build_info
6: optional list<string> self_ip_list
7: optional list<string> core_files_list
8: optional io.SocketIOStats rx_socket_stats
9: optional io.SocketIOStats tx_socket_stats
}
/**
* @description: UVE to send generator info and other info from collector
* @object: analytics-node
*/
uve sandesh CollectorInfo {
1: CollectorState data
}
trace sandesh publish_uve_update {
1: string source
2: string mdule
3: string type
4: string key
5: string attr
6: bool success
7: string node_type
8: string instance_id
}
trace sandesh publish_uve_delete {
1: string source
2: string mdule
3: string type
4: string key
5: u32 seq
6: bool success
7: string node_type
8: string instance_id
}
trace sandesh generator_getseq {
1: string source
2: string mdule
3: bool success
}
trace sandesh generator_deluves {
1: string source
2: string mdule
3: bool success
}
/**
* @description: sandesh request to set Database Queue params
*/
request sandesh DbQueueParamsSet {
1: optional bool high;
2: optional u32 queue_count;
3: optional string drop_level;
}
/**
* @description: sandesh request to reset Database Queue params
*/
request sandesh DbQueueParamsReset {
}
/**
* @description: sandesh request to get Database Queue params
*/
request sandesh DbQueueParamsStatus {
}
/**
* @description: sandesh request to set State Machine Queue params
*/
request sandesh SmQueueParamsSet {
1: optional bool high;
2: optional u32 queue_count;
3: optional string drop_level;
}
/**
* @description: sandesh request to reset State Machine Queue params
*/
request sandesh SmQueueParamsReset {
}
/**
* @description: sandesh request to get State Machine Queue params
*/
request sandesh SmQueueParamsStatus {
}
struct QueueParams {
1: bool high;
2: u32 queue_count;
3: string drop_level;
}
/**
* @description: sandesh response to return State Machine Queue params
*/
response sandesh QueueParamsResponse {
1: list<QueueParams> info;
}
/**
* structure to carry statistics data for sandesh messages on a
* per generator basis
*/
struct SandeshMessageInfo {
1: string type
2: string level
3: u64 messages
4: u64 bytes
}
/**
* @description: objectlog structure to send statistics data for sandesh
* messages on a per generator basis
* @object: generator
*/
objectlog sandesh SandeshMessageStat {
1: string name (key="ObjectGeneratorInfo")
2: optional list<SandeshMessageInfo> msg_info (tags=".type,.level")
}
request sandesh DisableFlowCollectionRequest {
1: optional bool disable
}
request sandesh FlowCollectionStatusRequest {
}
response sandesh FlowCollectionStatusResponse {
1: bool disable
}
response sandesh CollectorError {
1: string error
}
request sandesh DisableDatabaseWritesRequest {
1: optional bool disable_all
2: optional bool disable_statistics
3: optional bool disable_messages
4: optional bool disable_flows
}
request sandesh DatabaseWritesStatusRequest {
}
response sandesh DatabaseWritesStatusResponse {
1: bool disable_all
2: bool disable_statistics
3: bool disable_messages
4: bool disable_flows
}