-
Notifications
You must be signed in to change notification settings - Fork 797
/
cortex.proto
136 lines (106 loc) · 3.25 KB
/
cortex.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
syntax = "proto3";
package cortex;
option go_package = "client";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "google.golang.org/grpc/health/grpc_health_v1/health.proto";
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
service Ingester {
rpc Push(WriteRequest) returns (WriteResponse) {};
rpc Query(QueryRequest) returns (QueryResponse) {};
rpc LabelValues(LabelValuesRequest) returns (LabelValuesResponse) {};
rpc UserStats(UserStatsRequest) returns (UserStatsResponse) {};
rpc AllUserStats(UserStatsRequest) returns (UsersStatsResponse) {};
rpc MetricsForLabelMatchers(MetricsForLabelMatchersRequest) returns (MetricsForLabelMatchersResponse) {};
// TransferChunks allows leaving ingester (client) to stream chunks directly to joining ingesters (server).
rpc TransferChunks(stream TimeSeriesChunk) returns (TransferChunksResponse) {};
rpc Check(grpc.health.v1.HealthCheckRequest) returns (grpc.health.v1.HealthCheckResponse);
}
message WriteRequest {
repeated TimeSeries timeseries = 1 [(gogoproto.nullable) = false];
}
message WriteResponse {}
message ReadRequest {
repeated QueryRequest queries = 1;
}
message ReadResponse {
repeated QueryResponse results = 1;
}
message QueryRequest {
int64 start_timestamp_ms = 1;
int64 end_timestamp_ms = 2;
repeated LabelMatcher matchers = 3;
}
message QueryResponse {
repeated TimeSeries timeseries = 1 [(gogoproto.nullable) = false];
}
message LabelValuesRequest {
string label_name = 1;
}
message LabelValuesResponse {
repeated string label_values = 1;
}
message UserStatsRequest {}
message UserStatsResponse {
double ingestion_rate = 1;
uint64 num_series = 2;
}
message UserIDStatsResponse {
string user_id = 1;
UserStatsResponse data = 2;
}
message UsersStatsResponse {
repeated UserIDStatsResponse stats = 1;
}
message MetricsForLabelMatchersRequest {
int64 start_timestamp_ms = 1;
int64 end_timestamp_ms = 2;
repeated LabelMatchers matchers_set = 3;
}
message MetricsForLabelMatchersResponse {
repeated Metric metric = 1;
}
message TimeSeriesChunk {
string from_ingester_id = 1;
string user_id = 2;
repeated LabelPair labels = 3 [(gogoproto.nullable) = false];
repeated Chunk chunks = 4 [(gogoproto.nullable) = false];
}
message Chunk {
int64 start_timestamp_ms = 1;
int64 end_timestamp_ms = 2;
int32 encoding = 3;
bytes data = 4;
}
message TransferChunksResponse {
}
message TimeSeries {
repeated LabelPair labels = 1 [(gogoproto.nullable) = false];
// Sorted by time, oldest sample first.
repeated Sample samples = 2 [(gogoproto.nullable) = false];
}
message LabelPair {
bytes name = 1 [(gogoproto.customtype) = "github.com/weaveworks/cortex/pkg/util/wire.Bytes", (gogoproto.nullable) = false];
bytes value = 2 [(gogoproto.customtype) = "github.com/weaveworks/cortex/pkg/util/wire.Bytes", (gogoproto.nullable) = false];
}
message Sample {
double value = 1;
int64 timestamp_ms = 2;
}
message LabelMatchers {
repeated LabelMatcher matchers = 1;
}
message Metric {
repeated LabelPair labels = 1 [(gogoproto.nullable) = false];
}
enum MatchType {
EQUAL = 0;
NOT_EQUAL = 1;
REGEX_MATCH = 2;
REGEX_NO_MATCH = 3;
}
message LabelMatcher {
MatchType type = 1;
string name = 2;
string value = 3;
}