forked from thanos-io/thanos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpc.proto
122 lines (97 loc) · 3.71 KB
/
rpc.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
syntax = "proto3";
package thanos;
import "types.proto";
import "gogoproto/gogo.proto";
option go_package = "storepb";
option (gogoproto.sizer_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.goproto_getters_all) = false;
/// Store reprents API against instance that stores XOR encoded values with label set metadata (e.g Prometheus metrics).
service Store {
/// Info returns meta information about a store e.g labels that makes that store unique as well as time range that is
/// available.
rpc Info(InfoRequest) returns (InfoResponse);
/// Series streams each Series (Labels and chunk/downsampling chunk) for given label matchers and time range.
rpc Series(SeriesRequest) returns (stream SeriesResponse);
/// LabelNames returns all label names that is available.
/// Currently unimplemented in all Thanos implementations, because Query API does not implement this either.
rpc LabelNames(LabelNamesRequest) returns (LabelNamesResponse);
/// LabelValues returns all label values for given label name.
rpc LabelValues(LabelValuesRequest) returns (LabelValuesResponse);
}
message InfoRequest {
}
enum StoreType {
UNKNOWN = 0;
QUERY = 1;
RULE = 2;
SIDECAR = 3;
STORE = 4;
RECEIVE = 5;
}
message InfoResponse {
repeated Label labels = 1 [(gogoproto.nullable) = false];
int64 min_time = 2;
int64 max_time = 3;
StoreType storeType = 4;
}
/// PartialResponseStrategy controls partial response handling.
enum PartialResponseStrategy {
/// WARN strategy tells server to treat any error that will related to single StoreAPI (e.g missing chunk series because of underlying
/// storeAPI is temporarily not available) as warning which will not fail the whole query (still OK response).
/// Server should produce those as a warnings field in response.
WARN = 0;
/// ABORT strategy tells server to treat any error that will related to single StoreAPI (e.g missing chunk series because of underlying
/// storeAPI is temporarily not available) as the gRPC error that aborts the query.
///
/// This is especially useful for any rule/alert evaluations on top of StoreAPI which usually does not tolerate partial
/// errors.
ABORT = 1;
}
message SeriesRequest {
int64 min_time = 1;
int64 max_time = 2;
repeated LabelMatcher matchers = 3 [(gogoproto.nullable) = false];
int64 max_resolution_window = 4;
repeated Aggr aggregates = 5;
// Deprecated. Use partial_response_strategy instead.
bool partial_response_disabled = 6;
// TODO(bwplotka): Move Thanos components to use strategy instead. Inlcuding QueryAPI.
PartialResponseStrategy partial_response_strategy = 7;
}
enum Aggr {
RAW = 0;
COUNT = 1;
SUM = 2;
MIN = 3;
MAX = 4;
COUNTER = 5;
}
message SeriesResponse {
oneof result {
Series series = 1;
/// warning is considered an information piece in place of series for warning purposes.
/// It is used to warn query customer about suspicious cases or partial response (if enabled).
string warning = 2;
}
}
message LabelNamesRequest {
bool partial_response_disabled = 1;
// TODO(bwplotka): Move Thanos components to use strategy instead. Inlcuding QueryAPI.
PartialResponseStrategy partial_response_strategy = 2;
}
message LabelNamesResponse {
repeated string names = 1;
repeated string warnings = 2;
}
message LabelValuesRequest {
string label = 1;
bool partial_response_disabled = 2;
// TODO(bwplotka): Move Thanos components to use strategy instead. Inlcuding QueryAPI.
PartialResponseStrategy partial_response_strategy = 3;
}
message LabelValuesResponse {
repeated string values = 1;
repeated string warnings = 2;
}