-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtoolquery.proto
More file actions
328 lines (276 loc) · 7.61 KB
/
Copy pathtoolquery.proto
File metadata and controls
328 lines (276 loc) · 7.61 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
324
325
326
327
328
syntax = "proto3";
package toolquery;
option go_package = "github.com/pluralsh/console/go/cloud-query/internal/proto/toolquery";
import "cloudquery.proto";
import "google/protobuf/timestamp.proto";
message ElasticConnection {
string url = 1;
string username = 2;
string password = 3;
string index = 4;
}
message OpensearchConnection {
string host = 1;
string index = 2;
optional string aws_access_key_id = 3;
optional string aws_secret_access_key = 4;
optional string aws_region = 5;
optional bool use_pod_identity = 6;
optional string assume_role_arn = 7;
}
message DatadogConnection {
optional string site = 1;
string apiKey = 2;
optional string appKey = 3;
}
message PrometheusConnection {
string url = 1;
optional string token = 2;
optional string username = 3;
optional string password = 4;
optional string tenant_id = 5;
optional bool aws_sigv4 = 6;
optional string aws_access_key_id = 7;
optional string aws_secret_access_key = 8;
optional string aws_region = 9;
}
message LokiConnection {
string url = 1;
optional string token = 2;
optional string tenant_id = 3;
optional string username = 4;
optional string password = 5;
}
message TempoConnection {
string url = 1;
optional string token = 2;
optional string tenant_id = 3;
optional string username = 4;
optional string password = 5;
}
message JaegerConnection {
string url = 1;
optional string token = 2;
optional string username = 3;
optional string password = 4;
}
message SplunkConnection {
string url = 1;
optional string token = 2;
optional string username = 3;
optional string password = 4;
}
message DynatraceConnection {
string url = 1;
string platformToken = 2;
}
message CloudwatchConnection {
string region = 1;
repeated string log_group_names = 2;
optional string access_key_id = 3;
optional string secret_access_key = 4;
optional string role_arn = 5;
optional string external_id = 6;
optional string role_session_name = 7;
}
message AzureConnection {
string subscription_id = 1;
string tenant_id = 2;
string client_id = 3;
string client_secret = 4;
}
message ToolConnection {
oneof connection {
ElasticConnection elastic = 1;
DatadogConnection datadog = 2;
PrometheusConnection prometheus = 3;
LokiConnection loki = 4;
TempoConnection tempo = 5;
SplunkConnection splunk = 6;
DynatraceConnection dynatrace = 7;
CloudwatchConnection cloudwatch = 8;
AzureConnection azure = 9;
JaegerConnection jaeger = 10;
OpensearchConnection opensearch = 11;
}
}
message TimeRange {
google.protobuf.Timestamp start = 1;
google.protobuf.Timestamp end = 2;
}
message MetricsQueryInput {
ToolConnection connection = 1;
string query = 2;
TimeRange range = 3;
optional string step = 4;
optional MetricsOptions options = 5;
}
message MetricsOptions {
optional AzureMetricsOptions azure = 1;
}
message AzureMetricsOptions {
string resource_id = 1;
string metrics_namespace = 2;
optional string aggregation = 3;
optional string filter = 4;
optional string order_by = 5;
optional string roll_up_by = 6;
optional string metrics_endpoint = 7;
optional string prometheus_url = 8;
}
message LogsQueryFacet {
string name = 1;
string value = 2;
}
message LogsQueryInput {
ToolConnection connection = 1;
string query = 2;
TimeRange range = 3;
optional int32 limit = 4;
repeated LogsQueryFacet facets = 5;
optional LogsOptions options = 6;
}
message LogsOptions {
optional AzureLogsOptions azure = 1;
}
message AzureLogsOptions {
string resource_id = 1;
}
message TracesQueryInput {
ToolConnection connection = 1;
string query = 2;
TimeRange range = 3;
optional int32 limit = 4;
optional TracesOptions options = 5;
}
message TracesOptions {
optional JaegerTracesOptions jaeger = 1;
}
message JaegerTraceQueryAttribute {
string name = 1;
string value = 2;
}
message JaegerTracesOptions {
optional string operation_name = 1;
repeated JaegerTraceQueryAttribute attributes = 2;
optional string duration_min = 3;
optional string duration_max = 4;
}
message MetricPoint {
google.protobuf.Timestamp timestamp = 1;
string name = 2;
double value = 3;
map<string, string> labels = 4;
}
message MetricsQueryOutput {
repeated MetricPoint metrics = 1;
}
message MetricsSearchInput {
ToolConnection connection = 1;
// Query string used to search for metric series or names.
// Semantics are provider-specific but typically support substring or
// pattern-based matching on metric names and associated labels.
string query = 2;
// Maximum number of results to return. If not set or zero, a
// provider-specific default will be used.
optional int64 limit = 3;
optional MetricsSearchOptions options = 4;
}
message MetricsSearchOptions {
optional AzureMetricsSearchOptions azure = 1;
}
message AzureMetricsSearchOptions {
string resource_id = 1;
optional string prometheus_url = 2;
}
message MetricsSearchResult {
// Name of the metric or series as returned by the provider.
string name = 1;
}
message MetricsSearchOutput {
repeated MetricsSearchResult metrics = 1;
}
message MetricsLabelSearchInput {
ToolConnection connection = 1;
string metric = 2;
optional string query = 3;
optional string label = 4;
optional int64 limit = 5;
optional MetricsLabelSearchOptions options = 6;
}
message MetricsLabelSearchOptions {
optional AzureMetricsLabelSearchOptions azure = 1;
}
message AzureMetricsLabelSearchOptions {
string resource_id = 1;
optional string metrics_namespace = 2;
optional string prometheus_url = 3;
optional string metrics_endpoint = 4;
}
message MetricsLabelSearchResult {
// Name of the matching label or label value.
string name = 1;
}
message MetricsLabelSearchOutput {
repeated MetricsLabelSearchResult results = 1;
}
message LogEntry {
google.protobuf.Timestamp timestamp = 1;
string message = 2;
map<string, string> labels = 3;
}
message LogsQueryOutput {
repeated LogEntry logs = 1;
}
message TraceSpan {
string trace_id = 1;
string span_id = 2;
string parent_id = 3;
string name = 4;
string service = 5;
google.protobuf.Timestamp start = 6;
google.protobuf.Timestamp end = 7;
map<string, string> tags = 8;
}
message TracesQueryOutput {
repeated TraceSpan spans = 1;
}
message InvokeLambdaInput {
cloudquery.Connection connection = 1;
string identifier = 2;
string payload_json = 3;
}
message InvokeLambdaOutput {
string result = 1;
string error = 2;
}
message RunLuaInput {
// The Lua script to execute. Output is taken from the global `output` variable.
string script = 1;
}
message RunLuaOutput {
// JSON-encoded result produced by the script.
string result_json = 1;
}
message RunPythonInput {
// Python source. Write structured results to the global `output` dictionary.
string script = 1;
// Optional JSON object exposed as the global `input` dictionary. Empty means `{}`.
string input_json = 2;
}
message RunPythonOutput {
// JSON-encoded contents of the global `output` dictionary.
string result_json = 1;
// Text emitted by print() during the user script.
string stdout = 2;
}
service ToolQuery {
rpc Metrics(MetricsQueryInput) returns (MetricsQueryOutput) {}
rpc MetricsSearch(MetricsSearchInput) returns (MetricsSearchOutput) {}
rpc MetricsLabelSearch(MetricsLabelSearchInput) returns (MetricsLabelSearchOutput) {}
rpc Logs(LogsQueryInput) returns (LogsQueryOutput) {}
rpc Traces(TracesQueryInput) returns (TracesQueryOutput) {}
rpc InvokeLambda(InvokeLambdaInput) returns (InvokeLambdaOutput) {}
rpc RunLua(RunLuaInput) returns (RunLuaOutput) {}
rpc RunPython(RunPythonInput) returns (RunPythonOutput) {}
}