diff --git a/development/mimir-read-write-mode/config/prometheus.yaml b/development/mimir-read-write-mode/config/prometheus.yaml new file mode 100644 index 0000000000..2f5a5707ff --- /dev/null +++ b/development/mimir-read-write-mode/config/prometheus.yaml @@ -0,0 +1,9 @@ +# Configure Prometheus to read from Mimir, so that we can test Mimir remote read endpoint +# sending queries from Prometheus. +remote_read: + - name: Mimir + url: http://mimir-read-1:8080/prometheus/api/v1/read + remote_timeout: 10s + read_recent: true + headers: + X-Scope-OrgID: anonymous diff --git a/development/mimir-read-write-mode/docker-compose.jsonnet b/development/mimir-read-write-mode/docker-compose.jsonnet index e31592fb5c..110bd501d5 100644 --- a/development/mimir-read-write-mode/docker-compose.jsonnet +++ b/development/mimir-read-write-mode/docker-compose.jsonnet @@ -9,6 +9,7 @@ std.manifestYamlDoc({ self.grafana + self.grafana_agent + self.memcached + + self.prometheus + {}, write:: { @@ -119,6 +120,21 @@ std.manifestYamlDoc({ }, }, + prometheus:: { + prometheus: { + image: 'prom/prometheus:v2.53.0', + command: [ + '--config.file=/etc/prometheus/prometheus.yaml', + '--enable-feature=exemplar-storage', + '--enable-feature=native-histograms', + ], + volumes: [ + './config:/etc/prometheus', + ], + ports: ['9090:9090'], + }, + }, + // This function builds docker-compose declaration for Mimir service. local mimirService(serviceOptions) = { local defaultOptions = { diff --git a/development/mimir-read-write-mode/docker-compose.yml b/development/mimir-read-write-mode/docker-compose.yml index c30f22ca2e..ceb21a6197 100644 --- a/development/mimir-read-write-mode/docker-compose.yml +++ b/development/mimir-read-write-mode/docker-compose.yml @@ -185,4 +185,14 @@ - "8080:8080" "volumes": - "../common/config:/etc/nginx/templates" + "prometheus": + "command": + - "--config.file=/etc/prometheus/prometheus.yaml" + - "--enable-feature=exemplar-storage" + - "--enable-feature=native-histograms" + "image": "prom/prometheus:v2.53.0" + "ports": + - "9090:9090" + "volumes": + - "./config:/etc/prometheus" "version": "3.4" diff --git a/integration/backward_compatibility_test.go b/integration/backward_compatibility_test.go index e6fc1c6096..f6aa5dcb85 100644 --- a/integration/backward_compatibility_test.go +++ b/integration/backward_compatibility_test.go @@ -9,6 +9,7 @@ package integration import ( "encoding/json" "fmt" + "net/http" "os" "strings" "testing" @@ -92,8 +93,8 @@ func runBackwardCompatibilityTest(t *testing.T, previousImage string, oldFlagsMa // Push some series to Mimir. series1Timestamp := time.Now() series2Timestamp := series1Timestamp.Add(blockRangePeriod * 2) - series1, expectedVector1, _ := generateFloatSeries("series_1", series1Timestamp, prompb.Label{Name: "series_1", Value: "series_1"}) - series2, expectedVector2, _ := generateFloatSeries("series_2", series2Timestamp, prompb.Label{Name: "series_2", Value: "series_2"}) + series1, expectedVector1, _ := generateFloatSeries("series_1", series1Timestamp, prompb.Label{Name: "label_1", Value: "label_1"}) + series2, expectedVector2, _ := generateFloatSeries("series_2", series2Timestamp, prompb.Label{Name: "label_2", Value: "label_2"}) c, err := e2emimir.NewClient(distributor.HTTPEndpoint(), "", "", "", "user-1") require.NoError(t, err) @@ -114,7 +115,7 @@ func runBackwardCompatibilityTest(t *testing.T, previousImage string, oldFlagsMa // Push another series to further compact another block and delete the first block // due to expired retention. series3Timestamp := series2Timestamp.Add(blockRangePeriod * 2) - series3, expectedVector3, _ := generateFloatSeries("series_3", series3Timestamp, prompb.Label{Name: "series_3", Value: "series_3"}) + series3, expectedVector3, _ := generateFloatSeries("series_3", series3Timestamp, prompb.Label{Name: "label_3", Value: "label_3"}) res, err = c.Push(series3) require.NoError(t, err) @@ -139,19 +140,41 @@ func runBackwardCompatibilityTest(t *testing.T, previousImage string, oldFlagsMa compactor := e2emimir.NewCompactor("compactor", consul.NetworkHTTPEndpoint(), flags) require.NoError(t, s.StartAndWaitReady(compactor)) - checkQueries(t, consul, previousImage, flags, oldFlagsMapper, s, 1, instantQueryTest{ - expr: "series_1", - time: series1Timestamp, - expectedVector: expectedVector1, - }, instantQueryTest{ - expr: "series_2", - time: series2Timestamp, - expectedVector: expectedVector2, - }, instantQueryTest{ - expr: "series_3", - time: series3Timestamp, - expectedVector: expectedVector3, - }) + checkQueries(t, consul, previousImage, flags, oldFlagsMapper, s, 1, + []instantQueryTest{ + { + expr: "series_1", + time: series1Timestamp, + expectedVector: expectedVector1, + }, { + expr: "series_2", + time: series2Timestamp, + expectedVector: expectedVector2, + }, { + expr: "series_3", + time: series3Timestamp, + expectedVector: expectedVector3, + }, + }, + []remoteReadRequestTest{ + { + metricName: "series_1", + startTime: series1Timestamp.Add(-time.Minute), + endTime: series1Timestamp.Add(time.Minute), + expectedTimeseries: vectorToPrompbTimeseries(expectedVector1), + }, { + metricName: "series_2", + startTime: series2Timestamp.Add(-time.Minute), + endTime: series2Timestamp.Add(time.Minute), + expectedTimeseries: vectorToPrompbTimeseries(expectedVector2), + }, { + metricName: "series_3", + startTime: series3Timestamp.Add(-time.Minute), + endTime: series3Timestamp.Add(time.Minute), + expectedTimeseries: vectorToPrompbTimeseries(expectedVector3), + }, + }, + ) } // Check for issues like https://github.com/cortexproject/cortex/issues/2356 @@ -195,11 +218,11 @@ func runNewDistributorsCanPushToOldIngestersWithReplication(t *testing.T, previo require.NoError(t, err) require.Equal(t, 200, res.StatusCode) - checkQueries(t, consul, previousImage, flags, oldFlagsMapper, s, 3, instantQueryTest{ + checkQueries(t, consul, previousImage, flags, oldFlagsMapper, s, 3, []instantQueryTest{{ time: now, expr: "series_1", expectedVector: expectedVector, - }) + }}, nil) } func checkQueries( @@ -210,7 +233,8 @@ func checkQueries( oldFlagsMapper e2emimir.FlagMapper, s *e2e.Scenario, numIngesters int, - instantQueries ...instantQueryTest, + instantQueries []instantQueryTest, + remoteReadRequests []remoteReadRequestTest, ) { cases := map[string]struct { queryFrontendOptions []e2emimir.Option @@ -272,11 +296,21 @@ func checkQueries( require.NoError(t, err) for _, query := range instantQueries { - t.Run(fmt.Sprintf("%s: %s", endpoint, query.expr), func(t *testing.T) { + t.Run(fmt.Sprintf("%s: instant query: %s", endpoint, query.expr), func(t *testing.T) { result, err := c.Query(query.expr, query.time) require.NoError(t, err) require.Equal(t, model.ValVector, result.Type()) - assert.Equal(t, query.expectedVector, result.(model.Vector)) + require.Equal(t, query.expectedVector, result.(model.Vector)) + }) + } + + for _, req := range remoteReadRequests { + t.Run(fmt.Sprintf("%s: remote read: %s", endpoint, req.metricName), func(t *testing.T) { + httpRes, result, _, err := c.RemoteRead(req.metricName, req.startTime, req.endTime) + require.NoError(t, err) + require.Equal(t, http.StatusOK, httpRes.StatusCode) + require.NotNil(t, result) + require.Equal(t, req.expectedTimeseries, result.Timeseries) }) } } @@ -290,6 +324,13 @@ type instantQueryTest struct { expectedVector model.Vector } +type remoteReadRequestTest struct { + metricName string + startTime time.Time + endTime time.Time + expectedTimeseries []*prompb.TimeSeries +} + type testingLogger interface{ Logf(string, ...interface{}) } func previousImageVersionOverrides(t *testing.T) map[string]e2emimir.FlagMapper { diff --git a/integration/querier_test.go b/integration/querier_test.go index 8b2d52a92f..43b674a6a2 100644 --- a/integration/querier_test.go +++ b/integration/querier_test.go @@ -758,7 +758,7 @@ func testMetadataQueriesWithBlocksStorage( require.NoError(t, err) if st.ok { require.Equal(t, 1, len(seriesRes), st) - require.Equal(t, model.LabelSet(prompbLabelsToModelMetric(st.resp)), seriesRes[0], st) + require.Equal(t, model.LabelSet(prompbLabelsToMetric(st.resp)), seriesRes[0], st) } else { require.Equal(t, 0, len(seriesRes), st) } @@ -1025,7 +1025,7 @@ func TestHashCollisionHandling(t *testing.T) { }, }) expectedVector = append(expectedVector, &model.Sample{ - Metric: prompbLabelsToModelMetric(metric1), + Metric: prompbLabelsToMetric(metric1), Value: model.SampleValue(float64(0)), Timestamp: model.Time(tsMillis), }) @@ -1036,7 +1036,7 @@ func TestHashCollisionHandling(t *testing.T) { }, }) expectedVector = append(expectedVector, &model.Sample{ - Metric: prompbLabelsToModelMetric(metric2), + Metric: prompbLabelsToMetric(metric2), Value: model.SampleValue(float64(1)), Timestamp: model.Time(tsMillis), }) @@ -1070,13 +1070,3 @@ func getMetricName(lbls []prompb.Label) string { panic(fmt.Sprintf("series %v has no metric name", lbls)) } - -func prompbLabelsToModelMetric(pbLabels []prompb.Label) model.Metric { - metric := model.Metric{} - - for _, l := range pbLabels { - metric[model.LabelName(l.Name)] = model.LabelValue(l.Value) - } - - return metric -} diff --git a/integration/util.go b/integration/util.go index c571968ad0..d6e30b922e 100644 --- a/integration/util.go +++ b/integration/util.go @@ -12,6 +12,8 @@ import ( "os" "os/exec" "path/filepath" + "slices" + "strings" "time" "github.com/grafana/e2e" @@ -258,3 +260,54 @@ func GenerateNHistogramSeries(nSeries, nExemplars int, name func() string, ts ti } return } + +func prompbLabelsToMetric(pbLabels []prompb.Label) model.Metric { + metric := make(model.Metric, len(pbLabels)) + + for _, l := range pbLabels { + metric[model.LabelName(l.Name)] = model.LabelValue(l.Value) + } + + return metric +} + +func metricToPrompbLabels(metric model.Metric) []prompb.Label { + lbls := make([]prompb.Label, 0, len(metric)) + + for name, value := range metric { + lbls = append(lbls, prompb.Label{ + Name: string(name), + Value: string(value), + }) + } + + // Sort labels because they're expected to be sorted by contract. + slices.SortFunc(lbls, func(a, b prompb.Label) int { + cmp := strings.Compare(a.Name, b.Name) + if cmp != 0 { + return cmp + } + + return strings.Compare(a.Value, b.Value) + }) + + return lbls +} + +func vectorToPrompbTimeseries(vector model.Vector) []*prompb.TimeSeries { + res := make([]*prompb.TimeSeries, 0, len(vector)) + + for _, sample := range vector { + res = append(res, &prompb.TimeSeries{ + Labels: metricToPrompbLabels(sample.Metric), + Samples: []prompb.Sample{ + { + Value: float64(sample.Value), + Timestamp: int64(sample.Timestamp), + }, + }, + }) + } + + return res +} diff --git a/pkg/ingester/client/compat_test.go b/pkg/ingester/client/compat_test.go index de31d1be2e..8bfbac5a5b 100644 --- a/pkg/ingester/client/compat_test.go +++ b/pkg/ingester/client/compat_test.go @@ -12,7 +12,6 @@ import ( "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" - "github.com/prometheus/prometheus/prompb" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -88,43 +87,6 @@ func TestLabelNamesRequest(t *testing.T) { assert.Equal(t, matchers, actualMatchers) } -// This test checks that we ignore remote read hints when unmarshalling a -// remote read request. This is because the query frontend does the same -// and we want them to be in sync. -func TestRemoteReadRequestIgnoresHints(t *testing.T) { - promRemoteReadRequest := &prompb.ReadRequest{ - Queries: []*prompb.Query{ - { - Hints: &prompb.ReadHints{ - StartMs: 1, - EndMs: 2, - StepMs: 3, - }, - }, - }, - } - data, err := promRemoteReadRequest.Marshal() - require.NoError(t, err) - - remoteReadRequest := &ReadRequest{} - err = remoteReadRequest.Unmarshal(data) - require.NoError(t, err) - - data2, err := remoteReadRequest.Marshal() - require.NoError(t, err) - - restored := &prompb.ReadRequest{} - err = restored.Unmarshal(data2) - require.NoError(t, err) - - require.Equal(t, len(promRemoteReadRequest.Queries), len(restored.Queries)) - for i := range promRemoteReadRequest.Queries { - require.Nil(t, restored.Queries[i].Hints) - promRemoteReadRequest.Queries[i].Hints = nil - require.Equal(t, promRemoteReadRequest.Queries[i], restored.Queries[i]) - } -} - // The main usecase for `LabelsToKeyString` is to generate hashKeys // for maps. We are benchmarking that here. func BenchmarkSeriesMap(b *testing.B) { diff --git a/pkg/ingester/client/ingester.pb.go b/pkg/ingester/client/ingester.pb.go index 5439674039..687fa15e02 100644 --- a/pkg/ingester/client/ingester.pb.go +++ b/pkg/ingester/client/ingester.pb.go @@ -85,54 +85,6 @@ func (MatchType) EnumDescriptor() ([]byte, []int) { return fileDescriptor_60f6df4f3586b478, []int{1} } -type ReadRequest_ResponseType int32 - -const ( - SAMPLES ReadRequest_ResponseType = 0 - STREAMED_XOR_CHUNKS ReadRequest_ResponseType = 1 -) - -var ReadRequest_ResponseType_name = map[int32]string{ - 0: "SAMPLES", - 1: "STREAMED_XOR_CHUNKS", -} - -var ReadRequest_ResponseType_value = map[string]int32{ - "SAMPLES": 0, - "STREAMED_XOR_CHUNKS": 1, -} - -func (ReadRequest_ResponseType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{6, 0} -} - -type StreamChunk_Encoding int32 - -const ( - UNKNOWN StreamChunk_Encoding = 0 - XOR StreamChunk_Encoding = 1 - HISTOGRAM StreamChunk_Encoding = 2 - FLOAT_HISTOGRAM StreamChunk_Encoding = 3 -) - -var StreamChunk_Encoding_name = map[int32]string{ - 0: "UNKNOWN", - 1: "XOR", - 2: "HISTOGRAM", - 3: "FLOAT_HISTOGRAM", -} - -var StreamChunk_Encoding_value = map[string]int32{ - "UNKNOWN": 0, - "XOR": 1, - "HISTOGRAM": 2, - "FLOAT_HISTOGRAM": 3, -} - -func (StreamChunk_Encoding) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{10, 0} -} - type ActiveSeriesRequest_RequestType int32 const ( @@ -151,7 +103,7 @@ var ActiveSeriesRequest_RequestType_value = map[string]int32{ } func (ActiveSeriesRequest_RequestType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{13, 0} + return fileDescriptor_60f6df4f3586b478, []int{8, 0} } type LabelNamesAndValuesRequest struct { @@ -452,255 +404,6 @@ func (m *LabelValueSeriesCount) GetLabelValueSeries() map[string]uint64 { return nil } -type ReadRequest struct { - Queries []*QueryRequest `protobuf:"bytes,1,rep,name=queries,proto3" json:"queries,omitempty"` - AcceptedResponseTypes []ReadRequest_ResponseType `protobuf:"varint,2,rep,packed,name=accepted_response_types,json=acceptedResponseTypes,proto3,enum=cortex.ReadRequest_ResponseType" json:"accepted_response_types,omitempty"` -} - -func (m *ReadRequest) Reset() { *m = ReadRequest{} } -func (*ReadRequest) ProtoMessage() {} -func (*ReadRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{6} -} -func (m *ReadRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReadRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ReadRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadRequest.Merge(m, src) -} -func (m *ReadRequest) XXX_Size() int { - return m.Size() -} -func (m *ReadRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ReadRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadRequest proto.InternalMessageInfo - -func (m *ReadRequest) GetQueries() []*QueryRequest { - if m != nil { - return m.Queries - } - return nil -} - -func (m *ReadRequest) GetAcceptedResponseTypes() []ReadRequest_ResponseType { - if m != nil { - return m.AcceptedResponseTypes - } - return nil -} - -type ReadResponse struct { - Results []*QueryResponse `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` -} - -func (m *ReadResponse) Reset() { *m = ReadResponse{} } -func (*ReadResponse) ProtoMessage() {} -func (*ReadResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{7} -} -func (m *ReadResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReadResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ReadResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadResponse.Merge(m, src) -} -func (m *ReadResponse) XXX_Size() int { - return m.Size() -} -func (m *ReadResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ReadResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadResponse proto.InternalMessageInfo - -func (m *ReadResponse) GetResults() []*QueryResponse { - if m != nil { - return m.Results - } - return nil -} - -type StreamReadResponse struct { - ChunkedSeries []*StreamChunkedSeries `protobuf:"bytes,1,rep,name=chunked_series,json=chunkedSeries,proto3" json:"chunked_series,omitempty"` - QueryIndex int64 `protobuf:"varint,2,opt,name=query_index,json=queryIndex,proto3" json:"query_index,omitempty"` -} - -func (m *StreamReadResponse) Reset() { *m = StreamReadResponse{} } -func (*StreamReadResponse) ProtoMessage() {} -func (*StreamReadResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{8} -} -func (m *StreamReadResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StreamReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StreamReadResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StreamReadResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StreamReadResponse.Merge(m, src) -} -func (m *StreamReadResponse) XXX_Size() int { - return m.Size() -} -func (m *StreamReadResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StreamReadResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StreamReadResponse proto.InternalMessageInfo - -func (m *StreamReadResponse) GetChunkedSeries() []*StreamChunkedSeries { - if m != nil { - return m.ChunkedSeries - } - return nil -} - -func (m *StreamReadResponse) GetQueryIndex() int64 { - if m != nil { - return m.QueryIndex - } - return 0 -} - -type StreamChunkedSeries struct { - Labels []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" json:"labels"` - Chunks []StreamChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` -} - -func (m *StreamChunkedSeries) Reset() { *m = StreamChunkedSeries{} } -func (*StreamChunkedSeries) ProtoMessage() {} -func (*StreamChunkedSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{9} -} -func (m *StreamChunkedSeries) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StreamChunkedSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StreamChunkedSeries.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StreamChunkedSeries) XXX_Merge(src proto.Message) { - xxx_messageInfo_StreamChunkedSeries.Merge(m, src) -} -func (m *StreamChunkedSeries) XXX_Size() int { - return m.Size() -} -func (m *StreamChunkedSeries) XXX_DiscardUnknown() { - xxx_messageInfo_StreamChunkedSeries.DiscardUnknown(m) -} - -var xxx_messageInfo_StreamChunkedSeries proto.InternalMessageInfo - -func (m *StreamChunkedSeries) GetChunks() []StreamChunk { - if m != nil { - return m.Chunks - } - return nil -} - -type StreamChunk struct { - MinTimeMs int64 `protobuf:"varint,1,opt,name=min_time_ms,json=minTimeMs,proto3" json:"min_time_ms,omitempty"` - MaxTimeMs int64 `protobuf:"varint,2,opt,name=max_time_ms,json=maxTimeMs,proto3" json:"max_time_ms,omitempty"` - Type StreamChunk_Encoding `protobuf:"varint,3,opt,name=type,proto3,enum=cortex.StreamChunk_Encoding" json:"type,omitempty"` - Data github_com_grafana_mimir_pkg_mimirpb.UnsafeByteSlice `protobuf:"bytes,4,opt,name=data,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.UnsafeByteSlice" json:"data"` -} - -func (m *StreamChunk) Reset() { *m = StreamChunk{} } -func (*StreamChunk) ProtoMessage() {} -func (*StreamChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{10} -} -func (m *StreamChunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StreamChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StreamChunk.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StreamChunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_StreamChunk.Merge(m, src) -} -func (m *StreamChunk) XXX_Size() int { - return m.Size() -} -func (m *StreamChunk) XXX_DiscardUnknown() { - xxx_messageInfo_StreamChunk.DiscardUnknown(m) -} - -var xxx_messageInfo_StreamChunk proto.InternalMessageInfo - -func (m *StreamChunk) GetMinTimeMs() int64 { - if m != nil { - return m.MinTimeMs - } - return 0 -} - -func (m *StreamChunk) GetMaxTimeMs() int64 { - if m != nil { - return m.MaxTimeMs - } - return 0 -} - -func (m *StreamChunk) GetType() StreamChunk_Encoding { - if m != nil { - return m.Type - } - return UNKNOWN -} - type QueryRequest struct { StartTimestampMs int64 `protobuf:"varint,1,opt,name=start_timestamp_ms,json=startTimestampMs,proto3" json:"start_timestamp_ms,omitempty"` EndTimestampMs int64 `protobuf:"varint,2,opt,name=end_timestamp_ms,json=endTimestampMs,proto3" json:"end_timestamp_ms,omitempty"` @@ -712,7 +415,7 @@ type QueryRequest struct { func (m *QueryRequest) Reset() { *m = QueryRequest{} } func (*QueryRequest) ProtoMessage() {} func (*QueryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{11} + return fileDescriptor_60f6df4f3586b478, []int{6} } func (m *QueryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -778,7 +481,7 @@ type ExemplarQueryRequest struct { func (m *ExemplarQueryRequest) Reset() { *m = ExemplarQueryRequest{} } func (*ExemplarQueryRequest) ProtoMessage() {} func (*ExemplarQueryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{12} + return fileDescriptor_60f6df4f3586b478, []int{7} } func (m *ExemplarQueryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -836,7 +539,7 @@ type ActiveSeriesRequest struct { func (m *ActiveSeriesRequest) Reset() { *m = ActiveSeriesRequest{} } func (*ActiveSeriesRequest) ProtoMessage() {} func (*ActiveSeriesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{13} + return fileDescriptor_60f6df4f3586b478, []int{8} } func (m *ActiveSeriesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -886,7 +589,7 @@ type QueryResponse struct { func (m *QueryResponse) Reset() { *m = QueryResponse{} } func (*QueryResponse) ProtoMessage() {} func (*QueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{14} + return fileDescriptor_60f6df4f3586b478, []int{9} } func (m *QueryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -941,7 +644,7 @@ type QueryStreamResponse struct { func (m *QueryStreamResponse) Reset() { *m = QueryStreamResponse{} } func (*QueryStreamResponse) ProtoMessage() {} func (*QueryStreamResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{15} + return fileDescriptor_60f6df4f3586b478, []int{10} } func (m *QueryStreamResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1013,7 +716,7 @@ type QueryStreamSeries struct { func (m *QueryStreamSeries) Reset() { *m = QueryStreamSeries{} } func (*QueryStreamSeries) ProtoMessage() {} func (*QueryStreamSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{16} + return fileDescriptor_60f6df4f3586b478, []int{11} } func (m *QueryStreamSeries) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1057,7 +760,7 @@ type QueryStreamSeriesChunks struct { func (m *QueryStreamSeriesChunks) Reset() { *m = QueryStreamSeriesChunks{} } func (*QueryStreamSeriesChunks) ProtoMessage() {} func (*QueryStreamSeriesChunks) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{17} + return fileDescriptor_60f6df4f3586b478, []int{12} } func (m *QueryStreamSeriesChunks) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1107,7 +810,7 @@ type ExemplarQueryResponse struct { func (m *ExemplarQueryResponse) Reset() { *m = ExemplarQueryResponse{} } func (*ExemplarQueryResponse) ProtoMessage() {} func (*ExemplarQueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{18} + return fileDescriptor_60f6df4f3586b478, []int{13} } func (m *ExemplarQueryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1153,7 +856,7 @@ type LabelValuesRequest struct { func (m *LabelValuesRequest) Reset() { *m = LabelValuesRequest{} } func (*LabelValuesRequest) ProtoMessage() {} func (*LabelValuesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{19} + return fileDescriptor_60f6df4f3586b478, []int{14} } func (m *LabelValuesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1217,7 +920,7 @@ type LabelValuesResponse struct { func (m *LabelValuesResponse) Reset() { *m = LabelValuesResponse{} } func (*LabelValuesResponse) ProtoMessage() {} func (*LabelValuesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{20} + return fileDescriptor_60f6df4f3586b478, []int{15} } func (m *LabelValuesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1262,7 +965,7 @@ type LabelNamesRequest struct { func (m *LabelNamesRequest) Reset() { *m = LabelNamesRequest{} } func (*LabelNamesRequest) ProtoMessage() {} func (*LabelNamesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{21} + return fileDescriptor_60f6df4f3586b478, []int{16} } func (m *LabelNamesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1319,7 +1022,7 @@ type LabelNamesResponse struct { func (m *LabelNamesResponse) Reset() { *m = LabelNamesResponse{} } func (*LabelNamesResponse) ProtoMessage() {} func (*LabelNamesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{22} + return fileDescriptor_60f6df4f3586b478, []int{17} } func (m *LabelNamesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1362,7 +1065,7 @@ type UserStatsRequest struct { func (m *UserStatsRequest) Reset() { *m = UserStatsRequest{} } func (*UserStatsRequest) ProtoMessage() {} func (*UserStatsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{23} + return fileDescriptor_60f6df4f3586b478, []int{18} } func (m *UserStatsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1408,7 +1111,7 @@ type UserStatsResponse struct { func (m *UserStatsResponse) Reset() { *m = UserStatsResponse{} } func (*UserStatsResponse) ProtoMessage() {} func (*UserStatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{24} + return fileDescriptor_60f6df4f3586b478, []int{19} } func (m *UserStatsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1473,7 +1176,7 @@ type UserIDStatsResponse struct { func (m *UserIDStatsResponse) Reset() { *m = UserIDStatsResponse{} } func (*UserIDStatsResponse) ProtoMessage() {} func (*UserIDStatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{25} + return fileDescriptor_60f6df4f3586b478, []int{20} } func (m *UserIDStatsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1523,7 +1226,7 @@ type UsersStatsResponse struct { func (m *UsersStatsResponse) Reset() { *m = UsersStatsResponse{} } func (*UsersStatsResponse) ProtoMessage() {} func (*UsersStatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{26} + return fileDescriptor_60f6df4f3586b478, []int{21} } func (m *UsersStatsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1568,7 +1271,7 @@ type MetricsForLabelMatchersRequest struct { func (m *MetricsForLabelMatchersRequest) Reset() { *m = MetricsForLabelMatchersRequest{} } func (*MetricsForLabelMatchersRequest) ProtoMessage() {} func (*MetricsForLabelMatchersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{27} + return fileDescriptor_60f6df4f3586b478, []int{22} } func (m *MetricsForLabelMatchersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1625,7 +1328,7 @@ type MetricsForLabelMatchersResponse struct { func (m *MetricsForLabelMatchersResponse) Reset() { *m = MetricsForLabelMatchersResponse{} } func (*MetricsForLabelMatchersResponse) ProtoMessage() {} func (*MetricsForLabelMatchersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{28} + return fileDescriptor_60f6df4f3586b478, []int{23} } func (m *MetricsForLabelMatchersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1670,7 +1373,7 @@ type MetricsMetadataRequest struct { func (m *MetricsMetadataRequest) Reset() { *m = MetricsMetadataRequest{} } func (*MetricsMetadataRequest) ProtoMessage() {} func (*MetricsMetadataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{29} + return fileDescriptor_60f6df4f3586b478, []int{24} } func (m *MetricsMetadataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1727,7 +1430,7 @@ type MetricsMetadataResponse struct { func (m *MetricsMetadataResponse) Reset() { *m = MetricsMetadataResponse{} } func (*MetricsMetadataResponse) ProtoMessage() {} func (*MetricsMetadataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{30} + return fileDescriptor_60f6df4f3586b478, []int{25} } func (m *MetricsMetadataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1773,7 +1476,7 @@ type ActiveSeriesResponse struct { func (m *ActiveSeriesResponse) Reset() { *m = ActiveSeriesResponse{} } func (*ActiveSeriesResponse) ProtoMessage() {} func (*ActiveSeriesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{31} + return fileDescriptor_60f6df4f3586b478, []int{26} } func (m *ActiveSeriesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1826,7 +1529,7 @@ type TimeSeriesChunk struct { func (m *TimeSeriesChunk) Reset() { *m = TimeSeriesChunk{} } func (*TimeSeriesChunk) ProtoMessage() {} func (*TimeSeriesChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{32} + return fileDescriptor_60f6df4f3586b478, []int{27} } func (m *TimeSeriesChunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1886,7 +1589,7 @@ type Chunk struct { func (m *Chunk) Reset() { *m = Chunk{} } func (*Chunk) ProtoMessage() {} func (*Chunk) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{33} + return fileDescriptor_60f6df4f3586b478, []int{28} } func (m *Chunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1943,7 +1646,7 @@ type LabelMatchers struct { func (m *LabelMatchers) Reset() { *m = LabelMatchers{} } func (*LabelMatchers) ProtoMessage() {} func (*LabelMatchers) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{34} + return fileDescriptor_60f6df4f3586b478, []int{29} } func (m *LabelMatchers) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1988,7 +1691,7 @@ type LabelMatcher struct { func (m *LabelMatcher) Reset() { *m = LabelMatcher{} } func (*LabelMatcher) ProtoMessage() {} func (*LabelMatcher) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{35} + return fileDescriptor_60f6df4f3586b478, []int{30} } func (m *LabelMatcher) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2048,7 +1751,7 @@ type TimeSeriesFile struct { func (m *TimeSeriesFile) Reset() { *m = TimeSeriesFile{} } func (*TimeSeriesFile) ProtoMessage() {} func (*TimeSeriesFile) Descriptor() ([]byte, []int) { - return fileDescriptor_60f6df4f3586b478, []int{36} + return fileDescriptor_60f6df4f3586b478, []int{31} } func (m *TimeSeriesFile) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2108,8 +1811,6 @@ func (m *TimeSeriesFile) GetData() []byte { func init() { proto.RegisterEnum("cortex.CountMethod", CountMethod_name, CountMethod_value) proto.RegisterEnum("cortex.MatchType", MatchType_name, MatchType_value) - proto.RegisterEnum("cortex.ReadRequest_ResponseType", ReadRequest_ResponseType_name, ReadRequest_ResponseType_value) - proto.RegisterEnum("cortex.StreamChunk_Encoding", StreamChunk_Encoding_name, StreamChunk_Encoding_value) proto.RegisterEnum("cortex.ActiveSeriesRequest_RequestType", ActiveSeriesRequest_RequestType_name, ActiveSeriesRequest_RequestType_value) proto.RegisterType((*LabelNamesAndValuesRequest)(nil), "cortex.LabelNamesAndValuesRequest") proto.RegisterType((*LabelNamesAndValuesResponse)(nil), "cortex.LabelNamesAndValuesResponse") @@ -2118,11 +1819,6 @@ func init() { proto.RegisterType((*LabelValuesCardinalityResponse)(nil), "cortex.LabelValuesCardinalityResponse") proto.RegisterType((*LabelValueSeriesCount)(nil), "cortex.LabelValueSeriesCount") proto.RegisterMapType((map[string]uint64)(nil), "cortex.LabelValueSeriesCount.LabelValueSeriesEntry") - proto.RegisterType((*ReadRequest)(nil), "cortex.ReadRequest") - proto.RegisterType((*ReadResponse)(nil), "cortex.ReadResponse") - proto.RegisterType((*StreamReadResponse)(nil), "cortex.StreamReadResponse") - proto.RegisterType((*StreamChunkedSeries)(nil), "cortex.StreamChunkedSeries") - proto.RegisterType((*StreamChunk)(nil), "cortex.StreamChunk") proto.RegisterType((*QueryRequest)(nil), "cortex.QueryRequest") proto.RegisterType((*ExemplarQueryRequest)(nil), "cortex.ExemplarQueryRequest") proto.RegisterType((*ActiveSeriesRequest)(nil), "cortex.ActiveSeriesRequest") @@ -2154,136 +1850,119 @@ func init() { func init() { proto.RegisterFile("ingester.proto", fileDescriptor_60f6df4f3586b478) } var fileDescriptor_60f6df4f3586b478 = []byte{ - // 2064 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcd, 0x6f, 0x1b, 0xc7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b, 0xe4, 0xd4, 0x47, 0xa6, 0x6a, 0x69, - 0x0e, 0xcf, 0x10, 0xa4, 0xcc, 0x7b, 0x54, 0x45, 0x73, 0x08, 0x4d, 0x22, 0x73, 0x62, 0xf8, 0x03, - 0x3c, 0x4d, 0xff, 0xac, 0x39, 0x71, 0xef, 0xf0, 0x3b, 0x80, 0xb5, 0xb1, 0xae, 0x46, 0x2c, 0xa5, - 0x98, 0xa5, 0xa2, 0x36, 0xd6, 0x9b, 0x21, 0x63, 0x35, 0x28, 0x59, 0x93, 0x21, 0x89, 0x8a, 0xa7, - 0x99, 0xf8, 0x02, 0x65, 0x85, 0xe4, 0xe5, 0xcf, 0xa0, 0x44, 0x81, 0x37, 0xb7, 0xc2, 0xd0, 0xcb, - 0x30, 0x3b, 0xb1, 0x89, 0xa5, 0xea, 0x03, 0x91, 0xd5, 0x33, 0x74, 0xd9, 0x1c, 0xe0, 0x77, 0xc5, - 0x30, 0x94, 0x64, 0x67, 0xe3, 0x15, 0xcf, 0x29, 0xe7, 0xc5, 0xa4, 0x73, 0x1f, 0x30, 0x65, 0xd9, - 0x61, 0xeb, 0x37, 0x21, 0x63, 0x53, 0x42, 0x74, 0xc4, 0x8d, 0x41, 0xa2, 0x70, 0x49, 0xf9, 0xaf, - 0x08, 0xaa, 0x2d, 0xe2, 0x58, 0x7a, 0xdf, 0xbe, 0x37, 0xb2, 0xc2, 0xa9, 0xf0, 0x92, 0x53, 0xf2, - 0x2e, 0xe4, 0xdd, 0x5c, 0x53, 0x6d, 0xe2, 0x9c, 0x3f, 0x13, 0xe4, 0x5c, 0xd1, 0x0e, 0x71, 0xe4, - 0x87, 0xb0, 0x72, 0x26, 0x66, 0x11, 0x8a, 0x35, 0x98, 0x31, 0x98, 0x88, 0x88, 0x45, 0xd1, 0x2f, - 0x48, 0x5c, 0x55, 0x11, 0x7c, 0x79, 0x0c, 0x57, 0x85, 0xb1, 0x16, 0x71, 0x34, 0x1a, 0x5d, 0xd7, - 0xf1, 0x45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, 0xd3, 0x6a, 0xe2, 0xdb, 0xd3, 0x2a, 0xfa, 0xed, 0xf3, 0x6a, 0xe2, 0xc9, 0xf3, 0x6a, - 0xe2, 0x9b, 0xe7, 0xd5, 0xc4, 0x2f, 0x67, 0xfa, 0x43, 0x9d, 0x98, 0x4e, 0x6f, 0x86, 0xfd, 0xbb, - 0xe3, 0xf6, 0x77, 0x01, 0x00, 0x00, 0xff, 0xff, 0x17, 0xc5, 0xfb, 0x24, 0x69, 0x19, 0x00, 0x00, + // 1780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, + 0x15, 0xe7, 0xf0, 0x2b, 0xe2, 0x23, 0x45, 0x53, 0x43, 0xd9, 0x64, 0x56, 0xd1, 0x4a, 0xd9, 0xc2, + 0x09, 0x9b, 0x26, 0x92, 0xbf, 0x1a, 0x38, 0x69, 0x8a, 0x82, 0x92, 0x69, 0x8b, 0x4e, 0x28, 0x29, + 0x4b, 0x29, 0xfd, 0x00, 0x82, 0xc5, 0x92, 0x1c, 0x4a, 0x0b, 0xed, 0x2e, 0xd9, 0xdd, 0x61, 0x60, + 0xe5, 0x54, 0xa0, 0x40, 0xcf, 0xfd, 0x03, 0x8a, 0x02, 0xbd, 0x15, 0x3d, 0xf6, 0xd2, 0x4b, 0xd1, + 0x73, 0x2e, 0x05, 0x7c, 0x6b, 0x50, 0xa0, 0x46, 0x2d, 0x5f, 0xda, 0x5b, 0x80, 0xfe, 0x03, 0xc5, + 0xce, 0xcc, 0x7e, 0x92, 0x92, 0xa8, 0x20, 0xf6, 0x89, 0x3b, 0xef, 0x6b, 0x7e, 0xef, 0xcd, 0x9b, + 0xf7, 0x1e, 0x07, 0xca, 0x86, 0x7d, 0x44, 0x5c, 0x4a, 0x9c, 0x8d, 0xb1, 0x33, 0xa2, 0x23, 0x9c, + 0xef, 0x8f, 0x1c, 0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4, 0xde, 0xfd, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x33, 0xc8, 0xcb, + 0x03, 0x16, 0x00, 0x00, } func (x CountMethod) String() string { @@ -2300,20 +1979,6 @@ func (x MatchType) String() string { } return strconv.Itoa(int(x)) } -func (x ReadRequest_ResponseType) String() string { - s, ok := ReadRequest_ResponseType_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (x StreamChunk_Encoding) String() string { - s, ok := StreamChunk_Encoding_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} func (x ActiveSeriesRequest_RequestType) String() string { s, ok := ActiveSeriesRequest_RequestType_name[int32(x)] if ok { @@ -2515,14 +2180,14 @@ func (this *LabelValueSeriesCount) Equal(that interface{}) bool { } return true } -func (this *ReadRequest) Equal(that interface{}) bool { +func (this *QueryRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*ReadRequest) + that1, ok := that.(*QueryRequest) if !ok { - that2, ok := that.(ReadRequest) + that2, ok := that.(QueryRequest) if ok { that1 = &that2 } else { @@ -2534,32 +2199,33 @@ func (this *ReadRequest) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Queries) != len(that1.Queries) { + if this.StartTimestampMs != that1.StartTimestampMs { return false } - for i := range this.Queries { - if !this.Queries[i].Equal(that1.Queries[i]) { - return false - } + if this.EndTimestampMs != that1.EndTimestampMs { + return false } - if len(this.AcceptedResponseTypes) != len(that1.AcceptedResponseTypes) { + if len(this.Matchers) != len(that1.Matchers) { return false } - for i := range this.AcceptedResponseTypes { - if this.AcceptedResponseTypes[i] != that1.AcceptedResponseTypes[i] { + for i := range this.Matchers { + if !this.Matchers[i].Equal(that1.Matchers[i]) { return false } } + if this.StreamingChunksBatchSize != that1.StreamingChunksBatchSize { + return false + } return true } -func (this *ReadResponse) Equal(that interface{}) bool { +func (this *ExemplarQueryRequest) Equal(that interface{}) bool { if that == nil { return this == nil } - that1, ok := that.(*ReadResponse) + that1, ok := that.(*ExemplarQueryRequest) if !ok { - that2, ok := that.(ReadResponse) + that2, ok := that.(ExemplarQueryRequest) if ok { that1 = &that2 } else { @@ -2571,180 +2237,11 @@ func (this *ReadResponse) Equal(that interface{}) bool { } else if this == nil { return false } - if len(this.Results) != len(that1.Results) { + if this.StartTimestampMs != that1.StartTimestampMs { return false } - for i := range this.Results { - if !this.Results[i].Equal(that1.Results[i]) { - return false - } - } - return true -} -func (this *StreamReadResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*StreamReadResponse) - if !ok { - that2, ok := that.(StreamReadResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.ChunkedSeries) != len(that1.ChunkedSeries) { - return false - } - for i := range this.ChunkedSeries { - if !this.ChunkedSeries[i].Equal(that1.ChunkedSeries[i]) { - return false - } - } - if this.QueryIndex != that1.QueryIndex { - return false - } - return true -} -func (this *StreamChunkedSeries) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*StreamChunkedSeries) - if !ok { - that2, ok := that.(StreamChunkedSeries) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Labels) != len(that1.Labels) { - return false - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return false - } - } - if len(this.Chunks) != len(that1.Chunks) { - return false - } - for i := range this.Chunks { - if !this.Chunks[i].Equal(&that1.Chunks[i]) { - return false - } - } - return true -} -func (this *StreamChunk) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*StreamChunk) - if !ok { - that2, ok := that.(StreamChunk) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.MinTimeMs != that1.MinTimeMs { - return false - } - if this.MaxTimeMs != that1.MaxTimeMs { - return false - } - if this.Type != that1.Type { - return false - } - if !this.Data.Equal(that1.Data) { - return false - } - return true -} -func (this *QueryRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryRequest) - if !ok { - that2, ok := that.(QueryRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.StartTimestampMs != that1.StartTimestampMs { - return false - } - if this.EndTimestampMs != that1.EndTimestampMs { - return false - } - if len(this.Matchers) != len(that1.Matchers) { - return false - } - for i := range this.Matchers { - if !this.Matchers[i].Equal(that1.Matchers[i]) { - return false - } - } - if this.StreamingChunksBatchSize != that1.StreamingChunksBatchSize { - return false - } - return true -} -func (this *ExemplarQueryRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ExemplarQueryRequest) - if !ok { - that2, ok := that.(ExemplarQueryRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.StartTimestampMs != that1.StartTimestampMs { - return false - } - if this.EndTimestampMs != that1.EndTimestampMs { - return false + if this.EndTimestampMs != that1.EndTimestampMs { + return false } if len(this.Matchers) != len(that1.Matchers) { return false @@ -3613,74 +3110,6 @@ func (this *LabelValueSeriesCount) GoString() string { s = append(s, "}") return strings.Join(s, "") } -func (this *ReadRequest) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&client.ReadRequest{") - if this.Queries != nil { - s = append(s, "Queries: "+fmt.Sprintf("%#v", this.Queries)+",\n") - } - s = append(s, "AcceptedResponseTypes: "+fmt.Sprintf("%#v", this.AcceptedResponseTypes)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ReadResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&client.ReadResponse{") - if this.Results != nil { - s = append(s, "Results: "+fmt.Sprintf("%#v", this.Results)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StreamReadResponse) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&client.StreamReadResponse{") - if this.ChunkedSeries != nil { - s = append(s, "ChunkedSeries: "+fmt.Sprintf("%#v", this.ChunkedSeries)+",\n") - } - s = append(s, "QueryIndex: "+fmt.Sprintf("%#v", this.QueryIndex)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StreamChunkedSeries) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&client.StreamChunkedSeries{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - if this.Chunks != nil { - vs := make([]*StreamChunk, len(this.Chunks)) - for i := range vs { - vs[i] = &this.Chunks[i] - } - s = append(s, "Chunks: "+fmt.Sprintf("%#v", vs)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *StreamChunk) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&client.StreamChunk{") - s = append(s, "MinTimeMs: "+fmt.Sprintf("%#v", this.MinTimeMs)+",\n") - s = append(s, "MaxTimeMs: "+fmt.Sprintf("%#v", this.MaxTimeMs)+",\n") - s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") - s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} func (this *QueryRequest) GoString() string { if this == nil { return "nil" @@ -4907,7 +4336,7 @@ func (m *LabelValueSeriesCount) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ReadRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4917,38 +4346,27 @@ func (m *ReadRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ReadRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ReadRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.AcceptedResponseTypes) > 0 { - dAtA2 := make([]byte, len(m.AcceptedResponseTypes)*10) - var j1 int - for _, num := range m.AcceptedResponseTypes { - for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA2[j1] = uint8(num) - j1++ - } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintIngester(dAtA, i, uint64(j1)) + if m.StreamingChunksBatchSize != 0 { + i = encodeVarintIngester(dAtA, i, uint64(m.StreamingChunksBatchSize)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x6 + i-- + dAtA[i] = 0xa0 } - if len(m.Queries) > 0 { - for iNdEx := len(m.Queries) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Matchers) > 0 { + for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Queries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -4956,13 +4374,23 @@ func (m *ReadRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintIngester(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x1a } } + if m.EndTimestampMs != 0 { + i = encodeVarintIngester(dAtA, i, uint64(m.EndTimestampMs)) + i-- + dAtA[i] = 0x10 + } + if m.StartTimestampMs != 0 { + i = encodeVarintIngester(dAtA, i, uint64(m.StartTimestampMs)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } -func (m *ReadResponse) Marshal() (dAtA []byte, err error) { +func (m *ExemplarQueryRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4972,20 +4400,20 @@ func (m *ReadResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ReadResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ExemplarQueryRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ReadResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ExemplarQueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Results) > 0 { - for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Matchers) > 0 { + for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -4993,13 +4421,23 @@ func (m *ReadResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintIngester(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x1a } } + if m.EndTimestampMs != 0 { + i = encodeVarintIngester(dAtA, i, uint64(m.EndTimestampMs)) + i-- + dAtA[i] = 0x10 + } + if m.StartTimestampMs != 0 { + i = encodeVarintIngester(dAtA, i, uint64(m.StartTimestampMs)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } -func (m *StreamReadResponse) Marshal() (dAtA []byte, err error) { +func (m *ActiveSeriesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5009,25 +4447,25 @@ func (m *StreamReadResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StreamReadResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ActiveSeriesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *StreamReadResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ActiveSeriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.QueryIndex != 0 { - i = encodeVarintIngester(dAtA, i, uint64(m.QueryIndex)) + if m.Type != 0 { + i = encodeVarintIngester(dAtA, i, uint64(m.Type)) i-- dAtA[i] = 0x10 } - if len(m.ChunkedSeries) > 0 { - for iNdEx := len(m.ChunkedSeries) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Matchers) > 0 { + for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.ChunkedSeries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5041,7 +4479,7 @@ func (m *StreamReadResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *StreamChunkedSeries) Marshal() (dAtA []byte, err error) { +func (m *QueryResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5051,254 +4489,12 @@ func (m *StreamChunkedSeries) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StreamChunkedSeries) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *StreamChunkedSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Chunks) > 0 { - for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Chunks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintIngester(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintIngester(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *StreamChunk) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StreamChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StreamChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Data.Size() - i -= size - if _, err := m.Data.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintIngester(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Type != 0 { - i = encodeVarintIngester(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x18 - } - if m.MaxTimeMs != 0 { - i = encodeVarintIngester(dAtA, i, uint64(m.MaxTimeMs)) - i-- - dAtA[i] = 0x10 - } - if m.MinTimeMs != 0 { - i = encodeVarintIngester(dAtA, i, uint64(m.MinTimeMs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.StreamingChunksBatchSize != 0 { - i = encodeVarintIngester(dAtA, i, uint64(m.StreamingChunksBatchSize)) - i-- - dAtA[i] = 0x6 - i-- - dAtA[i] = 0xa0 - } - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintIngester(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.EndTimestampMs != 0 { - i = encodeVarintIngester(dAtA, i, uint64(m.EndTimestampMs)) - i-- - dAtA[i] = 0x10 - } - if m.StartTimestampMs != 0 { - i = encodeVarintIngester(dAtA, i, uint64(m.StartTimestampMs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ExemplarQueryRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ExemplarQueryRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ExemplarQueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintIngester(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.EndTimestampMs != 0 { - i = encodeVarintIngester(dAtA, i, uint64(m.EndTimestampMs)) - i-- - dAtA[i] = 0x10 - } - if m.StartTimestampMs != 0 { - i = encodeVarintIngester(dAtA, i, uint64(m.StartTimestampMs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ActiveSeriesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ActiveSeriesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ActiveSeriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Type != 0 { - i = encodeVarintIngester(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x10 - } - if len(m.Matchers) > 0 { - for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Matchers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintIngester(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -6026,20 +5222,20 @@ func (m *ActiveSeriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.BucketCount) > 0 { - dAtA7 := make([]byte, len(m.BucketCount)*10) - var j6 int + dAtA5 := make([]byte, len(m.BucketCount)*10) + var j4 int for _, num := range m.BucketCount { for num >= 1<<7 { - dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80) + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j6++ + j4++ } - dAtA7[j6] = uint8(num) - j6++ + dAtA5[j4] = uint8(num) + j4++ } - i -= j6 - copy(dAtA[i:], dAtA7[:j6]) - i = encodeVarintIngester(dAtA, i, uint64(j6)) + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintIngester(dAtA, i, uint64(j4)) i-- dAtA[i] = 0x12 } @@ -6426,134 +5622,38 @@ func (m *LabelValueSeriesCount) Size() (n int) { return n } -func (m *ReadRequest) Size() (n int) { +func (m *QueryRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Queries) > 0 { - for _, e := range m.Queries { + if m.StartTimestampMs != 0 { + n += 1 + sovIngester(uint64(m.StartTimestampMs)) + } + if m.EndTimestampMs != 0 { + n += 1 + sovIngester(uint64(m.EndTimestampMs)) + } + if len(m.Matchers) > 0 { + for _, e := range m.Matchers { l = e.Size() n += 1 + l + sovIngester(uint64(l)) } } - if len(m.AcceptedResponseTypes) > 0 { - l = 0 - for _, e := range m.AcceptedResponseTypes { - l += sovIngester(uint64(e)) - } - n += 1 + sovIngester(uint64(l)) + l + if m.StreamingChunksBatchSize != 0 { + n += 2 + sovIngester(uint64(m.StreamingChunksBatchSize)) } return n } -func (m *ReadResponse) Size() (n int) { +func (m *ExemplarQueryRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Results) > 0 { - for _, e := range m.Results { - l = e.Size() - n += 1 + l + sovIngester(uint64(l)) - } - } - return n -} - -func (m *StreamReadResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ChunkedSeries) > 0 { - for _, e := range m.ChunkedSeries { - l = e.Size() - n += 1 + l + sovIngester(uint64(l)) - } - } - if m.QueryIndex != 0 { - n += 1 + sovIngester(uint64(m.QueryIndex)) - } - return n -} - -func (m *StreamChunkedSeries) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovIngester(uint64(l)) - } - } - if len(m.Chunks) > 0 { - for _, e := range m.Chunks { - l = e.Size() - n += 1 + l + sovIngester(uint64(l)) - } - } - return n -} - -func (m *StreamChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MinTimeMs != 0 { - n += 1 + sovIngester(uint64(m.MinTimeMs)) - } - if m.MaxTimeMs != 0 { - n += 1 + sovIngester(uint64(m.MaxTimeMs)) - } - if m.Type != 0 { - n += 1 + sovIngester(uint64(m.Type)) - } - l = m.Data.Size() - n += 1 + l + sovIngester(uint64(l)) - return n -} - -func (m *QueryRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StartTimestampMs != 0 { - n += 1 + sovIngester(uint64(m.StartTimestampMs)) - } - if m.EndTimestampMs != 0 { - n += 1 + sovIngester(uint64(m.EndTimestampMs)) - } - if len(m.Matchers) > 0 { - for _, e := range m.Matchers { - l = e.Size() - n += 1 + l + sovIngester(uint64(l)) - } - } - if m.StreamingChunksBatchSize != 0 { - n += 2 + sovIngester(uint64(m.StreamingChunksBatchSize)) - } - return n -} - -func (m *ExemplarQueryRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StartTimestampMs != 0 { - n += 1 + sovIngester(uint64(m.StartTimestampMs)) + if m.StartTimestampMs != 0 { + n += 1 + sovIngester(uint64(m.StartTimestampMs)) } if m.EndTimestampMs != 0 { n += 1 + sovIngester(uint64(m.EndTimestampMs)) @@ -7126,82 +6226,6 @@ func (this *LabelValueSeriesCount) String() string { }, "") return s } -func (this *ReadRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForQueries := "[]*QueryRequest{" - for _, f := range this.Queries { - repeatedStringForQueries += strings.Replace(f.String(), "QueryRequest", "QueryRequest", 1) + "," - } - repeatedStringForQueries += "}" - s := strings.Join([]string{`&ReadRequest{`, - `Queries:` + repeatedStringForQueries + `,`, - `AcceptedResponseTypes:` + fmt.Sprintf("%v", this.AcceptedResponseTypes) + `,`, - `}`, - }, "") - return s -} -func (this *ReadResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForResults := "[]*QueryResponse{" - for _, f := range this.Results { - repeatedStringForResults += strings.Replace(f.String(), "QueryResponse", "QueryResponse", 1) + "," - } - repeatedStringForResults += "}" - s := strings.Join([]string{`&ReadResponse{`, - `Results:` + repeatedStringForResults + `,`, - `}`, - }, "") - return s -} -func (this *StreamReadResponse) String() string { - if this == nil { - return "nil" - } - repeatedStringForChunkedSeries := "[]*StreamChunkedSeries{" - for _, f := range this.ChunkedSeries { - repeatedStringForChunkedSeries += strings.Replace(f.String(), "StreamChunkedSeries", "StreamChunkedSeries", 1) + "," - } - repeatedStringForChunkedSeries += "}" - s := strings.Join([]string{`&StreamReadResponse{`, - `ChunkedSeries:` + repeatedStringForChunkedSeries + `,`, - `QueryIndex:` + fmt.Sprintf("%v", this.QueryIndex) + `,`, - `}`, - }, "") - return s -} -func (this *StreamChunkedSeries) String() string { - if this == nil { - return "nil" - } - repeatedStringForChunks := "[]StreamChunk{" - for _, f := range this.Chunks { - repeatedStringForChunks += strings.Replace(strings.Replace(f.String(), "StreamChunk", "StreamChunk", 1), `&`, ``, 1) + "," - } - repeatedStringForChunks += "}" - s := strings.Join([]string{`&StreamChunkedSeries{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, - `Chunks:` + repeatedStringForChunks + `,`, - `}`, - }, "") - return s -} -func (this *StreamChunk) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StreamChunk{`, - `MinTimeMs:` + fmt.Sprintf("%v", this.MinTimeMs) + `,`, - `MaxTimeMs:` + fmt.Sprintf("%v", this.MaxTimeMs) + `,`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `}`, - }, "") - return s -} func (this *QueryRequest) String() string { if this == nil { return "nil" @@ -8325,619 +7349,6 @@ func (m *LabelValueSeriesCount) Unmarshal(dAtA []byte) error { } return nil } -func (m *ReadRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ReadRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReadRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Queries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthIngester - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthIngester - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Queries = append(m.Queries, &QueryRequest{}) - if err := m.Queries[len(m.Queries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType == 0 { - var v ReadRequest_ResponseType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= ReadRequest_ResponseType(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AcceptedResponseTypes = append(m.AcceptedResponseTypes, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthIngester - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthIngester - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - if elementCount != 0 && len(m.AcceptedResponseTypes) == 0 { - m.AcceptedResponseTypes = make([]ReadRequest_ResponseType, 0, elementCount) - } - for iNdEx < postIndex { - var v ReadRequest_ResponseType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= ReadRequest_ResponseType(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AcceptedResponseTypes = append(m.AcceptedResponseTypes, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field AcceptedResponseTypes", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipIngester(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthIngester - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthIngester - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ReadResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ReadResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReadResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthIngester - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthIngester - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Results = append(m.Results, &QueryResponse{}) - if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipIngester(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthIngester - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthIngester - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StreamReadResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StreamReadResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StreamReadResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunkedSeries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthIngester - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthIngester - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChunkedSeries = append(m.ChunkedSeries, &StreamChunkedSeries{}) - if err := m.ChunkedSeries[len(m.ChunkedSeries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryIndex", wireType) - } - m.QueryIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.QueryIndex |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipIngester(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthIngester - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthIngester - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StreamChunkedSeries) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StreamChunkedSeries: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StreamChunkedSeries: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthIngester - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthIngester - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb.LabelAdapter{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthIngester - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthIngester - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chunks = append(m.Chunks, StreamChunk{}) - if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipIngester(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthIngester - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthIngester - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StreamChunk) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StreamChunk: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StreamChunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTimeMs", wireType) - } - m.MinTimeMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinTimeMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTimeMs", wireType) - } - m.MaxTimeMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTimeMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= StreamChunk_Encoding(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowIngester - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthIngester - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthIngester - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipIngester(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthIngester - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthIngester - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *QueryRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/pkg/ingester/client/ingester.proto b/pkg/ingester/client/ingester.proto index 3cfc24e2d3..4640145ec4 100644 --- a/pkg/ingester/client/ingester.proto +++ b/pkg/ingester/client/ingester.proto @@ -76,50 +76,7 @@ message LabelValueSeriesCount { map label_value_series = 2; } -message ReadRequest { - repeated QueryRequest queries = 1; - - enum ResponseType { - SAMPLES = 0; - STREAMED_XOR_CHUNKS = 1; - } - repeated ResponseType accepted_response_types = 2; -} - -message ReadResponse { - repeated QueryResponse results = 1; -} - -message StreamReadResponse { - repeated StreamChunkedSeries chunked_series = 1; - - int64 query_index = 2; -} - -message StreamChunkedSeries { - repeated cortexpb.LabelPair labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb.LabelAdapter"]; - repeated StreamChunk chunks = 2 [(gogoproto.nullable) = false]; -} - -message StreamChunk { - int64 min_time_ms = 1; - int64 max_time_ms = 2; - - enum Encoding { - UNKNOWN = 0; - XOR = 1; - HISTOGRAM = 2; - FLOAT_HISTOGRAM = 3; - } - Encoding type = 3; - bytes data = 4 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb.UnsafeByteSlice"]; -} - message QueryRequest { - // This QueryRequest message is also used for remote read requests, which includes a hints field we don't support. - reserved 4; - reserved "hints"; - int64 start_timestamp_ms = 1; int64 end_timestamp_ms = 2; repeated LabelMatcher matchers = 3; diff --git a/pkg/querier/remote_read.go b/pkg/querier/remote_read.go index fbb1a4d9d3..b65aa9ccaf 100644 --- a/pkg/querier/remote_read.go +++ b/pkg/querier/remote_read.go @@ -15,14 +15,15 @@ import ( "github.com/go-kit/log/level" "github.com/gogo/protobuf/proto" "github.com/pkg/errors" + "github.com/prometheus/common/model" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/storage" prom_remote "github.com/prometheus/prometheus/storage/remote" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" - "github.com/grafana/mimir/pkg/ingester/client" - "github.com/grafana/mimir/pkg/mimirpb" "github.com/grafana/mimir/pkg/querier/api" "github.com/grafana/mimir/pkg/util" util_log "github.com/grafana/mimir/pkg/util/log" @@ -49,7 +50,7 @@ func RemoteReadHandler(q storage.SampleAndChunkQueryable, logger log.Logger) htt func remoteReadHandler(q storage.SampleAndChunkQueryable, maxBytesInFrame int, lg log.Logger) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - var req client.ReadRequest + var req prompb.ReadRequest logger := util_log.WithContext(r.Context(), lg) if _, err := util.ParseProtoReader(ctx, r.Body, int(r.ContentLength), MaxRemoteReadQuerySize, nil, &req, util.RawSnappy); err != nil { level.Error(logger).Log("msg", "failed to parse proto", "err", err.Error()) @@ -64,7 +65,7 @@ func remoteReadHandler(q storage.SampleAndChunkQueryable, maxBytesInFrame int, l } switch respType { - case client.STREAMED_XOR_CHUNKS: + case prompb.ReadRequest_STREAMED_XOR_CHUNKS: remoteReadStreamedXORChunks(ctx, q, w, &req, maxBytesInFrame, logger) default: remoteReadSamples(ctx, q, w, &req, logger) @@ -76,18 +77,18 @@ func remoteReadSamples( ctx context.Context, q storage.Queryable, w http.ResponseWriter, - req *client.ReadRequest, + req *prompb.ReadRequest, logger log.Logger, ) { - resp := client.ReadResponse{ - Results: make([]*client.QueryResponse, len(req.Queries)), + resp := prompb.ReadResponse{ + Results: make([]*prompb.QueryResult, len(req.Queries)), } // Fetch samples for all queries in parallel. errCh := make(chan error) for i, qr := range req.Queries { - go func(i int, qr *client.QueryRequest) { - from, to, matchers, err := client.FromQueryRequest(qr) + go func(i int, qr *prompb.Query) { + from, to, matchers, err := queryFromRemoteReadQuery(qr) if err != nil { errCh <- err return @@ -104,7 +105,7 @@ func remoteReadSamples( End: int64(to), } seriesSet := querier.Select(ctx, false, params, matchers...) - resp.Results[i], err = seriesSetToQueryResponse(seriesSet) + resp.Results[i], err = seriesSetToQueryResult(seriesSet) errCh <- err }(i, qr) } @@ -136,7 +137,7 @@ func remoteReadStreamedXORChunks( ctx context.Context, q storage.ChunkQueryable, w http.ResponseWriter, - req *client.ReadRequest, + req *prompb.ReadRequest, maxBytesInFrame int, logger log.Logger, ) { @@ -178,13 +179,13 @@ func remoteReadErrorStatusCode(err error) int { func processReadStreamedQueryRequest( ctx context.Context, idx int, - queryReq *client.QueryRequest, + queryReq *prompb.Query, q storage.ChunkQueryable, w http.ResponseWriter, f http.Flusher, maxBytesInFrame int, ) error { - from, to, matchers, err := client.FromQueryRequest(queryReq) + from, to, matchers, err := queryFromRemoteReadQuery(queryReq) if err != nil { return err } @@ -208,29 +209,29 @@ func processReadStreamedQueryRequest( ) } -func seriesSetToQueryResponse(s storage.SeriesSet) (*client.QueryResponse, error) { - result := &client.QueryResponse{} +func seriesSetToQueryResult(s storage.SeriesSet) (*prompb.QueryResult, error) { + result := &prompb.QueryResult{} var it chunkenc.Iterator for s.Next() { series := s.At() - samples := []mimirpb.Sample{} - histograms := []mimirpb.Histogram{} + samples := []prompb.Sample{} + histograms := []prompb.Histogram{} it = series.Iterator(it) for valType := it.Next(); valType != chunkenc.ValNone; valType = it.Next() { switch valType { case chunkenc.ValFloat: t, v := it.At() - samples = append(samples, mimirpb.Sample{ - TimestampMs: t, - Value: v, + samples = append(samples, prompb.Sample{ + Timestamp: t, + Value: v, }) case chunkenc.ValHistogram: t, h := it.AtHistogram(nil) // Nil argument as we pass the data to the protobuf as-is without copy. - histograms = append(histograms, mimirpb.FromHistogramToHistogramProto(t, h)) + histograms = append(histograms, prom_remote.HistogramToHistogramProto(t, h)) case chunkenc.ValFloatHistogram: t, h := it.AtFloatHistogram(nil) // Nil argument as we pass the data to the protobuf as-is without copy. - histograms = append(histograms, mimirpb.FromFloatHistogramToHistogramProto(t, h)) + histograms = append(histograms, prom_remote.FloatHistogramToHistogramProto(t, h)) default: return nil, fmt.Errorf("unsupported value type: %v", valType) } @@ -240,8 +241,8 @@ func seriesSetToQueryResponse(s storage.SeriesSet) (*client.QueryResponse, error return nil, err } - ts := mimirpb.TimeSeries{ - Labels: mimirpb.FromLabelsToLabelAdapters(series.Labels()), + ts := &prompb.TimeSeries{ + Labels: prom_remote.LabelsToLabelsProto(series.Labels(), nil), Samples: samples, Histograms: histograms, } @@ -252,14 +253,14 @@ func seriesSetToQueryResponse(s storage.SeriesSet) (*client.QueryResponse, error return result, s.Err() } -func negotiateResponseType(accepted []client.ReadRequest_ResponseType) (client.ReadRequest_ResponseType, error) { +func negotiateResponseType(accepted []prompb.ReadRequest_ResponseType) (prompb.ReadRequest_ResponseType, error) { if len(accepted) == 0 { - return client.SAMPLES, nil + return prompb.ReadRequest_SAMPLES, nil } - supported := map[client.ReadRequest_ResponseType]struct{}{ - client.SAMPLES: {}, - client.STREAMED_XOR_CHUNKS: {}, + supported := map[prompb.ReadRequest_ResponseType]struct{}{ + prompb.ReadRequest_SAMPLES: {}, + prompb.ReadRequest_STREAMED_XOR_CHUNKS: {}, } for _, resType := range accepted { @@ -272,15 +273,15 @@ func negotiateResponseType(accepted []client.ReadRequest_ResponseType) (client.R func streamChunkedReadResponses(stream io.Writer, ss storage.ChunkSeriesSet, queryIndex, maxBytesInFrame int) error { var ( - chks []client.StreamChunk - lbls []mimirpb.LabelAdapter + chks []prompb.Chunk + lbls []prompb.Label ) var iter chunks.Iterator for ss.Next() { series := ss.At() iter = series.Iterator(iter) - lbls = mimirpb.FromLabelsToLabelAdapters(series.Labels()) + lbls = prom_remote.LabelsToLabelsProto(series.Labels(), nil) frameBytesRemaining := initializedFrameBytesRemaining(maxBytesInFrame, lbls) isNext := iter.Next() @@ -293,10 +294,10 @@ func streamChunkedReadResponses(stream io.Writer, ss storage.ChunkSeriesSet, que } // Cut the chunk. - chks = append(chks, client.StreamChunk{ + chks = append(chks, prompb.Chunk{ MinTimeMs: chk.MinTime, MaxTimeMs: chk.MaxTime, - Type: client.StreamChunk_Encoding(chk.Chunk.Encoding()), + Type: prompb.Chunk_Encoding(chk.Chunk.Encoding()), Data: chk.Chunk.Bytes(), }) frameBytesRemaining -= chks[len(chks)-1].Size() @@ -307,8 +308,8 @@ func streamChunkedReadResponses(stream io.Writer, ss storage.ChunkSeriesSet, que continue } - b, err := proto.Marshal(&client.StreamReadResponse{ - ChunkedSeries: []*client.StreamChunkedSeries{ + b, err := proto.Marshal(&prompb.ChunkedReadResponse{ + ChunkedSeries: []*prompb.ChunkedSeries{ { Labels: lbls, Chunks: chks, @@ -333,10 +334,22 @@ func streamChunkedReadResponses(stream io.Writer, ss storage.ChunkSeriesSet, que return ss.Err() } -func initializedFrameBytesRemaining(maxBytesInFrame int, lbls []mimirpb.LabelAdapter) int { +func initializedFrameBytesRemaining(maxBytesInFrame int, lbls []prompb.Label) int { frameBytesLeft := maxBytesInFrame for _, lbl := range lbls { frameBytesLeft -= lbl.Size() } return frameBytesLeft } + +// queryFromRemoteReadQuery returns the queried time range and label matchers for the given remote +// read request query. +func queryFromRemoteReadQuery(query *prompb.Query) (from, to model.Time, matchers []*labels.Matcher, err error) { + matchers, err = prom_remote.FromLabelMatchers(query.Matchers) + if err != nil { + return + } + from = model.Time(query.StartTimestampMs) + to = model.Time(query.EndTimestampMs) + return +} diff --git a/pkg/querier/remote_read_test.go b/pkg/querier/remote_read_test.go index 1f071f6161..1d0b806d5d 100644 --- a/pkg/querier/remote_read_test.go +++ b/pkg/querier/remote_read_test.go @@ -20,6 +20,7 @@ import ( "github.com/pkg/errors" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/storage" prom_remote "github.com/prometheus/prometheus/storage/remote" @@ -27,7 +28,6 @@ import ( "github.com/prometheus/prometheus/util/annotations" "github.com/stretchr/testify/require" - "github.com/grafana/mimir/pkg/ingester/client" "github.com/grafana/mimir/pkg/mimirpb" "github.com/grafana/mimir/pkg/querier/api" "github.com/grafana/mimir/pkg/storage/series" @@ -49,26 +49,30 @@ func (m mockSampleAndChunkQueryable) ChunkQuerier(mint, maxt int64) (storage.Chu type mockQuerier struct { storage.Querier - seriesSet storage.SeriesSet + + selectFn func(ctx context.Context, sorted bool, hints *storage.SelectHints, matchers ...*labels.Matcher) storage.SeriesSet } -func (m mockQuerier) Select(_ context.Context, _ bool, sp *storage.SelectHints, _ ...*labels.Matcher) storage.SeriesSet { - if sp == nil { - panic("mockQuerier: select params must be set") +func (m mockQuerier) Select(ctx context.Context, sorted bool, hints *storage.SelectHints, matchers ...*labels.Matcher) storage.SeriesSet { + if m.selectFn != nil { + return m.selectFn(ctx, sorted, hints, matchers...) } - return m.seriesSet + + return storage.ErrSeriesSet(errors.New("the Select() function has not been mocked in the test")) } type mockChunkQuerier struct { storage.ChunkQuerier - seriesSet storage.SeriesSet + + selectFn func(ctx context.Context, sorted bool, hints *storage.SelectHints, matchers ...*labels.Matcher) storage.ChunkSeriesSet } -func (m mockChunkQuerier) Select(_ context.Context, _ bool, sp *storage.SelectHints, _ ...*labels.Matcher) storage.ChunkSeriesSet { - if sp == nil { - panic("mockChunkQuerier: select params must be set") +func (m mockChunkQuerier) Select(ctx context.Context, sorted bool, hints *storage.SelectHints, matchers ...*labels.Matcher) storage.ChunkSeriesSet { + if m.selectFn != nil { + return m.selectFn(ctx, sorted, hints, matchers...) } - return storage.NewSeriesSetToChunkSet(m.seriesSet) + + return storage.ErrChunkSeriesSet(errors.New("the Select() function has not been mocked in the test")) } type partiallyFailingSeriesSet struct { @@ -100,89 +104,126 @@ func (p *partiallyFailingSeriesSet) Warnings() annotations.Annotations { return p.ss.Warnings() } -func TestSampledRemoteRead(t *testing.T) { - q := &mockSampleAndChunkQueryable{ - queryableFn: func(int64, int64) (storage.Querier, error) { - return mockQuerier{ - seriesSet: series.NewConcreteSeriesSetFromUnsortedSeries([]storage.Series{ - series.NewConcreteSeries( - labels.FromStrings("foo", "bar"), - []model.SamplePair{{Timestamp: 0, Value: 0}, {Timestamp: 1, Value: 1}, {Timestamp: 2, Value: 2}, {Timestamp: 3, Value: 3}}, - []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(4, test.GenerateTestHistogram(4))}, - ), - }), - }, nil +func TestRemoteReadHandler_Samples(t *testing.T) { + queries := map[string]struct { + query *prompb.Query + expectedQueriedStart int64 + expectedQueriedEnd int64 + }{ + "query without hints": { + query: &prompb.Query{ + StartTimestampMs: 1, + EndTimestampMs: 10, + }, + expectedQueriedStart: 1, + expectedQueriedEnd: 10, + }, + "query with hints": { + query: &prompb.Query{ + StartTimestampMs: 1, + EndTimestampMs: 10, + Hints: &prompb.ReadHints{ + StartMs: 2, + EndMs: 9, + }, + }, + expectedQueriedStart: 1, // Hints are currently ignored. + expectedQueriedEnd: 10, // Hints are currently ignored. }, } - handler := RemoteReadHandler(q, log.NewNopLogger()) - requestBody, err := proto.Marshal(&client.ReadRequest{ - Queries: []*client.QueryRequest{ - {StartTimestampMs: 0, EndTimestampMs: 10}, - }, - }) - require.NoError(t, err) - requestBody = snappy.Encode(nil, requestBody) - request, err := http.NewRequest(http.MethodPost, "/api/v1/read", bytes.NewReader(requestBody)) - require.NoError(t, err) - request.Header.Set("X-Prometheus-Remote-Read-Version", "0.1.0") - - recorder := httptest.NewRecorder() - handler.ServeHTTP(recorder, request) - - require.Equal(t, 200, recorder.Result().StatusCode) - require.Equal(t, []string([]string{"application/x-protobuf"}), recorder.Result().Header["Content-Type"]) - responseBody, err := io.ReadAll(recorder.Result().Body) - require.NoError(t, err) - responseBody, err = snappy.Decode(nil, responseBody) - require.NoError(t, err) - var response client.ReadResponse - err = proto.Unmarshal(responseBody, &response) - require.NoError(t, err) - - expected := client.ReadResponse{ - Results: []*client.QueryResponse{ - { - Timeseries: []mimirpb.TimeSeries{ - { - Labels: []mimirpb.LabelAdapter{ - {Name: "foo", Value: "bar"}, - }, - Samples: []mimirpb.Sample{ - {Value: 0, TimestampMs: 0}, - {Value: 1, TimestampMs: 1}, - {Value: 2, TimestampMs: 2}, - {Value: 3, TimestampMs: 3}, + for queryType, queryData := range queries { + t.Run(queryType, func(t *testing.T) { + var actualQueriedStart, actualQueriedEnd int64 + + q := &mockSampleAndChunkQueryable{ + queryableFn: func(_, _ int64) (storage.Querier, error) { + return mockQuerier{ + selectFn: func(_ context.Context, _ bool, hints *storage.SelectHints, _ ...*labels.Matcher) storage.SeriesSet { + require.NotNil(t, hints, "select hints must be set") + actualQueriedStart, actualQueriedEnd = hints.Start, hints.End + + return series.NewConcreteSeriesSetFromUnsortedSeries([]storage.Series{ + series.NewConcreteSeries( + labels.FromStrings("foo", "bar"), + []model.SamplePair{{Timestamp: 1, Value: 1}, {Timestamp: 2, Value: 2}, {Timestamp: 3, Value: 3}}, + []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(4, test.GenerateTestHistogram(4))}, + ), + }) }, - Histograms: []mimirpb.Histogram{ - mimirpb.FromHistogramToHistogramProto(4, test.GenerateTestHistogram(4)), + }, nil + }, + } + handler := RemoteReadHandler(q, log.NewNopLogger()) + + requestBody, err := proto.Marshal(&prompb.ReadRequest{Queries: []*prompb.Query{queryData.query}}) + require.NoError(t, err) + requestBody = snappy.Encode(nil, requestBody) + request, err := http.NewRequest(http.MethodPost, "/api/v1/read", bytes.NewReader(requestBody)) + require.NoError(t, err) + request.Header.Set("X-Prometheus-Remote-Read-Version", "0.1.0") + + recorder := httptest.NewRecorder() + handler.ServeHTTP(recorder, request) + + require.Equal(t, 200, recorder.Result().StatusCode) + require.Equal(t, []string{"application/x-protobuf"}, recorder.Result().Header["Content-Type"]) + responseBody, err := io.ReadAll(recorder.Result().Body) + require.NoError(t, err) + responseBody, err = snappy.Decode(nil, responseBody) + require.NoError(t, err) + var response prompb.ReadResponse + err = proto.Unmarshal(responseBody, &response) + require.NoError(t, err) + + expected := prompb.ReadResponse{ + Results: []*prompb.QueryResult{ + { + Timeseries: []*prompb.TimeSeries{ + { + Labels: []prompb.Label{ + {Name: "foo", Value: "bar"}, + }, + Samples: []prompb.Sample{ + {Value: 1, Timestamp: 1}, + {Value: 2, Timestamp: 2}, + {Value: 3, Timestamp: 3}, + }, + Histograms: []prompb.Histogram{ + prom_remote.HistogramToHistogramProto(4, test.GenerateTestHistogram(4)), + }, + }, }, }, }, - }, - }, + } + require.Equal(t, expected, response) + + // Ensure the time range passed down to the queryable is the expected one. + require.Equal(t, queryData.expectedQueriedStart, actualQueriedStart) + require.Equal(t, queryData.expectedQueriedEnd, actualQueriedEnd) + }) } - require.Equal(t, expected, response) } -func TestStreamedRemoteRead(t *testing.T) { - tcs := map[string]struct { +func TestRemoteReadHandler_StreamedXORChunks(t *testing.T) { + tests := map[string]struct { samples []model.SamplePair histograms []mimirpb.Histogram - expectedResults []*client.StreamReadResponse + expectedResults []*prompb.ChunkedReadResponse }{ "with 120 samples, we expect 1 frame with 1 chunk": { samples: getNSamples(120), - expectedResults: []*client.StreamReadResponse{ + expectedResults: []*prompb.ChunkedReadResponse{ { - ChunkedSeries: []*client.StreamChunkedSeries{ + ChunkedSeries: []*prompb.ChunkedSeries{ { - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, - Chunks: []client.StreamChunk{ + Labels: []prompb.Label{{Name: "foo", Value: "bar"}}, + Chunks: []prompb.Chunk{ { MinTimeMs: 0, MaxTimeMs: 119, - Type: client.XOR, + Type: prompb.Chunk_XOR, Data: getIndexedChunk(0, 120, chunkenc.EncXOR), }, }, @@ -194,22 +235,22 @@ func TestStreamedRemoteRead(t *testing.T) { }, "with 121 samples, we expect 1 frame with 2 chunks": { samples: getNSamples(121), - expectedResults: []*client.StreamReadResponse{ + expectedResults: []*prompb.ChunkedReadResponse{ { - ChunkedSeries: []*client.StreamChunkedSeries{ + ChunkedSeries: []*prompb.ChunkedSeries{ { - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, - Chunks: []client.StreamChunk{ + Labels: []prompb.Label{{Name: "foo", Value: "bar"}}, + Chunks: []prompb.Chunk{ { MinTimeMs: 0, MaxTimeMs: 119, - Type: client.XOR, + Type: prompb.Chunk_XOR, Data: getIndexedChunk(0, 121, chunkenc.EncXOR), }, { MinTimeMs: 120, MaxTimeMs: 120, - Type: client.XOR, + Type: prompb.Chunk_XOR, Data: getIndexedChunk(1, 121, chunkenc.EncXOR), }, }, @@ -221,22 +262,22 @@ func TestStreamedRemoteRead(t *testing.T) { }, "with 481 samples, we expect 2 frames with 2 chunks, and 1 frame with 1 chunk due to frame limit": { samples: getNSamples(481), - expectedResults: []*client.StreamReadResponse{ + expectedResults: []*prompb.ChunkedReadResponse{ { - ChunkedSeries: []*client.StreamChunkedSeries{ + ChunkedSeries: []*prompb.ChunkedSeries{ { - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, - Chunks: []client.StreamChunk{ + Labels: []prompb.Label{{Name: "foo", Value: "bar"}}, + Chunks: []prompb.Chunk{ { MinTimeMs: 0, MaxTimeMs: 119, - Type: client.XOR, + Type: prompb.Chunk_XOR, Data: getIndexedChunk(0, 481, chunkenc.EncXOR), }, { MinTimeMs: 120, MaxTimeMs: 239, - Type: client.XOR, + Type: prompb.Chunk_XOR, Data: getIndexedChunk(1, 481, chunkenc.EncXOR), }, }, @@ -244,20 +285,20 @@ func TestStreamedRemoteRead(t *testing.T) { }, }, { - ChunkedSeries: []*client.StreamChunkedSeries{ + ChunkedSeries: []*prompb.ChunkedSeries{ { - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, - Chunks: []client.StreamChunk{ + Labels: []prompb.Label{{Name: "foo", Value: "bar"}}, + Chunks: []prompb.Chunk{ { MinTimeMs: 240, MaxTimeMs: 359, - Type: client.XOR, + Type: prompb.Chunk_XOR, Data: getIndexedChunk(2, 481, chunkenc.EncXOR), }, { MinTimeMs: 360, MaxTimeMs: 479, - Type: client.XOR, + Type: prompb.Chunk_XOR, Data: getIndexedChunk(3, 481, chunkenc.EncXOR), }, }, @@ -265,14 +306,14 @@ func TestStreamedRemoteRead(t *testing.T) { }, }, { - ChunkedSeries: []*client.StreamChunkedSeries{ + ChunkedSeries: []*prompb.ChunkedSeries{ { - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, - Chunks: []client.StreamChunk{ + Labels: []prompb.Label{{Name: "foo", Value: "bar"}}, + Chunks: []prompb.Chunk{ { MinTimeMs: 480, MaxTimeMs: 480, - Type: client.XOR, + Type: prompb.Chunk_XOR, Data: getIndexedChunk(4, 481, chunkenc.EncXOR), }, }, @@ -283,16 +324,16 @@ func TestStreamedRemoteRead(t *testing.T) { }, "120 native histograms": { histograms: getNHistogramSamples(120), - expectedResults: []*client.StreamReadResponse{ + expectedResults: []*prompb.ChunkedReadResponse{ { - ChunkedSeries: []*client.StreamChunkedSeries{ + ChunkedSeries: []*prompb.ChunkedSeries{ { - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, - Chunks: []client.StreamChunk{ + Labels: []prompb.Label{{Name: "foo", Value: "bar"}}, + Chunks: []prompb.Chunk{ { MinTimeMs: 0, MaxTimeMs: 119, - Type: client.HISTOGRAM, + Type: prompb.Chunk_HISTOGRAM, Data: getIndexedChunk(0, 120, chunkenc.EncHistogram), }, }, @@ -304,16 +345,16 @@ func TestStreamedRemoteRead(t *testing.T) { }, "120 native float histograms": { histograms: getNFloatHistogramSamples(120), - expectedResults: []*client.StreamReadResponse{ + expectedResults: []*prompb.ChunkedReadResponse{ { - ChunkedSeries: []*client.StreamChunkedSeries{ + ChunkedSeries: []*prompb.ChunkedSeries{ { - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, - Chunks: []client.StreamChunk{ + Labels: []prompb.Label{{Name: "foo", Value: "bar"}}, + Chunks: []prompb.Chunk{ { MinTimeMs: 0, MaxTimeMs: 119, - Type: client.FLOAT_HISTOGRAM, + Type: prompb.Chunk_FLOAT_HISTOGRAM, Data: getIndexedChunk(0, 120, chunkenc.EncFloatHistogram), }, }, @@ -323,63 +364,106 @@ func TestStreamedRemoteRead(t *testing.T) { }, }, } - for tn, tc := range tcs { - t.Run(tn, func(t *testing.T) { - q := &mockSampleAndChunkQueryable{ - chunkQueryableFn: func(int64, int64) (storage.ChunkQuerier, error) { - return mockChunkQuerier{ - seriesSet: series.NewConcreteSeriesSetFromUnsortedSeries([]storage.Series{ - series.NewConcreteSeries( - labels.FromStrings("foo", "bar"), - tc.samples, - tc.histograms, - ), - }), - }, nil - }, - } - // The labelset for this test has 10 bytes and a full chunk is roughly 165 bytes; for this test we want a - // frame to contain at most 2 chunks. - maxBytesInFrame := 10 + 165*2 - - handler := remoteReadHandler(q, maxBytesInFrame, log.NewNopLogger()) - requestBody, err := proto.Marshal(&client.ReadRequest{ - Queries: []*client.QueryRequest{ - {StartTimestampMs: 0, EndTimestampMs: 10}, + queries := map[string]struct { + query *prompb.Query + expectedQueriedStart int64 + expectedQueriedEnd int64 + }{ + "query without hints": { + query: &prompb.Query{ + StartTimestampMs: 1, + EndTimestampMs: 10, + }, + expectedQueriedStart: 1, + expectedQueriedEnd: 10, + }, + "query with hints": { + query: &prompb.Query{ + StartTimestampMs: 1, + EndTimestampMs: 10, + Hints: &prompb.ReadHints{ + StartMs: 2, + EndMs: 9, }, - AcceptedResponseTypes: []client.ReadRequest_ResponseType{client.STREAMED_XOR_CHUNKS}, - }) - require.NoError(t, err) - requestBody = snappy.Encode(nil, requestBody) - request, err := http.NewRequest(http.MethodPost, "/api/v1/read", bytes.NewReader(requestBody)) - require.NoError(t, err) - request.Header.Set("X-Prometheus-Remote-Read-Version", "0.1.0") - - recorder := httptest.NewRecorder() - handler.ServeHTTP(recorder, request) - - require.Equal(t, 200, recorder.Result().StatusCode) - require.Equal(t, []string{api.ContentTypeRemoteReadStreamedChunks}, recorder.Result().Header["Content-Type"]) - - stream := prom_remote.NewChunkedReader(recorder.Result().Body, prom_remote.DefaultChunkedReadLimit, nil) - - i := 0 - for { - var res client.StreamReadResponse - err := stream.NextProto(&res) - if errors.Is(err, io.EOF) { - break - } - require.NoError(t, err) + }, + expectedQueriedStart: 1, // Hints are currently ignored. + expectedQueriedEnd: 10, // Hints are currently ignored. + }, + } - if len(tc.expectedResults) < i+1 { - require.Fail(t, "unexpected result message") - } - require.Equal(t, tc.expectedResults[i], &res) - i++ + for testName, testData := range tests { + t.Run(testName, func(t *testing.T) { + for queryType, queryData := range queries { + t.Run(queryType, func(t *testing.T) { + var actualQueriedStart, actualQueriedEnd int64 + + q := &mockSampleAndChunkQueryable{ + chunkQueryableFn: func(int64, int64) (storage.ChunkQuerier, error) { + return mockChunkQuerier{ + selectFn: func(_ context.Context, _ bool, hints *storage.SelectHints, _ ...*labels.Matcher) storage.ChunkSeriesSet { + require.NotNil(t, hints, "select hints must be set") + actualQueriedStart, actualQueriedEnd = hints.Start, hints.End + + return storage.NewSeriesSetToChunkSet( + series.NewConcreteSeriesSetFromUnsortedSeries([]storage.Series{ + series.NewConcreteSeries( + labels.FromStrings("foo", "bar"), + testData.samples, + testData.histograms, + ), + }), + ) + }, + }, nil + }, + } + // The labelset for this test has 10 bytes and a full chunk is roughly 165 bytes; for this test we want a + // frame to contain at most 2 chunks. + maxBytesInFrame := 10 + 165*2 + + handler := remoteReadHandler(q, maxBytesInFrame, log.NewNopLogger()) + + requestBody, err := proto.Marshal(&prompb.ReadRequest{ + Queries: []*prompb.Query{queryData.query}, + AcceptedResponseTypes: []prompb.ReadRequest_ResponseType{prompb.ReadRequest_STREAMED_XOR_CHUNKS}, + }) + require.NoError(t, err) + requestBody = snappy.Encode(nil, requestBody) + request, err := http.NewRequest(http.MethodPost, "/api/v1/read", bytes.NewReader(requestBody)) + require.NoError(t, err) + request.Header.Set("X-Prometheus-Remote-Read-Version", "0.1.0") + + recorder := httptest.NewRecorder() + handler.ServeHTTP(recorder, request) + + require.Equal(t, 200, recorder.Result().StatusCode) + require.Equal(t, []string{api.ContentTypeRemoteReadStreamedChunks}, recorder.Result().Header["Content-Type"]) + + stream := prom_remote.NewChunkedReader(recorder.Result().Body, prom_remote.DefaultChunkedReadLimit, nil) + + i := 0 + for { + var res prompb.ChunkedReadResponse + err := stream.NextProto(&res) + if errors.Is(err, io.EOF) { + break + } + require.NoError(t, err) + + if len(testData.expectedResults) < i+1 { + require.Fail(t, "unexpected result message") + } + require.Equal(t, testData.expectedResults[i], &res) + i++ + } + require.Len(t, testData.expectedResults, i) + + // Ensure the time range passed down to the queryable is the expected one. + require.Equal(t, queryData.expectedQueriedStart, actualQueriedStart) + require.Equal(t, queryData.expectedQueriedEnd, actualQueriedEnd) + }) } - require.Len(t, tc.expectedResults, i) }) } } @@ -521,17 +605,20 @@ func TestRemoteReadErrorParsing(t *testing.T) { q := &mockSampleAndChunkQueryable{ queryableFn: func(int64, int64) (storage.Querier, error) { return mockQuerier{ - seriesSet: tc.seriesSet, + selectFn: func(_ context.Context, _ bool, hints *storage.SelectHints, _ ...*labels.Matcher) storage.SeriesSet { + require.NotNil(t, hints, "select hints must be set") + return tc.seriesSet + }, }, tc.getQuerierErr }, } handler := remoteReadHandler(q, 1024*1024, log.NewNopLogger()) - requestBody, err := proto.Marshal(&client.ReadRequest{ - Queries: []*client.QueryRequest{ + requestBody, err := proto.Marshal(&prompb.ReadRequest{ + Queries: []*prompb.Query{ {StartTimestampMs: 0, EndTimestampMs: 10}, }, - AcceptedResponseTypes: []client.ReadRequest_ResponseType{client.SAMPLES}, + AcceptedResponseTypes: []prompb.ReadRequest_ResponseType{prompb.ReadRequest_SAMPLES}, }) require.NoError(t, err) requestBody = snappy.Encode(nil, requestBody) @@ -557,17 +644,19 @@ func TestRemoteReadErrorParsing(t *testing.T) { q := &mockSampleAndChunkQueryable{ chunkQueryableFn: func(int64, int64) (storage.ChunkQuerier, error) { return mockChunkQuerier{ - seriesSet: tc.seriesSet, + selectFn: func(_ context.Context, _ bool, _ *storage.SelectHints, _ ...*labels.Matcher) storage.ChunkSeriesSet { + return storage.NewSeriesSetToChunkSet(tc.seriesSet) + }, }, tc.getQuerierErr }, } handler := remoteReadHandler(q, 1024*1024, log.NewNopLogger()) - requestBody, err := proto.Marshal(&client.ReadRequest{ - Queries: []*client.QueryRequest{ + requestBody, err := proto.Marshal(&prompb.ReadRequest{ + Queries: []*prompb.Query{ {StartTimestampMs: 0, EndTimestampMs: 10}, }, - AcceptedResponseTypes: []client.ReadRequest_ResponseType{client.STREAMED_XOR_CHUNKS}, + AcceptedResponseTypes: []prompb.ReadRequest_ResponseType{prompb.ReadRequest_STREAMED_XOR_CHUNKS}, }) require.NoError(t, err) requestBody = snappy.Encode(nil, requestBody) @@ -587,3 +676,51 @@ func TestRemoteReadErrorParsing(t *testing.T) { } }) } + +func TestQueryFromRemoteReadQuery(t *testing.T) { + tests := map[string]struct { + query *prompb.Query + expectedFrom model.Time + expectedTo model.Time + expectedMatchers []*labels.Matcher + }{ + "remote read request query without hints": { + query: &prompb.Query{ + StartTimestampMs: 1000, + EndTimestampMs: 2000, + Matchers: []*prompb.LabelMatcher{ + {Type: prompb.LabelMatcher_EQ, Name: labels.MetricName, Value: "metric"}, + }, + }, + expectedFrom: 1000, + expectedTo: 2000, + expectedMatchers: []*labels.Matcher{{Type: labels.MatchEqual, Name: labels.MetricName, Value: "metric"}}, + }, + "remote read request query with hints": { + query: &prompb.Query{ + StartTimestampMs: 1000, + EndTimestampMs: 2000, + Matchers: []*prompb.LabelMatcher{ + {Type: prompb.LabelMatcher_EQ, Name: labels.MetricName, Value: "metric"}, + }, + Hints: &prompb.ReadHints{ + StartMs: 500, + EndMs: 1500, + }, + }, + expectedFrom: 1000, // Hints are currently ignored. + expectedTo: 2000, // Hints are currently ignored. + expectedMatchers: []*labels.Matcher{{Type: labels.MatchEqual, Name: labels.MetricName, Value: "metric"}}, + }, + } + + for testName, testData := range tests { + t.Run(testName, func(t *testing.T) { + actualFrom, actualTo, actualMatchers, err := queryFromRemoteReadQuery(testData.query) + require.NoError(t, err) + require.Equal(t, testData.expectedFrom, actualFrom) + require.Equal(t, testData.expectedTo, actualTo) + require.Equal(t, testData.expectedMatchers, actualMatchers) + }) + } +}