-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
Copy pathlogproto.proto
483 lines (414 loc) · 12.4 KB
/
logproto.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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
syntax = "proto3";
package logproto;
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "pkg/logqlmodel/stats/stats.proto";
import "pkg/push/push.proto";
option go_package = "github.com/grafana/loki/v3/pkg/logproto";
service Querier {
rpc Query(QueryRequest) returns (stream QueryResponse) {}
rpc QuerySample(SampleQueryRequest) returns (stream SampleQueryResponse) {}
rpc Label(LabelRequest) returns (LabelResponse) {}
rpc Tail(TailRequest) returns (stream TailResponse) {}
rpc Series(SeriesRequest) returns (SeriesResponse) {}
rpc TailersCount(TailersCountRequest) returns (TailersCountResponse) {}
rpc GetChunkIDs(GetChunkIDsRequest) returns (GetChunkIDsResponse) {}
// Note: this MUST be the same as the variant defined in
// indexgateway.proto on the IndexGateway service.
rpc GetStats(IndexStatsRequest) returns (IndexStatsResponse) {}
// Note: this MUST be the same as the variant defined in
// indexgateway.proto on the IndexGateway service.
rpc GetVolume(VolumeRequest) returns (VolumeResponse) {}
rpc GetDetectedFields(DetectedFieldsRequest) returns (DetectedFieldsResponse) {}
rpc GetDetectedLabels(DetectedLabelsRequest) returns (LabelToValuesResponse) {}
}
message LabelToValuesResponse {
map<string, UniqueLabelValues> labels = 1;
}
message UniqueLabelValues {
repeated string values = 1;
}
service StreamData {
rpc GetStreamRates(StreamRatesRequest) returns (StreamRatesResponse) {}
}
message StreamRatesRequest {}
message StreamRatesResponse {
repeated StreamRate streamRates = 1;
}
message StreamRate {
uint64 streamHash = 1;
uint64 streamHashNoShard = 2;
int64 rate = 3; // rate in plain bytes.
string tenant = 4;
uint32 pushes = 5;
}
message QueryRequest {
string selector = 1 [deprecated = true];
uint32 limit = 2;
google.protobuf.Timestamp start = 3 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
google.protobuf.Timestamp end = 4 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
Direction direction = 5;
reserved 6;
repeated string shards = 7 [(gogoproto.jsontag) = "shards,omitempty"];
repeated Delete deletes = 8;
Plan plan = 9 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/plan.QueryPlan"];
}
message SampleQueryRequest {
string selector = 1 [deprecated = true]; // mark as reserved once we've fully migrated to plan.
google.protobuf.Timestamp start = 2 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
google.protobuf.Timestamp end = 3 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
repeated string shards = 4 [(gogoproto.jsontag) = "shards,omitempty"];
repeated Delete deletes = 5;
Plan plan = 6 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/plan.QueryPlan"];
}
// TODO(owen-d): fix. This will break rollouts as soon as the internal repr is changed.
message Plan {
bytes raw = 1;
}
message Delete {
string selector = 1;
int64 start = 2;
int64 end = 3;
}
message QueryResponse {
repeated StreamAdapter streams = 1 [
(gogoproto.customtype) = "github.com/grafana/loki/pkg/push.Stream",
(gogoproto.nullable) = true
];
stats.Ingester stats = 2 [(gogoproto.nullable) = false];
repeated string warnings = 3;
}
message SampleQueryResponse {
repeated Series series = 1 [
(gogoproto.customtype) = "Series",
(gogoproto.nullable) = true
];
stats.Ingester stats = 2 [(gogoproto.nullable) = false];
repeated string warnings = 3;
}
enum Direction {
FORWARD = 0;
BACKWARD = 1;
}
message LabelRequest {
string name = 1;
bool values = 2; // True to fetch label values, false for fetch labels names.
google.protobuf.Timestamp start = 3 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = true
];
google.protobuf.Timestamp end = 4 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = true
];
string query = 5; // Naming this query instead of match because this should be with queryrangebase.Request interface
}
message LabelResponse {
repeated string values = 1;
}
message Sample {
int64 timestamp = 1 [(gogoproto.jsontag) = "ts"];
double value = 2 [(gogoproto.jsontag) = "value"];
uint64 hash = 3 [(gogoproto.jsontag) = "hash"];
}
// LegacySample exists for backwards compatibility reasons and is deprecated. Do not use.
message LegacySample {
double value = 1;
int64 timestamp_ms = 2;
}
message Series {
string labels = 1 [(gogoproto.jsontag) = "labels"];
repeated Sample samples = 2 [
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "samples"
];
uint64 streamHash = 3 [(gogoproto.jsontag) = "streamHash"];
}
message TailRequest {
string query = 1 [deprecated = true];
reserved 2;
uint32 delayFor = 3;
uint32 limit = 4;
google.protobuf.Timestamp start = 5 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
Plan plan = 6 [(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/plan.QueryPlan"];
}
message TailResponse {
StreamAdapter stream = 1 [(gogoproto.customtype) = "github.com/grafana/loki/pkg/push.Stream"];
repeated DroppedStream droppedStreams = 2;
}
message SeriesRequest {
google.protobuf.Timestamp start = 1 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
google.protobuf.Timestamp end = 2 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
repeated string groups = 3;
repeated string shards = 4 [(gogoproto.jsontag) = "shards,omitempty"];
}
message SeriesResponse {
repeated SeriesIdentifier series = 1 [(gogoproto.nullable) = false];
}
message SeriesIdentifier {
message LabelsEntry {
string key = 1;
string value = 2;
}
repeated LabelsEntry labels = 1 [(gogoproto.nullable) = false];
}
message DroppedStream {
google.protobuf.Timestamp from = 1 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
google.protobuf.Timestamp to = 2 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
string labels = 3;
}
message LabelPair {
string name = 1;
string value = 2;
}
// LegacyLabelPair exists for backwards compatibility reasons and is deprecated. Do not use.
// Use LabelPair instead.
message LegacyLabelPair {
bytes name = 1;
bytes value = 2;
}
message Chunk {
bytes data = 1;
}
message TailersCountRequest {}
message TailersCountResponse {
uint32 count = 1;
}
message GetChunkIDsRequest {
string matchers = 1;
google.protobuf.Timestamp start = 2 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
google.protobuf.Timestamp end = 3 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
}
message GetChunkIDsResponse {
repeated string chunkIDs = 1;
}
// ChunkRef contains the metadata to reference a Chunk.
// It is embedded by the Chunk type itself and used to generate the Chunk
// checksum. So it is imported to take care of the JSON representation of the
// resulting Go struct.
message ChunkRef {
uint64 fingerprint = 1 [(gogoproto.jsontag) = "fingerprint"];
string user_id = 2 [
(gogoproto.customname) = "UserID",
(gogoproto.jsontag) = "userID"
];
int64 from = 3 [
(gogoproto.jsontag) = "from",
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
int64 through = 4 [
(gogoproto.jsontag) = "through",
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
// The checksum is not written to the external storage. We use crc32,
// Castagnoli table. See http://www.evanjones.ca/crc32c.html.
uint32 checksum = 5 [(gogoproto.jsontag) = "-"];
}
message LabelValuesForMetricNameRequest {
string metric_name = 1;
string label_name = 2;
int64 from = 3 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
int64 through = 4 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
string matchers = 5;
}
message LabelNamesForMetricNameRequest {
string metric_name = 1;
int64 from = 2 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
int64 through = 3 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
}
// TODO(owen-d): fix. This will break rollouts as soon as the internal repr is changed.
message LineFilter {
bytes raw = 1;
}
message GetChunkRefRequest {
int64 from = 1 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
int64 through = 2 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
string matchers = 3;
// TODO(salvacorts): Delete this field once the weekly release is done.
repeated LineFilter filters = 4 [
(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/logql/syntax.LineFilter",
(gogoproto.nullable) = false
];
Plan plan = 5 [
(gogoproto.customtype) = "github.com/grafana/loki/v3/pkg/querier/plan.QueryPlan",
(gogoproto.nullable) = false
];
}
message GetChunkRefResponse {
repeated ChunkRef refs = 1;
}
message GetSeriesRequest {
int64 from = 1 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
int64 through = 2 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
string matchers = 3;
}
message GetSeriesResponse {
repeated IndexSeries series = 1 [(gogoproto.nullable) = false];
}
// Series calls to the TSDB Index
message IndexSeries {
repeated LabelPair labels = 1 [
(gogoproto.nullable) = false,
(gogoproto.customtype) = "LabelAdapter"
];
}
message QueryIndexResponse {
string QueryKey = 1;
repeated Row rows = 2;
}
message Row {
bytes rangeValue = 1;
bytes value = 2;
}
message QueryIndexRequest {
repeated IndexQuery Queries = 1;
}
message IndexQuery {
string tableName = 1;
string hashValue = 2;
bytes rangeValuePrefix = 3;
bytes rangeValueStart = 4;
bytes valueEqual = 5;
}
message IndexStatsRequest {
int64 from = 1 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
int64 through = 2 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
string matchers = 3;
// TODO(owen-d): add shards to grpc calls so we don't have
// to extract via labels
}
message IndexStatsResponse {
uint64 streams = 1 [(gogoproto.jsontag) = "streams"];
uint64 chunks = 2 [(gogoproto.jsontag) = "chunks"];
uint64 bytes = 3 [(gogoproto.jsontag) = "bytes"];
uint64 entries = 4 [(gogoproto.jsontag) = "entries"];
}
message VolumeRequest {
int64 from = 1 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
int64 through = 2 [
(gogoproto.customtype) = "github.com/prometheus/common/model.Time",
(gogoproto.nullable) = false
];
string matchers = 3;
int32 limit = 4;
int64 step = 5;
repeated string targetLabels = 6;
string aggregateBy = 7;
}
message VolumeResponse {
repeated Volume volumes = 1 [(gogoproto.nullable) = false];
int32 limit = 2;
}
message Volume {
string name = 1 [(gogoproto.jsontag) = "name"];
uint64 volume = 3 [(gogoproto.jsontag) = "volume"];
}
message DetectedFieldsRequest {
google.protobuf.Timestamp start = 1 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
google.protobuf.Timestamp end = 2 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
string query = 3; // Naming this query instead of match because this should be with queryrangebase.Request interface
uint32 lineLimit = 4;
uint32 fieldLimit = 5;
int64 step = 6;
}
message DetectedFieldsResponse {
repeated DetectedField fields = 1;
uint32 limit = 2;
}
message DetectedField {
string label = 1;
string type = 2 [(gogoproto.casttype) = "DetectedFieldType"];
uint64 cardinality = 3;
}
message DetectedLabelsRequest {
google.protobuf.Timestamp start = 1 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = true
];
google.protobuf.Timestamp end = 2 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = true
];
string query = 3;
}
message DetectedLabelsResponse {
repeated DetectedLabel detectedLabels = 1;
}
message DetectedLabel {
string label = 1;
uint64 cardinality = 2;
}