-
Notifications
You must be signed in to change notification settings - Fork 67
/
orchestrator.proto
389 lines (326 loc) 路 9.48 KB
/
orchestrator.proto
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
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
syntax = "proto3";
package proto;
option go_package = "github.com/kubeshop/tracetest/agent/proto";
// Orchestrator is the piece of software that will orchestrate the work and send
// requests to the agent
service Orchestrator {
// Connects an agent and returns the configuration that must be used by that agent
rpc Connect(ConnectRequest) returns (AgentConfiguration) {}
// Register the agent to handle stop request, which are sent from users to stop a running test
rpc RegisterStopRequestAgent(AgentIdentification) returns (stream StopRequest) {}
// Register an agent as a trigger agent, once connected, the server will be able to send
// multiple trigger requests to the agent.
rpc RegisterTriggerAgent(AgentIdentification) returns (stream TriggerRequest) {}
// Sends the trigger result back to the server
rpc SendTriggerResult(TriggerResponse) returns (Empty) {}
// Register an agent as a poller agent, once connected, the server will be able to send
// multiple polling requests to the agent
rpc RegisterPollerAgent(AgentIdentification) returns (stream PollingRequest) {}
// Sends polled spans to the server
rpc SendPolledSpans(PollingResponse) returns (Empty) {}
// Register an agent to listen for shutdown commands
rpc RegisterShutdownListener(AgentIdentification) returns (stream ShutdownRequest) {}
// Register an agent to listen for connection test commands
rpc RegisterOTLPConnectionTestListener(AgentIdentification) returns (stream OTLPConnectionTestRequest) {}
// Send the OTLP connection test response
rpc SendOTLPConnectionTestResult(OTLPConnectionTestResponse) returns (Empty) {}
// Ping is used to check if the agent is still connected
rpc Ping(AgentIdentification) returns (Empty) {}
// Register an agent to listen for datastore connection test requests
rpc RegisterDataStoreConnectionTestAgent(AgentIdentification) returns (stream DataStoreConnectionTestRequest) {}
// Sends datastore connection test result back to the server
rpc SendDataStoreConnectionTestResult(DataStoreConnectionTestResponse) returns (Empty) {}
}
// Empty message for endpoints that don't return anything
message Empty {}
// StopRequest is a user request to intercept a running test.
// It can be used to stop a test or skip the polling.
message StopRequest{
string testID = 1;
int32 runID = 2;
string type = 3;
}
// ConnectRequest is the initial request sent by the agent to the orchestrator
// it contains all necessary information for authentication and identification
// of the agent.
// An established connection is called a "session".
message ConnectRequest {
string apiKey = 1;
string name = 2;
}
// ConnectResponse is the Orchestrator response to the ConnectRequest. It contains
// configuration that must be used by the agent while working with this Orchestrator.
message AgentConfiguration {
SessionConfiguration configuration = 1;
AgentIdentification identification = 2;
}
// SessionConfiguration is a set of configuration values that must be used by the agent while
// communicating with the Orchestrator in the current session.
message SessionConfiguration {
// Milliseconds to wait for spans before sending batch
int32 batchTimeout = 1;
}
// ShutdownRequest is a request sent by the server to an agent so it should shut down
message ShutdownRequest {
string reason = 1;
}
// AgentIdentification contains data used by the server to validate an agent identity
message AgentIdentification {
string token = 1;
}
message TriggerRequest{
string requestID = 1;
string testID = 2;
int32 runID = 3;
string traceID = 4;
Trigger trigger = 5;
}
message Trigger {
string type = 1;
HttpRequest http = 2;
GrpcRequest grpc = 3;
TraceIDRequest traceID = 4;
KafkaRequest kafka = 5;
}
message HttpRequest {
string method = 1;
string url = 2;
string body = 3;
repeated HttpHeader headers = 4;
HttpAuthentication authentication = 5;
bool SSLVerification = 6;
}
message HttpHeader {
string key = 1;
string value = 2;
}
message HttpAuthentication {
string type = 1;
ApiKeyAuthentication apiKey = 2;
BasicAuthentication basic = 3;
BearerAuthentication bearer = 4;
}
message ApiKeyAuthentication{
string key = 1;
string value = 2;
string in = 3;
}
message BasicAuthentication{
string username = 1;
string password = 2;
}
message BearerAuthentication{
string token = 1;
}
message GrpcRequest {
string protobufFile = 1;
string address = 2;
string service = 3;
string method = 4;
string request = 5;
HttpAuthentication authentication = 6;
repeated GrpcHeader metadata = 7;
}
message GrpcHeader {
string key = 1;
string value = 2;
}
message TraceIDRequest {
string id = 1;
}
message TriggerResponse {
string requestID = 1;
AgentIdentification agentIdentification = 2;
string testID = 3;
int32 runID = 4;
TriggerResult triggerResult = 5;
}
message TriggerResult {
string type = 1;
HttpResponse http = 2;
GrpcResponse grpc = 3;
TraceIdResponse traceID = 4;
KafkaResponse kafka = 5;
Error error = 6;
}
message HttpResponse {
int32 statusCode = 1;
string status = 2;
repeated HttpHeader headers = 3;
bytes body = 4;
}
message GrpcResponse {
int32 statusCode = 1;
repeated GrpcHeader metadata = 2;
bytes body = 3;
}
message TraceIdResponse {
string id = 1;
}
message Error {
string message = 1;
}
message OTLPConnectionTestRequest {
string requestID = 1;
// If set as true, the agent needs to reset the span counter and doesn't need to
// report the number of spans back to the server.
bool resetCounter = 2;
}
message OTLPConnectionTestResponse {
string requestID = 1;
AgentIdentification agentIdentification = 2;
int64 spanCount = 3;
int64 lastSpanTimestamp = 4;
}
message DataStoreConnectionTestRequest {
string requestID = 1;
DataStore datastore = 2;
}
message DataStoreConnectionTestResponse {
string requestID = 1;
bool successful = 2;
AgentIdentification agentIdentification = 3;
DataStoreConnectionTestSteps steps = 4;
}
message DataStoreConnectionTestSteps {
DataStoreConnectionTestStep portCheck = 1;
DataStoreConnectionTestStep connectivity = 2;
DataStoreConnectionTestStep authentication = 3;
DataStoreConnectionTestStep fetchTraces = 4;
}
message DataStoreConnectionTestStep {
bool passed = 1;
string status = 2;
string message = 3;
string error = 4;
}
message PollingRequest {
string requestID = 1;
string testID = 2;
int32 runID = 3;
string traceID = 4;
DataStore datastore = 5;
}
message DataStore {
string type = 1;
JaegerConfig jaeger = 2;
TempoConfig tempo = 3;
ElasticConfig opensearch = 4;
ElasticConfig elasticapm = 5;
SignalfxConfig signalfx = 6;
AwsXRayConfig awsxray = 7;
AzureAppInsightsConfig azureappinsights = 8;
SumoLogicConfig sumologic = 9;
}
message JaegerConfig {
GrpcClientSettings grpc = 1;
}
message TempoConfig{
string type = 1;
HttpClientSettings http = 2;
GrpcClientSettings grpc = 3;
}
message ElasticConfig{
repeated string addresses = 1;
string username = 2;
string password = 3;
string index = 4;
string certificate = 5;
bool insecureSkipVerify = 6;
}
message SignalfxConfig{
string realm = 1;
string token = 2;
}
message AwsXRayConfig{
string region = 1;
string accessKeyId = 2;
string secretAccessKey = 3;
string sessionToken = 4;
bool useDefaultAuth = 5;
}
message AzureAppInsightsConfig{
bool useAzureActiveDirectoryAuth = 1;
string accessToken = 2;
string connectionType = 3;
string resourceArmId = 4;
}
message SumoLogicConfig{
string URL = 1;
string accessID = 2;
string accessKey = 3;
}
message HttpClientSettings {
string url = 1;
repeated HttpHeader headers = 2;
TLS tls = 3;
HttpAuthentication authentication = 4;
}
message GrpcClientSettings {
string endpoint = 1;
int64 readBufferSize = 2;
int64 writeBufferSize = 3;
bool waitForReady = 4;
HttpHeader headers = 5;
string balancerName = 6;
string compression = 7;
TLS tls = 8;
HttpAuthentication auth = 9;
}
message TLS {
bool insecure = 1;
bool insecureSkipVerify = 2;
string serverName = 3;
TLSSetting settings = 4;
}
message TLSSetting {
string cAFile = 1;
string certFile = 2;
string keyFile = 3;
string minVersion = 4;
string maxVersion = 5;
}
message PollingResponse {
string requestID = 1;
AgentIdentification agentIdentification = 2;
string testID = 3;
int32 runID = 4;
string traceID = 5;
repeated Span spans = 6;
bool traceFound = 7;
Error error = 8;
}
message Span {
string id = 1;
string parentId = 2;
string name = 3;
string kind = 4;
int64 startTime = 5;
int64 endTime = 6;
repeated KeyValuePair attributes = 7;
}
message KeyValuePair {
string key = 1;
string value = 2;
}
message KafkaRequest {
repeated string brokerUrls = 1;
string topic = 2;
KafkaAuthentication authentication = 3;
bool sslVerification = 4;
repeated KeyValuePair headers = 5;
string messageKey = 6;
string messageValue = 7;
}
message KafkaAuthentication {
string type = 1;
KafkaPlainAuthentication plain = 2;
}
message KafkaPlainAuthentication {
string username = 1;
string password = 2;
}
message KafkaResponse {
string partition = 1;
string offset = 2;
}