From a96e7f3c63dbaa6452dc6f77b791ef763bcdb66d Mon Sep 17 00:00:00 2001 From: Filip Petkovski Date: Tue, 23 Apr 2024 08:29:04 +0200 Subject: [PATCH] Show warnings in query frontend (#7289) * Show warnings in query frontend QFE currently does not parse warnings from downstream queriers. This commit fixes that by adding the field to proto messages and modifies the merge function to take warnings into account. Signed-off-by: Filip Petkovski * Add CHANGELOG entry Signed-off-by: Filip Petkovski * Omit empty warnings Signed-off-by: Filip Petkovski --------- Signed-off-by: Filip Petkovski --- CHANGELOG.md | 1 + .../cortex/querier/queryrange/query_range.go | 15 +- .../querier/queryrange/queryrange.pb.go | 300 ++++++++++++------ .../querier/queryrange/queryrange.proto | 2 + .../querier/queryrange/results_cache.go | 7 +- .../querier/queryrange/results_cache_test.go | 3 +- 6 files changed, 226 insertions(+), 102 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91d8d01a02..3bb2bf8b68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#7244](https://github.com/thanos-io/thanos/pull/7244) Query: Fix Internal Server Error unknown targetHealth: "unknown" when trying to open the targets page. - [#7248](https://github.com/thanos-io/thanos/pull/7248) Receive: Fix RemoteWriteAsync was sequentially executed causing high latency in the ingestion path. - [#7271](https://github.com/thanos-io/thanos/pull/7271) Query: fixing dedup iterator when working on mixed sample types. +- [#7289](https://github.com/thanos-io/thanos/pull/7289) Query Frontend: show warnings from downstream queries. ### Added diff --git a/internal/cortex/querier/queryrange/query_range.go b/internal/cortex/querier/queryrange/query_range.go index e81991de91..d2d7ba4562 100644 --- a/internal/cortex/querier/queryrange/query_range.go +++ b/internal/cortex/querier/queryrange/query_range.go @@ -260,13 +260,17 @@ func (prometheusCodec) MergeResponse(_ Request, responses ...Response) (Response // Merge the responses. sort.Sort(byFirstTime(promResponses)) - analyzes := make([]*Analysis, 0, len(responses)) + var ( + analyzes = make([]*Analysis, 0, len(responses)) + warnings []string = nil + ) for i := range promResponses { - if promResponses[i].Data.GetAnalysis() == nil { - continue + if promResponses[i].Data.GetAnalysis() != nil { + analyzes = append(analyzes, promResponses[i].Data.GetAnalysis()) + } + if len(promResponses[i].Warnings) > 0 { + warnings = append(warnings, promResponses[i].Warnings...) } - - analyzes = append(analyzes, promResponses[i].Data.GetAnalysis()) } response := PrometheusResponse{ @@ -277,6 +281,7 @@ func (prometheusCodec) MergeResponse(_ Request, responses ...Response) (Response Stats: StatsMerge(responses), Analysis: AnalyzesMerge(analyzes...), }, + Warnings: warnings, } if len(resultsCacheGenNumberHeaderValues) != 0 { diff --git a/internal/cortex/querier/queryrange/queryrange.pb.go b/internal/cortex/querier/queryrange/queryrange.pb.go index db9699fd28..9ce28b017a 100644 --- a/internal/cortex/querier/queryrange/queryrange.pb.go +++ b/internal/cortex/querier/queryrange/queryrange.pb.go @@ -259,6 +259,7 @@ type PrometheusResponse struct { ErrorType string `protobuf:"bytes,3,opt,name=ErrorType,proto3" json:"errorType,omitempty"` Error string `protobuf:"bytes,4,opt,name=Error,proto3" json:"error,omitempty"` Headers []*PrometheusResponseHeader `protobuf:"bytes,5,rep,name=Headers,proto3" json:"-"` + Warnings []string `protobuf:"bytes,6,rep,name=Warnings,proto3" json:"warnings,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -332,6 +333,13 @@ func (m *PrometheusResponse) GetHeaders() []*PrometheusResponseHeader { return nil } +func (m *PrometheusResponse) GetWarnings() []string { + if m != nil { + return m.Warnings + } + return nil +} + type PrometheusData struct { ResultType string `protobuf:"bytes,1,opt,name=ResultType,proto3" json:"resultType"` Result []SampleStream `protobuf:"bytes,2,rep,name=Result,proto3" json:"result"` @@ -409,6 +417,7 @@ type PrometheusInstantQueryResponse struct { ErrorType string `protobuf:"bytes,3,opt,name=ErrorType,proto3" json:"errorType,omitempty"` Error string `protobuf:"bytes,4,opt,name=Error,proto3" json:"error,omitempty"` Headers []*PrometheusResponseHeader `protobuf:"bytes,5,rep,name=Headers,proto3" json:"-"` + Warnings []string `protobuf:"bytes,6,rep,name=Warnings,proto3" json:"warnings,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -482,6 +491,13 @@ func (m *PrometheusInstantQueryResponse) GetHeaders() []*PrometheusResponseHeade return nil } +func (m *PrometheusInstantQueryResponse) GetWarnings() []string { + if m != nil { + return m.Warnings + } + return nil +} + type PrometheusInstantQueryData struct { ResultType string `protobuf:"bytes,1,opt,name=ResultType,proto3" json:"resultType"` Result PrometheusInstantQueryResult `protobuf:"bytes,2,opt,name=Result,proto3" json:"result"` @@ -1604,100 +1620,102 @@ func init() { } var fileDescriptor_9af7607b46ac39b7 = []byte{ - // 1482 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x4f, 0x6f, 0x1c, 0xc5, - 0x12, 0xcf, 0xec, 0xae, 0xd7, 0xbb, 0xb5, 0x8e, 0x9d, 0xb4, 0xfd, 0x5e, 0xd6, 0x7e, 0x7e, 0x1e, - 0x67, 0xf2, 0xf4, 0x64, 0x42, 0xb2, 0x96, 0x8c, 0xc2, 0x21, 0x12, 0x01, 0x0f, 0x31, 0x38, 0x28, - 0x7f, 0x9c, 0x76, 0x94, 0x03, 0x97, 0xa8, 0x77, 0xb7, 0x59, 0x0f, 0x99, 0x9d, 0x99, 0x74, 0xf7, - 0x04, 0xfb, 0xc6, 0x67, 0x40, 0x1c, 0x38, 0x82, 0xc4, 0x05, 0x09, 0xf1, 0x1d, 0xb8, 0xe5, 0xc0, - 0x81, 0x33, 0x87, 0x01, 0xe5, 0xb8, 0x27, 0x3e, 0x02, 0xea, 0x3f, 0xb3, 0xd3, 0xb3, 0xb6, 0xd7, - 0xb2, 0xb8, 0x00, 0x17, 0x6f,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x7a, 0x07, 0x41, 0xd8, 0x67, 0x34, 0x32, 0x48, 0x5e, 0x29, 0x23, 0x39, 0x36, 0xa4, 0x7d, 0xcc, - 0x85, 0xf1, 0x78, 0xe5, 0xfd, 0xe4, 0x40, 0x23, 0x9f, 0x99, 0xce, 0x38, 0xad, 0x0b, 0x17, 0xe9, - 0x21, 0xed, 0xa5, 0xd2, 0xde, 0x93, 0x60, 0x98, 0x4f, 0x3b, 0x53, 0x9e, 0xd1, 0x57, 0x4d, 0xc7, - 0x6a, 0xe4, 0x94, 0x51, 0xe6, 0x96, 0x6d, 0xe0, 0xf2, 0x56, 0x42, 0x3e, 0x8e, 0x48, 0x17, 0xfd, - 0x94, 0xe9, 0xee, 0x78, 0x38, 0x7e, 0xfb, 0xd5, 0xeb, 0x35, 0xe7, 0xe7, 0xd7, 0x6b, 0xce, 0x6f, - 0xaf, 0xd7, 0x9c, 0x8f, 0xad, 0x7f, 0x94, 0x74, 0xeb, 0xca, 0xbd, 0xb7, 0xfe, 0x08, 0x00, 0x00, - 0xff, 0xff, 0x64, 0x18, 0x91, 0x98, 0x69, 0x11, 0x00, 0x00, + // 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, 0x9e, 0x1c, 0x3b, 0x19, 0x7b, 0x13, 0xd9, 0xeb, 0x35, 0x1d, 0x66, + 0xb1, 0xf0, 0x66, 0x13, 0x19, 0xf0, 0x22, 0x7b, 0x08, 0xb0, 0xd9, 0x35, 0x1b, 0xb7, 0x4e, 0x91, + 0x0f, 0x67, 0x1c, 0xa4, 0x40, 0x2f, 0xc1, 0x48, 0x9a, 0xca, 0x6c, 0x28, 0x92, 0x99, 0x19, 0x26, + 0xf6, 0xad, 0x7f, 0x43, 0xd1, 0x43, 0x8f, 0x2d, 0xd0, 0x63, 0xd1, 0xbf, 0x23, 0x87, 0x1e, 0x7a, + 0x2e, 0x50, 0xb6, 0xc8, 0x91, 0xa7, 0x5e, 0x7a, 0x2f, 0xe6, 0x83, 0x22, 0x29, 0xdb, 0x32, 0x8c, + 0x5e, 0x5a, 0xf4, 0x62, 0xcd, 0xbc, 0xef, 0xf7, 0x7b, 0x6f, 0x86, 0x6f, 0x0c, 0x37, 0xfa, 0x11, + 0x13, 0xf4, 0x70, 0xf3, 0x65, 0x42, 0x99, 0x4f, 0x99, 0xfa, 0x3d, 0x62, 0x24, 0x1c, 0xd2, 0xd2, + 0xb2, 0x1b, 0xb3, 0x48, 0x44, 0x08, 0x0a, 0xca, 0xca, 0xd2, 0x30, 0x1a, 0x46, 0x8a, 0xbc, 0x29, + 0x57, 0x5a, 0x62, 0x65, 0x6d, 0x18, 0x45, 0xc3, 0x80, 0x6e, 0xaa, 0x5d, 0x2f, 0xf9, 0x68, 0x73, + 0x90, 0x30, 0x22, 0xfc, 0x28, 0x34, 0xfc, 0x55, 0xe3, 0x4d, 0xff, 0xc4, 0x3d, 0xb3, 0x30, 0xdc, + 0xe5, 0x49, 0x6d, 0x12, 0x1e, 0x69, 0x96, 0xbb, 0x0f, 0x57, 0xf7, 0x58, 0x34, 0xa2, 0xe2, 0x80, + 0x26, 0x1c, 0xd3, 0x97, 0x09, 0xe5, 0x62, 0x97, 0x92, 0x01, 0x65, 0x68, 0x19, 0x1a, 0x8f, 0xc8, + 0x88, 0x76, 0xac, 0x75, 0x6b, 0xa3, 0xe5, 0xcd, 0x64, 0xa9, 0x63, 0xdd, 0xc2, 0x8a, 0x84, 0xfe, + 0x06, 0xf6, 0x33, 0x12, 0x24, 0x94, 0x77, 0x6a, 0xeb, 0xf5, 0x82, 0x69, 0x88, 0x6e, 0x5a, 0x83, + 0xcb, 0xc7, 0xac, 0x22, 0x04, 0x8d, 0x98, 0x88, 0x03, 0x6d, 0x0f, 0xab, 0x35, 0x5a, 0x82, 0x19, + 0x2e, 0x08, 0x13,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, 0xa9, 0xe1, 0xde, 0xd4, 0xd0, 0x94, 0x9e, 0x94, 0x2b, + 0xd0, 0x1c, 0xf8, 0x5c, 0x5e, 0xba, 0x03, 0x15, 0x78, 0x13, 0x8f, 0xf7, 0x6e, 0x08, 0xed, 0x9d, + 0xc3, 0x38, 0x20, 0xa1, 0x7a, 0xf0, 0xa2, 0x55, 0x68, 0x84, 0xc5, 0x2b, 0xb0, 0x99, 0xa5, 0x8e, + 0xda, 0x63, 0xf5, 0x17, 0x6d, 0x43, 0xb3, 0x7f, 0xe0, 0x07, 0x03, 0x46, 0x43, 0x83, 0xe4, 0xd5, + 0x2a, 0x92, 0x63, 0x43, 0x3a, 0xc6, 0x5c, 0x18, 0x8f, 0x57, 0xee, 0xb7, 0x16, 0x34, 0xf3, 0x99, + 0xe9, 0x0c, 0x6f, 0x3d, 0xb8, 0x48, 0x0f, 0x69, 0x3f, 0x91, 0xf6, 0x9e, 0xfa, 0xa3, 0x7c, 0xda, + 0x99, 0xf2, 0x5c, 0xbf, 0x66, 0x6e, 0xac, 0x66, 0x4e, 0xc9, 0x52, 0xa7, 0x6a, 0x03, 0x57, 0xb7, + 0x12, 0xf2, 0x71, 0x46, 0xba, 0xe9, 0xa7, 0x4c, 0x77, 0xc7, 0xd3, 0xf1, 0x3a, 0x6f, 0xde, 0xae, + 0x59, 0xdf, 0xbd, 0x5d, 0xb3, 0x7e, 0x7a, 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, } func (m *PrometheusRequestHeader) Marshal() (dAtA []byte, err error) { @@ -1905,6 +1923,15 @@ func (m *PrometheusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.Warnings) > 0 { + for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Warnings[iNdEx]) + copy(dAtA[i:], m.Warnings[iNdEx]) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Warnings[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } if len(m.Headers) > 0 { for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { { @@ -2049,6 +2076,15 @@ func (m *PrometheusInstantQueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.Warnings) > 0 { + for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Warnings[iNdEx]) + copy(dAtA[i:], m.Warnings[iNdEx]) + i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Warnings[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } if len(m.Headers) > 0 { for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { { @@ -3177,6 +3213,12 @@ func (m *PrometheusResponse) Size() (n int) { n += 1 + l + sovQueryrange(uint64(l)) } } + if len(m.Warnings) > 0 { + for _, s := range m.Warnings { + l = len(s) + n += 1 + l + sovQueryrange(uint64(l)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -3239,6 +3281,12 @@ func (m *PrometheusInstantQueryResponse) Size() (n int) { n += 1 + l + sovQueryrange(uint64(l)) } } + if len(m.Warnings) > 0 { + for _, s := range m.Warnings { + l = len(s) + n += 1 + l + sovQueryrange(uint64(l)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -4408,6 +4456,38 @@ func (m *PrometheusResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Warnings = append(m.Warnings, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQueryrange(dAtA[iNdEx:]) @@ -4811,6 +4891,38 @@ func (m *PrometheusInstantQueryResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Warnings = append(m.Warnings, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex 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 f6a7b2e383..21edc5783c 100644 --- a/internal/cortex/querier/queryrange/queryrange.proto +++ b/internal/cortex/querier/queryrange/queryrange.proto @@ -42,6 +42,7 @@ message PrometheusResponse { string ErrorType = 3 [(gogoproto.jsontag) = "errorType,omitempty"]; string Error = 4 [(gogoproto.jsontag) = "error,omitempty"]; repeated PrometheusResponseHeader Headers = 5 [(gogoproto.jsontag) = "-"]; + repeated string Warnings = 6 [(gogoproto.jsontag) = "warnings,omitempty"]; } message PrometheusData { @@ -57,6 +58,7 @@ message PrometheusInstantQueryResponse { string ErrorType = 3 [(gogoproto.jsontag) = "errorType,omitempty"]; string Error = 4 [(gogoproto.jsontag) = "error,omitempty"]; repeated PrometheusResponseHeader Headers = 5 [(gogoproto.jsontag) = "-"]; + repeated string Warnings = 6 [(gogoproto.jsontag) = "warnings,omitempty"]; } message PrometheusInstantQueryData { diff --git a/internal/cortex/querier/queryrange/results_cache.go b/internal/cortex/querier/queryrange/results_cache.go index a0e467d6a7..ae012200f6 100644 --- a/internal/cortex/querier/queryrange/results_cache.go +++ b/internal/cortex/querier/queryrange/results_cache.go @@ -99,7 +99,8 @@ func (PrometheusResponseExtractor) Extract(start, end int64, from Response) Resp Stats: extractStats(start, end, promRes.Data.Stats), Analysis: promRes.Data.Analysis, }, - Headers: promRes.Headers, + Headers: promRes.Headers, + Warnings: promRes.Warnings, } } @@ -115,6 +116,7 @@ func (PrometheusResponseExtractor) ResponseWithoutHeaders(resp Response) Respons Stats: promRes.Data.Stats, Analysis: promRes.Data.Analysis, }, + Warnings: promRes.Warnings, } } @@ -128,7 +130,8 @@ func (PrometheusResponseExtractor) ResponseWithoutStats(resp Response) Response Result: promRes.Data.Result, Analysis: promRes.Data.Analysis, }, - Headers: promRes.Headers, + Headers: promRes.Headers, + Warnings: promRes.Warnings, } } diff --git a/internal/cortex/querier/queryrange/results_cache_test.go b/internal/cortex/querier/queryrange/results_cache_test.go index 346c9e4a25..7527b6ad11 100644 --- a/internal/cortex/querier/queryrange/results_cache_test.go +++ b/internal/cortex/querier/queryrange/results_cache_test.go @@ -24,7 +24,7 @@ import ( const ( query = "/api/v1/query_range?end=1536716898&query=sum%28container_memory_rss%29+by+%28namespace%29&start=1536673680&stats=all&step=120" - responseBody = `{"status":"success","data":{"resultType":"matrix","result":[{"metric":{"foo":"bar"},"values":[[1536673680,"137"],[1536673780,"137"]]}],"analysis":null}}` + responseBody = `{"status":"success","data":{"resultType":"matrix","result":[{"metric":{"foo":"bar"},"values":[[1536673680,"137"],[1536673780,"137"]]}],"analysis":null},"warnings":["test-warn"]}` histogramResponseBody = `{"status":"success","data":{"resultType":"matrix","result":[{"metric":{"fake":"histogram"},"histograms":[[1536673680,{"count":"5","sum":"18.4","buckets":[[3,"-0.001","0.001","2"],[0,"0.7071067811865475","1","1"],[0,"1","1.414213562373095","2"],[0,"2","2.82842712474619","1"],[0,"2.82842712474619","4","1"]]}]]}],"analysis":null}}` ) @@ -91,6 +91,7 @@ var ( }, }, }, + Warnings: []string{"test-warn"}, } parsedHistogramResponse = &PrometheusResponse{ Status: "success",