-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflow_log.proto
More file actions
323 lines (263 loc) · 7.14 KB
/
Copy pathflow_log.proto
File metadata and controls
323 lines (263 loc) · 7.14 KB
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
syntax = "proto3";
package flow_log;
// rust 不支持以下import和option, 先删除,用于ingester时,需要加回
// import "github.com/gogo/protobuf/gogoproto/gogo.proto";
// option (gogoproto.unmarshaler_all) = true;
// option (gogoproto.marshaler_all) = true;
// option (gogoproto.sizer_all) = true;
option go_package = "pb";
message TaggedFlow {
Flow flow = 1;
}
message Flow {
FlowKey flow_key = 1;
FlowMetricsPeer metrics_peer_src = 2;
FlowMetricsPeer metrics_peer_dst = 3;
TunnelField Tunnel = 4;
uint64 flow_id = 5;
uint64 start_time = 6;
uint64 end_time = 7;
uint64 duration = 8;
// uint64 flow_start_time = 9; // 目前无需发送
uint32 vlan = 10;
uint32 eth_type = 11;
uint32 has_perf_stats = 12;
FlowPerfStats perf_stats = 13;
uint32 close_type = 14;
uint32 signal_source = 15;
uint32 is_active_service = 16;
uint32 queue_hash = 17;
uint32 is_new_flow = 18;
uint32 tap_side = 19;
// TCP Seq
uint32 syn_seq = 20;
uint32 synack_seq = 21;
uint32 last_keepalive_seq = 22;
uint32 last_keepalive_ack = 23;
repeated uint32 acl_gids = 24;
uint32 direction_score = 25;
string request_domain = 26;
repeated uint64 aggregated_flow_ids = 27;
uint32 init_ipid = 28;
}
message FlowKey {
uint32 vtap_id = 1;
uint32 tap_type = 2;
uint64 tap_port = 3;
uint64 mac_src = 4;
uint64 mac_dst = 5;
uint32 ip_src = 6;
uint32 ip_dst = 7;
bytes ip6_src = 8;
bytes ip6_dst = 9;
uint32 port_src = 10;
uint32 port_dst = 11;
uint32 proto = 12;
}
message FlowMetricsPeer {
uint64 byte_count = 1;
uint64 l3_byte_count = 2;
uint64 l4_byte_count = 3;
uint64 packet_count = 4;
uint64 total_byte_count = 5;
uint64 total_packet_count = 6;
uint64 first = 7;
uint64 last = 8;
uint32 tcp_flags = 9;
int32 l3_epc_id = 10;
uint32 is_l2_end = 11;
uint32 is_l3_end = 12;
uint32 is_active_host = 13;
uint32 is_device = 14;
uint32 is_vip_interface = 15;
uint32 is_vip = 16;
uint32 real_ip = 20;
uint32 real_port = 21;
uint32 gpid = 22;
}
message TunnelField {
uint32 tx_ip0 = 1;
uint32 tx_ip1 = 2;
uint32 rx_ip0 = 3;
uint32 rx_ip1 = 4;
uint32 tx_mac0 = 5;
uint32 tx_mac1 = 6;
uint32 rx_mac0 = 7;
uint32 rx_mac1 = 8;
uint32 tx_id = 9;
uint32 rx_id = 10;
uint32 tunnel_type = 11;
uint32 tier = 12;
uint32 is_ipv6 = 13;
}
message FlowPerfStats {
TCPPerfStats tcp = 1;
L7PerfStats l7 = 2;
uint32 l4_protocol = 3;
uint32 l7_protocol = 4;
uint32 l7_failed_count = 5;
}
message TCPPerfStats {
uint32 rtt_client_max = 1;
uint32 rtt_server_max = 2;
uint32 srt_max = 3;
uint32 art_max = 4;
uint32 rtt = 5;
// Deprecated in v6.4.1: uint32 rtt_client_sum = 6;
// Deprecated in v6.4.1: uint32 rtt_client_sum = 7;
uint32 srt_sum = 8;
uint32 art_sum = 9;
// Deprecated in v6.4.1: uint32 rtt_client_count = 10;
// Deprecated in v6.4.1: uint32 rtt_client_count = 11;
uint32 srt_count = 12;
uint32 art_count = 13;
TcpPerfCountsPeer counts_peer_tx = 14;
TcpPerfCountsPeer counts_peer_rx = 15;
uint32 total_retrans_count = 16;
uint32 syn_count = 17;
uint32 synack_count = 18;
uint32 cit_max = 19;
uint32 cit_sum = 20;
uint32 cit_count = 21;
uint32 fin_count = 22;
}
message TcpPerfCountsPeer {
uint32 retrans_count = 1;
uint32 zero_win_count = 2;
uint32 ooo_count = 3;
}
message L7PerfStats {
uint32 request_count = 1;
uint32 response_count = 2;
uint32 err_client_count = 3;
uint32 err_server_count = 4;
uint32 err_timeout = 5;
uint32 rrt_count = 6;
uint64 rrt_sum = 7;
uint32 rrt_max = 8;
uint32 tls_rtt = 9;
}
message L7Request {
string req_type = 1;
string domain = 2;
string resource = 3;
string endpoint = 4;
}
message L7Response {
uint32 status = 1;
int32 code = 2;
string exception = 3;
string result = 4;
}
message TraceInfo {
string trace_id = 1;
string span_id = 2;
string parent_span_id = 3;
repeated string trace_ids = 4;
}
message ExtendedInfo {
string service_name = 1;
string client_ip = 2;
uint32 request_id = 3;
string x_request_id_0 = 4;
string http_user_agent = 6;
string http_referer = 7;
string rpc_service = 8;
string protocol_str = 9;
string x_request_id_1 = 10;
repeated string attribute_names = 16;
repeated string attribute_values= 17;
repeated string metrics_names = 18;
repeated double metrics_values = 19;
}
enum FlagBits {
FLAG_NONE = 0;
FLAG_TLS = 1; // 1<<0
FLAG_ASYNC = 2; // 1<<1
FLAG_REVERSED = 4; // 1<<2
}
message AppProtoLogsData {
AppProtoLogsBaseInfo base = 1;
int32 req_len = 9;
int32 resp_len = 10;
L7Request req = 11;
L7Response resp = 12;
string version = 13;
TraceInfo trace_info = 14;
ExtendedInfo ext_info = 15;
uint32 row_effect = 16;
uint32 direction_score = 17;
// Flags Bitmap (enum FlagBits):
// 32 3 2 1 0
// +------------------------------------+-----+
// | Reserve |reversed | async | TLS |
// +-----------------------------------+-----+
uint32 flags = 18;
// Excluding L2-L4 packet header
uint32 captured_request_byte = 19;
uint32 captured_response_byte = 20;
string biz_code = 21;
string biz_scenario = 22;
string biz_response_code = 23;
}
message AppProtoLogsBaseInfo {
uint64 start_time = 1;
uint64 end_time = 2;
uint64 flow_id = 3;
uint64 tap_port = 4;
uint32 vtap_id = 5;
uint32 tap_type = 6;
uint32 is_ipv6 = 7;
uint32 tap_side = 8;
AppProtoHead head = 9;
uint64 mac_src = 10;
uint64 mac_dst = 11;
uint32 ip_src = 12;
uint32 ip_dst = 13;
bytes ip6_src = 14;
bytes ip6_dst = 15;
int32 l3_epc_id_src = 16;
int32 l3_epc_id_dst = 17;
uint32 port_src = 18;
uint32 port_dst = 19;
uint32 protocol = 20;
uint32 is_vip_interface_src = 21;
uint32 is_vip_interface_dst = 22;
uint32 req_tcp_seq = 23;
uint32 resp_tcp_seq = 24;
uint32 process_id_0 = 25;
uint32 process_id_1 = 26;
string process_kname_0 = 27;
string process_kname_1 = 28;
uint64 syscall_trace_id_request = 29;
uint64 syscall_trace_id_response = 30;
uint32 syscall_trace_id_thread_0 = 31;
uint32 syscall_trace_id_thread_1 = 32;
uint32 syscall_cap_seq_0 = 33;
uint32 syscall_cap_seq_1 = 34;
uint32 gpid_0 = 35;
uint32 gpid_1 = 36;
// Deprecated in v6.4.1: uint32 netns_id_0 = 37;
// Deprecated in v6.4.1: uint32 netns_id_1 = 38;
uint64 syscall_coroutine_0 = 39;
uint64 syscall_coroutine_1 = 40;
uint32 pod_id_0 = 41;
uint32 pod_id_1 = 42;
uint32 biz_type = 43;
}
message AppProtoHead {
uint32 proto = 1;
uint32 msg_type = 2;
uint64 rrt = 5;
}
message MqttTopic {
string name = 1;
int32 qos = 2; // -1 mean not exist qos
}
message ThirdPartyTrace {
bytes data = 1;
bytes peer_ip = 2;
string uri = 3;
repeated string extend_keys = 4;
repeated string extend_values = 5;
}