forked from thanos-io/thanos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpc.proto
166 lines (133 loc) · 5.55 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
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
// Copyright (c) The Thanos Authors.
// Licensed under the Apache License 2.0.
syntax = "proto3";
package thanos;
import "store/storepb/types.proto";
import "gogoproto/gogo.proto";
import "store/storepb/prompb/types.proto";
import "google/protobuf/any.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;
// Do not generate XXX fields to reduce memory footprint and opening a door
// for zero-copy casts to/from prometheus data types.
option (gogoproto.goproto_unkeyed_all) = false;
option (gogoproto.goproto_unrecognized_all) = false;
option (gogoproto.goproto_sizecache_all) = false;
/// Store represents 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.
///
/// Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain
/// partition of the single series, but once a new series is started to be streamed it means that no more data will
/// be sent for previous one.
/// Series has to be sorted.
///
/// There is no requirements on chunk sorting, however it is recommended to have chunk sorted by chunk min time.
/// This heavily optimizes the resource usage on Querier / Federated Queries.
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);
}
/// WriteableStore represents API against instance that stores XOR encoded values with label set metadata (e.g Prometheus metrics).
service WriteableStore {
// WriteRequest allows you to write metrics to this store via remote write
rpc RemoteWrite(WriteRequest) returns (WriteResponse) {}
}
message WriteResponse {
}
message WriteRequest {
repeated prometheus_copy.TimeSeries timeseries = 1 [(gogoproto.nullable) = false];
string tenant = 2;
int64 replica = 3;
}
message InfoRequest {}
enum StoreType {
UNKNOWN = 0;
QUERY = 1;
RULE = 2;
SIDECAR = 3;
STORE = 4;
RECEIVE = 5;
// DEBUG represents some debug StoreAPI components e.g. thanos tools store-api-serve.
DEBUG = 6;
}
message InfoResponse {
// Deprecated. Use label_sets instead.
repeated Label labels = 1 [(gogoproto.nullable) = false];
int64 min_time = 2;
int64 max_time = 3;
StoreType storeType = 4;
// label_sets is an unsorted list of `LabelSet`s.
repeated LabelSet label_sets = 5 [(gogoproto.nullable) = false];
}
message LabelSet {
repeated Label labels = 1 [(gogoproto.nullable) = false];
}
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. Including QueryAPI.
PartialResponseStrategy partial_response_strategy = 7;
// skip_chunks controls whether sending chunks or not in series responses.
bool skip_chunks = 8;
// hints is an opaque data structure that can be used to carry additional information.
// The content of this field and whether it's supported depends on the
// implementation of a specific store.
google.protobuf.Any hints = 9;
}
enum Aggr {
RAW = 0;
COUNT = 1;
SUM = 2;
MIN = 3;
MAX = 4;
COUNTER = 5;
}
message SeriesResponse {
oneof result {
/// series contains 1 response series. The series labels are sorted by name.
Series series = 1;
/// warning is considered an information piece in place of series for warning purposes.
/// It is used to warn store API user about suspicious cases or partial response (if enabled).
string warning = 2;
/// hints is an opaque data structure that can be used to carry additional information from
/// the store. The content of this field and whether it's supported depends on the
/// implementation of a specific store. It's also implementation specific if it's allowed that
/// multiple SeriesResponse frames contain hints for a single Series() request and how should they
/// be handled in such case (ie. merged vs keep the first/last one).
google.protobuf.Any hints = 3;
}
}
message LabelNamesRequest {
bool partial_response_disabled = 1;
// TODO(bwplotka): Move Thanos components to use strategy instead. Including 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. Including QueryAPI.
PartialResponseStrategy partial_response_strategy = 3;
}
message LabelValuesResponse {
repeated string values = 1;
repeated string warnings = 2;
}