From 1bdcc655d86a47c852ab54a9040b184c1108aadc Mon Sep 17 00:00:00 2001 From: Pedro Tanaka Date: Tue, 22 Oct 2024 05:39:43 +0200 Subject: [PATCH] QueryFrontend: pass "stats" parameter forward (#7852) If a querier sees a "stats" parameter in the query request, it will attach important information about the query execution to the response. But currently, even if an user sets this value, the Query Frontend will lose this value in its middleware/roundtrippers. This PR fixes this problem by properly encoding/decoding the requests in QFE. Signed-off-by: Pedro Tanaka --- CHANGELOG.md | 1 + .../cortex/querier/queryrange/query_range.go | 16 +- .../querier/queryrange/query_range_test.go | 46 +++- .../querier/queryrange/queryrange.pb.go | 228 ++++++++++-------- .../querier/queryrange/queryrange.proto | 1 + pkg/queryfrontend/queryinstant_codec.go | 2 + pkg/queryfrontend/queryinstant_codec_test.go | 14 +- pkg/queryfrontend/queryrange_codec.go | 2 + pkg/queryfrontend/queryrange_codec_test.go | 16 ++ 9 files changed, 218 insertions(+), 108 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da53c4e9e2..4b3cc229e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#7679](https://github.com/thanos-io/thanos/pull/7679) Query: respect store.limit.* flags when evaluating queries - [#7821](https://github.com/thanos-io/thanos/pull/7679) Query/Receive: Fix coroutine leak introduced in https://github.com/thanos-io/thanos/pull/7796. - [#7843](https://github.com/thanos-io/thanos/pull/7843) Query Frontend: fix slow query logging for non-query endpoints. +- [#7852](https://github.com/thanos-io/thanos/pull/7852) Query Frontend: pass "stats" parameter forward to queriers and fix Prometheus stats merging. ### Added - [#7763](https://github.com/thanos-io/thanos/pull/7763) Ruler: use native histograms for client latency metrics. diff --git a/internal/cortex/querier/queryrange/query_range.go b/internal/cortex/querier/queryrange/query_range.go index d2d7ba4562..339781f409 100644 --- a/internal/cortex/querier/queryrange/query_range.go +++ b/internal/cortex/querier/queryrange/query_range.go @@ -8,7 +8,7 @@ import ( "context" stdjson "encoding/json" "fmt" - io "io" + "io" "math" "net/http" "net/url" @@ -329,6 +329,7 @@ func (prometheusCodec) DecodeRequest(_ context.Context, r *http.Request, forward result.Query = r.FormValue("query") result.Stats = r.FormValue("stats") result.Path = r.URL.Path + result.Stats = r.FormValue("stats") // Include the specified headers from http request in prometheusRequest. for _, header := range forwardHeaders { @@ -706,6 +707,8 @@ func (s *PrometheusInstantQueryData) MarshalJSON() ([]byte, error) { func StatsMerge(resps []Response) *PrometheusResponseStats { output := map[int64]*PrometheusResponseQueryableSamplesStatsPerStep{} hasStats := false + peakSamples := int32(0) + totalSamples := int64(0) for _, resp := range resps { stats := resp.GetStats() if stats == nil { @@ -720,6 +723,11 @@ func StatsMerge(resps []Response) *PrometheusResponseStats { for _, s := range stats.Samples.TotalQueryableSamplesPerStep { output[s.GetTimestampMs()] = s } + + if stats.Samples.PeakSamples > peakSamples { + peakSamples = stats.Samples.PeakSamples + } + totalSamples += stats.Samples.TotalQueryableSamples } if !hasStats { @@ -733,10 +741,12 @@ func StatsMerge(resps []Response) *PrometheusResponseStats { sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] }) - result := &PrometheusResponseStats{Samples: &PrometheusResponseSamplesStats{}} + result := &PrometheusResponseStats{Samples: &PrometheusResponseSamplesStats{ + PeakSamples: peakSamples, + TotalQueryableSamples: totalSamples, + }} for _, key := range keys { result.Samples.TotalQueryableSamplesPerStep = append(result.Samples.TotalQueryableSamplesPerStep, output[key]) - result.Samples.TotalQueryableSamples += output[key].Value } return result diff --git a/internal/cortex/querier/queryrange/query_range_test.go b/internal/cortex/querier/queryrange/query_range_test.go index 121459de5e..401c9d2e12 100644 --- a/internal/cortex/querier/queryrange/query_range_test.go +++ b/internal/cortex/querier/queryrange/query_range_test.go @@ -6,7 +6,7 @@ package queryrange import ( "bytes" "context" - io "io" + "io" "net/http" "strconv" "testing" @@ -36,6 +36,20 @@ func TestRequest(t *testing.T) { url: query, expected: &parsedRequestWithHeaders, }, + { + url: "/api/v1/query_range?end=60&query=sum%28container_memory_rss%29+by+%28namespace%29&start=0&stats=all&step=14", + expected: &PrometheusRequest{ + Path: "/api/v1/query_range", + Start: 0, + End: 60_000, + Step: 14_000, + Query: "sum(container_memory_rss) by (namespace)", + Stats: "all", + Headers: []*PrometheusRequestHeader{ + {Name: "Test-Header", Values: []string{"test"}}, + }, + }, + }, { url: "api/v1/query_range?start=foo&stats=all", expectedErr: httpgrpc.Errorf(http.StatusBadRequest, "invalid parameter \"start\"; cannot parse \"foo\" to a valid timestamp"), @@ -129,7 +143,7 @@ func TestResponseWithStats(t *testing.T) { expected *PrometheusResponse }{ { - body: `{"status":"success","data":{"resultType":"matrix","result":[{"metric":{"foo":"bar"},"values":[[1536673680,"137"],[1536673780,"137"]]}],"stats":{"samples":{"totalQueryableSamples":10,"totalQueryableSamplesPerStep":[[1536673680,5],[1536673780,5]]}},"analysis":null}}`, + body: `{"status":"success","data":{"resultType":"matrix","result":[{"metric":{"foo":"bar"},"values":[[1536673680,"137"],[1536673780,"137"]]}],"stats":{"samples":{"peakSamples":0,"totalQueryableSamples":10,"totalQueryableSamplesPerStep":[[1536673680,5],[1536673780,5]]}},"analysis":null}}`, expected: &PrometheusResponse{ Status: "success", Data: PrometheusData{ @@ -158,7 +172,7 @@ func TestResponseWithStats(t *testing.T) { }, }, { - body: `{"status":"success","data":{"resultType":"matrix","result":[{"metric":{"foo":"bar"},"values":[[1536673680,"137"],[1536673780,"137"]]}],"stats":{"samples":{"totalQueryableSamples":10,"totalQueryableSamplesPerStep":[[1536673680,5],[1536673780,5]]}},"analysis":{"name":"[noArgFunction]","executionTime":"1s","children":null}}}`, + body: `{"status":"success","data":{"resultType":"matrix","result":[{"metric":{"foo":"bar"},"values":[[1536673680,"137"],[1536673780,"137"]]}],"stats":{"samples":{"peakSamples":0,"totalQueryableSamples":10,"totalQueryableSamplesPerStep":[[1536673680,5],[1536673780,5]]}},"analysis":{"name":"[noArgFunction]","executionTime":"1s","children":null}}}`, expected: &PrometheusResponse{ Status: "success", Data: PrometheusData{ @@ -211,11 +225,27 @@ func TestResponseWithStats(t *testing.T) { } resp2, err := PrometheusCodec.EncodeResponse(context.Background(), resp) require.NoError(t, err) - assert.Equal(t, response, resp2) + assert.Equal(t, prettyPrintJsonBody(t, response.Body), prettyPrintJsonBody(t, resp2.Body)) }) } } +func prettyPrintJsonBody(t *testing.T, body io.ReadCloser) string { + t.Helper() + + bodyContent, err := io.ReadAll(body) + require.NoError(t, err) + + var jsonData interface{} + err = json.Unmarshal(bodyContent, &jsonData) + require.NoError(t, err) + + prettyBytes, err := json.MarshalIndent(jsonData, "", " ") + require.NoError(t, err) + + return string(prettyBytes) +} + func TestMergeAPIResponses(t *testing.T) { for _, tc := range []struct { name string @@ -659,7 +689,7 @@ func TestMergeAPIResponses(t *testing.T) { }, }, Stats: &PrometheusResponseStats{Samples: &PrometheusResponseSamplesStats{ - TotalQueryableSamples: 25, + TotalQueryableSamples: 30, TotalQueryableSamplesPerStep: []*PrometheusResponseQueryableSamplesStatsPerStep{ {Value: 5, TimestampMs: 1000}, {Value: 5, TimestampMs: 2000}, @@ -696,7 +726,7 @@ func TestMergeAPIResponses(t *testing.T) { }, }, Stats: &PrometheusResponseStats{Samples: &PrometheusResponseSamplesStats{ - TotalQueryableSamples: 28, + TotalQueryableSamples: 36, TotalQueryableSamplesPerStep: []*PrometheusResponseQueryableSamplesStatsPerStep{ {Value: 1, TimestampMs: 1000}, {Value: 2, TimestampMs: 2000}, @@ -734,7 +764,7 @@ func TestMergeAPIResponses(t *testing.T) { }, }, Stats: &PrometheusResponseStats{Samples: &PrometheusResponseSamplesStats{ - TotalQueryableSamples: 15, + TotalQueryableSamples: 26, TotalQueryableSamplesPerStep: []*PrometheusResponseQueryableSamplesStatsPerStep{ {Value: 1, TimestampMs: 1000}, {Value: 2, TimestampMs: 2000}, @@ -769,7 +799,7 @@ func TestMergeAPIResponses(t *testing.T) { }, }, Stats: &PrometheusResponseStats{Samples: &PrometheusResponseSamplesStats{ - TotalQueryableSamples: 14, + TotalQueryableSamples: 40, TotalQueryableSamplesPerStep: []*PrometheusResponseQueryableSamplesStatsPerStep{ {Value: 2, TimestampMs: 2000}, {Value: 3, TimestampMs: 3000}, diff --git a/internal/cortex/querier/queryrange/queryrange.pb.go b/internal/cortex/querier/queryrange/queryrange.pb.go index 9ce28b017a..ec7bf968b5 100644 --- a/internal/cortex/querier/queryrange/queryrange.pb.go +++ b/internal/cortex/querier/queryrange/queryrange.pb.go @@ -828,6 +828,7 @@ func (m *PrometheusResponseStats) GetSamples() *PrometheusResponseSamplesStats { type PrometheusResponseSamplesStats struct { TotalQueryableSamples int64 `protobuf:"varint,1,opt,name=totalQueryableSamples,proto3" json:"totalQueryableSamples"` TotalQueryableSamplesPerStep []*PrometheusResponseQueryableSamplesStatsPerStep `protobuf:"bytes,2,rep,name=totalQueryableSamplesPerStep,proto3" json:"totalQueryableSamplesPerStep"` + PeakSamples int32 `protobuf:"varint,3,opt,name=peakSamples,proto3" json:"peakSamples"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -880,6 +881,13 @@ func (m *PrometheusResponseSamplesStats) GetTotalQueryableSamplesPerStep() []*Pr return nil } +func (m *PrometheusResponseSamplesStats) GetPeakSamples() int32 { + if m != nil { + return m.PeakSamples + } + return 0 +} + type PrometheusResponseQueryableSamplesStatsPerStep struct { Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` TimestampMs int64 `protobuf:"varint,2,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` @@ -1620,102 +1628,103 @@ func init() { } var fileDescriptor_9af7607b46ac39b7 = []byte{ - // 1505 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0xcd, 0x6f, 0xdb, 0x46, - 0x16, 0x0f, 0x25, 0x99, 0x96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x7a, 0xbb, 0x66, 0x7d, 0x58, 0xfa, 0x87, 0x4c, 0xcf, 0x56, - 0xe1, 0xfd, 0xfb, 0xd7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x48, 0xa7, 0xb6, 0xd1, 0x11, 0x00, - 0x00, + // 1523 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x18, 0x3d, 0x6f, 0x1b, 0x47, + 0xd6, 0x4b, 0x52, 0x14, 0xf9, 0x28, 0x4b, 0xf6, 0x48, 0x67, 0x53, 0x3a, 0x9d, 0x56, 0x5e, 0x1f, + 0x0e, 0x3a, 0x9f, 0x4d, 0xe1, 0x74, 0xf0, 0x15, 0x06, 0xce, 0x77, 0xda, 0xb3, 0x12, 0x39, 0xf0, + 0x87, 0x3c, 0x32, 0x1c, 0x20, 0x8d, 0x31, 0x24, 0x27, 0xd4, 0xc6, 0xe4, 0xee, 0x7a, 0x66, 0xd6, + 0x96, 0xba, 0xfc, 0x86, 0x54, 0x29, 0x13, 0x20, 0x65, 0x90, 0xbf, 0x11, 0x17, 0x29, 0x52, 0x07, + 0xc8, 0x26, 0x70, 0xb9, 0x55, 0x9a, 0xf4, 0xc1, 0x7c, 0x2c, 0x77, 0x96, 0x92, 0x28, 0x08, 0x69, + 0x12, 0xa4, 0x11, 0xe7, 0x7d, 0xce, 0xfb, 0x9a, 0xb7, 0xef, 0x09, 0x6e, 0xf4, 0x22, 0x26, 0xe8, + 0xe1, 0xe6, 0xcb, 0x84, 0xb2, 0x80, 0x32, 0xf5, 0x7b, 0xc4, 0x48, 0x38, 0xa0, 0xd6, 0xb1, 0x13, + 0xb3, 0x48, 0x44, 0x08, 0x0a, 0xcc, 0xca, 0xd2, 0x20, 0x1a, 0x44, 0x0a, 0xbd, 0x29, 0x4f, 0x9a, + 0x63, 0x65, 0x6d, 0x10, 0x45, 0x83, 0x21, 0xdd, 0x54, 0x50, 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08, 0x07, 0x8f, 0x63, 0x29, 0xc9, 0xdb, 0xb3, 0x4a, 0xf7, 0x4a, 0xc7, 0xca, 0xda, 0xff, + 0x4b, 0x1c, 0x7e, 0x4d, 0x2a, 0xc7, 0x13, 0x72, 0xe8, 0x1e, 0xcc, 0xea, 0x40, 0xf2, 0x76, 0x63, + 0xbd, 0xba, 0xd1, 0xda, 0xba, 0x6e, 0xab, 0x38, 0x25, 0xe8, 0x79, 0x24, 0x73, 0x51, 0x13, 0x20, + 0xc1, 0xdb, 0x4d, 0x6d, 0xa5, 0x02, 0xbc, 0xa7, 0xd0, 0xb6, 0x15, 0xf0, 0x38, 0x0a, 0x39, 0xfd, + 0xd5, 0x69, 0xfb, 0xbe, 0x02, 0xe8, 0xb8, 0x5a, 0xe4, 0x41, 0x7d, 0x5f, 0x10, 0x91, 0x70, 0xa3, + 0x12, 0xb2, 0xd4, 0xad, 0x73, 0x85, 0xc1, 0x86, 0x82, 0xde, 0x81, 0xda, 0x3d, 0x22, 0x88, 0x4a, + 0xe3, 0x44, 0xb0, 0x0a, 0x8d, 0x92, 0xc3, 0xbf, 0x22, 0x83, 0x95, 0xa5, 0xee, 0x7c, 0x9f, 0x08, + 0x72, 0x33, 0x1a, 0x05, 0x82, 0x8e, 0x62, 0x71, 0x84, 0x95, 0x3c, 0xba, 0x0d, 0xcd, 0x1d, 0xc6, + 0x22, 0xf6, 0xf4, 0x28, 0xa6, 0x2a, 0xff, 0x4d, 0xff, 0x6a, 0x96, 0xba, 0x8b, 0x34, 0x47, 0x5a, + 0x12, 0x05, 0x27, 0xfa, 0x3b, 0xcc, 0x28, 0x40, 0xd5, 0x47, 0xd3, 0x5f, 0xcc, 0x52, 0x77, 0x41, + 0x89, 0x58, 0xec, 0x9a, 0x03, 0xed, 0x14, 0x69, 0x99, 0x51, 0x69, 0xf9, 0xeb, 0x69, 0x69, 0xb1, + 0xa3, 0x7a, 0x2c, 0x2f, 0x5b, 0xd0, 0x78, 0x9f, 0xb0, 0x30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xd2, 0x36, 0xe6, 0xcc, 0x78, 0x7c, 0xf2, 0xbe, 0x71, 0xa0, + 0x91, 0x8f, 0x59, 0x67, 0xdc, 0xd6, 0x85, 0x8b, 0xf4, 0x90, 0xf6, 0x12, 0xa9, 0xef, 0x69, 0x30, + 0xca, 0x07, 0xa4, 0x29, 0x1b, 0xfe, 0x35, 0xd3, 0xb1, 0x1a, 0x39, 0x26, 0x4b, 0xdd, 0xb2, 0x0e, + 0x5c, 0x06, 0x65, 0xc8, 0xc7, 0x1e, 0xe9, 0xa2, 0x9f, 0x32, 0x10, 0x1e, 0x77, 0xc7, 0x6f, 0xbf, + 0x79, 0xbb, 0xe6, 0x7c, 0xfb, 0x76, 0xcd, 0xf9, 0xf1, 0xed, 0x9a, 0xf3, 0x81, 0xf5, 0x3f, 0x9c, + 0x6e, 0x5d, 0x99, 0xf7, 0xaf, 0x5f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd9, 0xc7, 0x1d, 0xa3, 0x04, + 0x12, 0x00, 0x00, } func (m *PrometheusRequestHeader) Marshal() (dAtA []byte, err error) { @@ -2466,6 +2475,11 @@ func (m *PrometheusResponseSamplesStats) MarshalToSizedBuffer(dAtA []byte) (int, i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.PeakSamples != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.PeakSamples)) + i-- + dAtA[i] = 0x18 + } if len(m.TotalQueryableSamplesPerStep) > 0 { for iNdEx := len(m.TotalQueryableSamplesPerStep) - 1; iNdEx >= 0; iNdEx-- { { @@ -3449,6 +3463,9 @@ func (m *PrometheusResponseSamplesStats) Size() (n int) { n += 1 + l + sovQueryrange(uint64(l)) } } + if m.PeakSamples != 0 { + n += 1 + sovQueryrange(uint64(m.PeakSamples)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -5663,6 +5680,25 @@ func (m *PrometheusResponseSamplesStats) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PeakSamples", wireType) + } + m.PeakSamples = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PeakSamples |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQueryrange(dAtA[iNdEx:]) diff --git a/internal/cortex/querier/queryrange/queryrange.proto b/internal/cortex/querier/queryrange/queryrange.proto index 21edc5783c..281ae02011 100644 --- a/internal/cortex/querier/queryrange/queryrange.proto +++ b/internal/cortex/querier/queryrange/queryrange.proto @@ -92,6 +92,7 @@ message PrometheusResponseStats { message PrometheusResponseSamplesStats { int64 totalQueryableSamples = 1 [(gogoproto.jsontag) = "totalQueryableSamples"]; repeated PrometheusResponseQueryableSamplesStatsPerStep totalQueryableSamplesPerStep = 2 [(gogoproto.jsontag) = "totalQueryableSamplesPerStep"]; + int32 peakSamples = 3 [(gogoproto.jsontag) = "peakSamples"]; } message PrometheusResponseQueryableSamplesStatsPerStep { diff --git a/pkg/queryfrontend/queryinstant_codec.go b/pkg/queryfrontend/queryinstant_codec.go index 27c7bceae4..e9ff8f7a38 100644 --- a/pkg/queryfrontend/queryinstant_codec.go +++ b/pkg/queryfrontend/queryinstant_codec.go @@ -164,6 +164,7 @@ func (c queryInstantCodec) DecodeRequest(_ context.Context, r *http.Request, for result.Query = r.FormValue("query") result.Path = r.URL.Path result.Engine = r.FormValue("engine") + result.Stats = r.FormValue(queryv1.Stats) for _, header := range forwardHeaders { for h, hv := range r.Header { @@ -189,6 +190,7 @@ func (c queryInstantCodec) EncodeRequest(ctx context.Context, r queryrange.Reque queryv1.PartialResponseParam: []string{strconv.FormatBool(thanosReq.PartialResponse)}, queryv1.EngineParam: []string{thanosReq.Engine}, queryv1.ReplicaLabelsParam: thanosReq.ReplicaLabels, + queryv1.Stats: []string{thanosReq.Stats}, } if thanosReq.Time > 0 { diff --git a/pkg/queryfrontend/queryinstant_codec_test.go b/pkg/queryfrontend/queryinstant_codec_test.go index 3d60cf6960..50d18bdf19 100644 --- a/pkg/queryfrontend/queryinstant_codec_test.go +++ b/pkg/queryfrontend/queryinstant_codec_test.go @@ -16,6 +16,7 @@ import ( "github.com/weaveworks/common/httpgrpc" "github.com/efficientgo/core/testutil" + "github.com/thanos-io/thanos/internal/cortex/cortexpb" "github.com/thanos-io/thanos/internal/cortex/querier/queryrange" queryv1 "github.com/thanos-io/thanos/pkg/api/query" @@ -165,6 +166,17 @@ func TestQueryInstantCodec_DecodeRequest(t *testing.T) { StoreMatchers: [][]*labels.Matcher{}, }, }, + { + name: "forwards stats parameter", + url: "/api/v1/query?stats=all", + partialResponse: false, + expectedRequest: &ThanosQueryInstantRequest{ + Path: "/api/v1/query", + Stats: "all", + Dedup: true, + StoreMatchers: [][]*labels.Matcher{}, + }, + }, } { t.Run(tc.name, func(t *testing.T) { r, err := http.NewRequest(http.MethodGet, tc.url, nil) @@ -176,7 +188,7 @@ func TestQueryInstantCodec_DecodeRequest(t *testing.T) { testutil.Equals(t, err, tc.expectedError) } else { testutil.Ok(t, err) - testutil.Equals(t, req, tc.expectedRequest) + testutil.Equals(t, tc.expectedRequest, req) } }) } diff --git a/pkg/queryfrontend/queryrange_codec.go b/pkg/queryfrontend/queryrange_codec.go index 4de0dd387e..a03be8f937 100644 --- a/pkg/queryfrontend/queryrange_codec.go +++ b/pkg/queryfrontend/queryrange_codec.go @@ -136,6 +136,7 @@ func (c queryRangeCodec) DecodeRequest(_ context.Context, r *http.Request, forwa } result.Engine = r.FormValue(queryv1.EngineParam) result.Path = r.URL.Path + result.Stats = r.FormValue(queryv1.Stats) for _, value := range r.Header.Values(cacheControlHeader) { if strings.Contains(value, noStoreValue) { @@ -170,6 +171,7 @@ func (c queryRangeCodec) EncodeRequest(ctx context.Context, r queryrange.Request queryv1.DedupParam: []string{strconv.FormatBool(thanosReq.Dedup)}, queryv1.PartialResponseParam: []string{strconv.FormatBool(thanosReq.PartialResponse)}, queryv1.ReplicaLabelsParam: thanosReq.ReplicaLabels, + queryv1.Stats: []string{thanosReq.Stats}, } if thanosReq.AutoDownsampling { diff --git a/pkg/queryfrontend/queryrange_codec_test.go b/pkg/queryfrontend/queryrange_codec_test.go index d4f068e94e..c0042677b8 100644 --- a/pkg/queryfrontend/queryrange_codec_test.go +++ b/pkg/queryfrontend/queryrange_codec_test.go @@ -15,6 +15,7 @@ import ( "github.com/thanos-io/thanos/internal/cortex/querier/queryrange" "github.com/efficientgo/core/testutil" + queryv1 "github.com/thanos-io/thanos/pkg/api/query" "github.com/thanos-io/thanos/pkg/compact" ) @@ -298,6 +299,21 @@ func TestQueryRangeCodec_EncodeRequest(t *testing.T) { r.FormValue(queryv1.LookbackDeltaParam) == "1" }, }, + { + name: "Request with stats", + req: &ThanosQueryRangeRequest{ + Start: 123000, + End: 456000, + Step: 1000, + Stats: "all", + }, + checkFunc: func(r *http.Request) bool { + return r.FormValue("start") == "123" && + r.FormValue("end") == "456" && + r.FormValue("step") == "1" && + r.FormValue("stats") == "all" + }, + }, } { t.Run(tc.name, func(t *testing.T) { // Default partial response value doesn't matter when encoding requests.