forked from cortexproject/cortex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquery.proto
111 lines (90 loc) · 3.8 KB
/
query.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
syntax = "proto3";
package tripperware;
option go_package = "tripperware";
import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/any.proto";
import "github.com/cortexproject/cortex/pkg/cortexpb/cortex.proto";
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
message PrometheusResponse {
string Status = 1 [(gogoproto.jsontag) = "status"];
PrometheusData Data = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "data,omitempty"];
string ErrorType = 3 [(gogoproto.jsontag) = "errorType,omitempty"];
string Error = 4 [(gogoproto.jsontag) = "error,omitempty"];
repeated tripperware.PrometheusResponseHeader Headers = 5 [(gogoproto.jsontag) = "-"];
repeated string Warnings = 6 [(gogoproto.jsontag) = "warnings,omitempty"];
repeated string Infos = 7 [(gogoproto.jsontag) = "infos,omitempty"];
}
message PrometheusData {
string ResultType = 1 [(gogoproto.jsontag) = "resultType"];
tripperware.PrometheusQueryResult Result = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "result"];
tripperware.PrometheusResponseStats stats = 3 [(gogoproto.jsontag) = "stats,omitempty"];
}
message CachedResponse {
string key = 1 [(gogoproto.jsontag) = "key"];
// List of cached responses; non-overlapping and in order.
repeated Extent extents = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "extents"];
}
message Extent {
int64 start = 1 [(gogoproto.jsontag) = "start"];
int64 end = 2 [(gogoproto.jsontag) = "end"];
// reserved the previous key to ensure cache transition
reserved 3;
string trace_id = 4 [(gogoproto.jsontag) = "-"];
google.protobuf.Any response = 5 [(gogoproto.jsontag) = "response"];
}
message SampleStream {
repeated cortexpb.LabelPair labels = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "metric", (gogoproto.customtype) = "github.com/cortexproject/cortex/pkg/cortexpb.LabelAdapter"];
repeated cortexpb.Sample samples = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "values"];
repeated SampleHistogramPair histograms = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "histograms"];
}
message SampleHistogramPair {
int64 timestamp_ms = 1;
SampleHistogram histogram = 2 [(gogoproto.nullable) = false];
}
message SampleHistogram {
double count = 1;
double sum = 2;
repeated HistogramBucket buckets = 3;
}
message HistogramBucket {
int32 boundaries = 1;
double lower = 2;
double upper = 3;
double count = 4;
}
message PrometheusResponseStats {
PrometheusResponseSamplesStats samples = 1 [(gogoproto.jsontag) = "samples"];
}
message PrometheusResponseSamplesStats {
int64 totalQueryableSamples = 1 [(gogoproto.jsontag) = "totalQueryableSamples"];
repeated PrometheusResponseQueryableSamplesStatsPerStep totalQueryableSamplesPerStep = 2 [(gogoproto.jsontag) = "totalQueryableSamplesPerStep"];
int64 peakSamples = 3 [(gogoproto.jsontag) = "peakSamples"];
}
message PrometheusResponseQueryableSamplesStatsPerStep {
int64 value = 1;
int64 timestamp_ms = 2;
}
message PrometheusResponseHeader {
string Name = 1 [(gogoproto.jsontag) = "-"];
repeated string Values = 2 [(gogoproto.jsontag) = "-"];
}
message PrometheusQueryResult {
oneof result {
Vector vector = 1;
bytes rawBytes = 2;
Matrix matrix = 3;
}
}
message Vector {
repeated Sample samples = 1;
}
message Sample {
repeated cortexpb.LabelPair labels = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "metric", (gogoproto.customtype) = "github.com/cortexproject/cortex/pkg/cortexpb.LabelAdapter"];
cortexpb.Sample sample = 2 [(gogoproto.nullable) = true, (gogoproto.jsontag) = "value"];
SampleHistogramPair histogram = 3 [(gogoproto.nullable) = true, (gogoproto.jsontag) = "histogram"];
}
message Matrix {
repeated SampleStream sampleStreams = 1 [(gogoproto.nullable) = false];
}