From a6fc87ad159860e2e1d36a2f8d8e5a1ad6ef9031 Mon Sep 17 00:00:00 2001 From: yeya24 Date: Tue, 3 Jun 2025 22:34:29 -0700 Subject: [PATCH 1/3] Support query analyze for thanos engine Signed-off-by: yeya24 --- pkg/api/handlers.go | 5 - pkg/api/queryapi/query_api.go | 64 +- pkg/querier/codec/protobuf_codec.go | 39 +- .../tripperware/instantquery/instant_query.go | 5 + pkg/querier/tripperware/merge.go | 46 +- pkg/querier/tripperware/query.go | 56 ++ pkg/querier/tripperware/query.pb.go | 663 +++++++++++++++--- pkg/querier/tripperware/query.proto | 9 + .../tripperware/queryrange/query_range.go | 4 + pkg/util/analysis/analysis.go | 11 + 10 files changed, 809 insertions(+), 93 deletions(-) create mode 100644 pkg/util/analysis/analysis.go diff --git a/pkg/api/handlers.go b/pkg/api/handlers.go index 5173affb197..e1824e8d7a4 100644 --- a/pkg/api/handlers.go +++ b/pkg/api/handlers.go @@ -252,11 +252,6 @@ func NewQuerierHandler( codec.NewInstrumentedCodec(codec.ProtobufCodec{CortexInternal: true}, cm), } - // Install codecs - for _, c := range codecs { - api.InstallCodec(c) - } - router := mux.NewRouter() // Use a separate metric for the querier in order to differentiate requests from the query-frontend when diff --git a/pkg/api/queryapi/query_api.go b/pkg/api/queryapi/query_api.go index c07c21cdd05..7db6e5223da 100644 --- a/pkg/api/queryapi/query_api.go +++ b/pkg/api/queryapi/query_api.go @@ -3,9 +3,15 @@ package queryapi import ( "context" "fmt" + "github.com/pkg/errors" + "github.com/prometheus/prometheus/promql/parser" + "github.com/prometheus/prometheus/util/stats" "net/http" "time" + "github.com/cortexproject/cortex/pkg/util/analysis" + thanosengine "github.com/thanos-io/promql-engine/engine" + "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/grafana/regexp" @@ -22,6 +28,13 @@ import ( "github.com/cortexproject/cortex/pkg/util/api" ) +type QueryData struct { + ResultType parser.ValueType `json:"resultType"` + Result parser.Value `json:"result"` + Stats stats.QueryStats `json:"stats,omitempty"` + Analysis *analysis.QueryTelemetry `json:"analysis,omitempty"` +} + type QueryAPI struct { queryable storage.SampleAndChunkQueryable queryEngine promql.QueryEngine @@ -117,14 +130,20 @@ func (q *QueryAPI) RangeQueryHandler(r *http.Request) (result apiFuncResult) { if res.Err != nil { return apiFuncResult{nil, returnAPIError(res.Err), res.Warnings, qry.Close} } + var queryAnalysis analysis.QueryTelemetry + if q.parseQueryAnalyzeParam(r) { + engineType := engine.GetEngineType(ctx) + queryAnalysis, err = analyzeQueryOutput(qry, engineType) + } warnings := res.Warnings qs := q.statsRenderer(ctx, qry.Stats(), r.FormValue("stats")) - return apiFuncResult{&v1.QueryData{ + return apiFuncResult{&QueryData{ ResultType: res.Value.Type(), Result: res.Value, Stats: qs, + Analysis: &queryAnalysis, }, nil, warnings, qry.Close} } @@ -173,14 +192,20 @@ func (q *QueryAPI) InstantQueryHandler(r *http.Request) (result apiFuncResult) { if res.Err != nil { return apiFuncResult{nil, returnAPIError(res.Err), res.Warnings, qry.Close} } + var queryAnalysis analysis.QueryTelemetry + if q.parseQueryAnalyzeParam(r) { + engineType := engine.GetEngineType(ctx) + queryAnalysis, err = analyzeQueryOutput(qry, engineType) + } warnings := res.Warnings qs := q.statsRenderer(ctx, qry.Stats(), r.FormValue("stats")) - return apiFuncResult{&v1.QueryData{ + return apiFuncResult{&QueryData{ ResultType: res.Value.Type(), Result: res.Value, Stats: qs, + Analysis: &queryAnalysis, }, nil, warnings, qry.Close} } @@ -252,3 +277,38 @@ func (q *QueryAPI) negotiateCodec(req *http.Request, resp *v1.Response) (v1.Code return defaultCodec, nil } + +func (q *QueryAPI) parseQueryAnalyzeParam(r *http.Request) bool { + return r.FormValue("analyze") == "true" +} + +func analyzeQueryOutput(query promql.Query, engineType engine.Type) (analysis.QueryTelemetry, error) { + if eq, ok := query.(thanosengine.ExplainableQuery); ok { + if analyze := eq.Analyze(); analyze != nil { + return processAnalysis(analyze), nil + } else { + return analysis.QueryTelemetry{}, errors.Errorf("Query: %v not analyzable", query) + } + } + + var warning error + if engineType == engine.Thanos { + warning = errors.New("Query fallback to prometheus engine; not analyzable.") + } else { + warning = errors.New("Query not analyzable; change engine to 'thanos'.") + } + + return analysis.QueryTelemetry{}, warning +} + +func processAnalysis(a *thanosengine.AnalyzeOutputNode) analysis.QueryTelemetry { + var analysis analysis.QueryTelemetry + analysis.OperatorName = a.OperatorTelemetry.String() + analysis.Execution = a.OperatorTelemetry.ExecutionTimeTaken().String() + analysis.PeakSamples = a.PeakSamples() + analysis.TotalSamples = a.TotalSamples() + for _, c := range a.Children { + analysis.Children = append(analysis.Children, processAnalysis(c)) + } + return analysis +} diff --git a/pkg/querier/codec/protobuf_codec.go b/pkg/querier/codec/protobuf_codec.go index 64bfa2e3945..44fc6096bc4 100644 --- a/pkg/querier/codec/protobuf_codec.go +++ b/pkg/querier/codec/protobuf_codec.go @@ -1,6 +1,7 @@ package codec import ( + "github.com/cortexproject/cortex/pkg/api/queryapi" "github.com/gogo/protobuf/proto" jsoniter "github.com/json-iterator/go" "github.com/prometheus/common/model" @@ -9,8 +10,11 @@ import ( "github.com/prometheus/prometheus/util/stats" v1 "github.com/prometheus/prometheus/web/api/v1" + "time" + "github.com/cortexproject/cortex/pkg/cortexpb" "github.com/cortexproject/cortex/pkg/querier/tripperware" + "github.com/cortexproject/cortex/pkg/util/analysis" ) type ProtobufCodec struct { @@ -48,7 +52,7 @@ func (p ProtobufCodec) Encode(resp *v1.Response) ([]byte, error) { } func createPrometheusQueryResponse(resp *v1.Response, cortexInternal bool) (*tripperware.PrometheusResponse, error) { - var data = resp.Data.(*v1.QueryData) + var data = resp.Data.(*queryapi.QueryData) var queryResult tripperware.PrometheusQueryResult switch string(data.ResultType) { @@ -82,12 +86,18 @@ func createPrometheusQueryResponse(resp *v1.Response, cortexInternal bool) (*tri stats = &tripperware.PrometheusResponseStats{Samples: getStats(&builtin)} } + var analyze *tripperware.Analysis + if data.Analysis != nil { + analyze = queryTelemetryToAnalysis(data.Analysis) + } + return &tripperware.PrometheusResponse{ Status: string(resp.Status), Data: tripperware.PrometheusData{ ResultType: string(data.ResultType), Result: queryResult, Stats: stats, + Analysis: analyze, }, ErrorType: string(resp.ErrorType), Error: resp.Error, @@ -95,7 +105,30 @@ func createPrometheusQueryResponse(resp *v1.Response, cortexInternal bool) (*tri }, nil } -func getMatrixSampleStreams(data *v1.QueryData) *[]tripperware.SampleStream { +func queryTelemetryToAnalysis(telemetry *analysis.QueryTelemetry) *tripperware.Analysis { + if telemetry == nil { + return nil + } + + duration, _ := time.ParseDuration(telemetry.Execution) + result := &tripperware.Analysis{ + Name: telemetry.OperatorName, + ExecutionTime: tripperware.Duration(duration), + PeakSamples: telemetry.PeakSamples, + TotalSamples: telemetry.TotalSamples, + } + + if len(telemetry.Children) > 0 { + result.Children = make([]*tripperware.Analysis, len(telemetry.Children)) + for i, child := range telemetry.Children { + result.Children[i] = queryTelemetryToAnalysis(&child) + } + } + + return result +} + +func getMatrixSampleStreams(data *queryapi.QueryData) *[]tripperware.SampleStream { sampleStreamsLen := len(data.Result.(promql.Matrix)) sampleStreams := make([]tripperware.SampleStream, sampleStreamsLen) @@ -150,7 +183,7 @@ func getMatrixSampleStreams(data *v1.QueryData) *[]tripperware.SampleStream { return &sampleStreams } -func getVectorSamples(data *v1.QueryData, cortexInternal bool) *[]tripperware.Sample { +func getVectorSamples(data *queryapi.QueryData, cortexInternal bool) *[]tripperware.Sample { vectorSamplesLen := len(data.Result.(promql.Vector)) vectorSamples := make([]tripperware.Sample, vectorSamplesLen) diff --git a/pkg/querier/tripperware/instantquery/instant_query.go b/pkg/querier/tripperware/instantquery/instant_query.go index 54fe4aeba0d..3e682b9ee01 100644 --- a/pkg/querier/tripperware/instantquery/instant_query.go +++ b/pkg/querier/tripperware/instantquery/instant_query.go @@ -71,6 +71,7 @@ func (c instantQueryCodec) DecodeRequest(_ context.Context, r *http.Request, for result.Query = r.FormValue("query") result.Stats = r.FormValue("stats") + result.Analyze = r.FormValue("analyze") result.Path = r.URL.Path isSourceRuler := strings.Contains(r.Header.Get("User-Agent"), tripperware.RulerUserAgent) @@ -155,6 +156,10 @@ func (c instantQueryCodec) EncodeRequest(ctx context.Context, r tripperware.Requ params.Add("stats", promReq.Stats) } + if promReq.Analyze != "" { + params.Add("analyze", promReq.Analyze) + } + u := &url.URL{ Path: promReq.Path, RawQuery: params.Encode(), diff --git a/pkg/querier/tripperware/merge.go b/pkg/querier/tripperware/merge.go index 0fd385cecf2..777e57e1ed5 100644 --- a/pkg/querier/tripperware/merge.go +++ b/pkg/querier/tripperware/merge.go @@ -43,7 +43,8 @@ func MergeResponse(ctx context.Context, sumStats bool, req Request, responses .. promResponses := make([]*PrometheusResponse, 0, len(responses)) warnings := make([][]string, 0, len(responses)) infos := make([][]string, 0, len(responses)) - for _, resp := range responses { + analyzes := make([]*Analysis, 0, len(responses)) + for i, resp := range responses { promResponses = append(promResponses, resp.(*PrometheusResponse)) if w := resp.(*PrometheusResponse).Warnings; w != nil { warnings = append(warnings, w) @@ -51,6 +52,9 @@ func MergeResponse(ctx context.Context, sumStats bool, req Request, responses .. if i := resp.(*PrometheusResponse).Infos; i != nil { infos = append(infos, i) } + if promResponses[i].GetData().Analysis != nil { + analyzes = append(analyzes, promResponses[i].GetData().Analysis) + } } // Check if it is a range query. Range query passed req as nil since @@ -73,7 +77,8 @@ func MergeResponse(ctx context.Context, sumStats bool, req Request, responses .. Vector: v, }, }, - Stats: statsMerge(sumStats, promResponses), + Stats: statsMerge(sumStats, promResponses), + Analysis: AnalyzesMerge(analyzes...), } case model.ValMatrix.String(): sampleStreams, err := matrixMerge(ctx, promResponses) @@ -90,7 +95,8 @@ func MergeResponse(ctx context.Context, sumStats bool, req Request, responses .. }, }, }, - Stats: statsMerge(sumStats, promResponses), + Stats: statsMerge(sumStats, promResponses), + Analysis: AnalyzesMerge(analyzes...), } default: return nil, fmt.Errorf("unexpected result type: %s", promResponses[0].Data.ResultType) @@ -258,6 +264,40 @@ func statsMerge(shouldSumStats bool, resps []*PrometheusResponse) *PrometheusRes return result } +func traverseAnalysis(a *Analysis, results *[]*Analysis) { + if a == nil { + return + } + + *results = append(*results, a) + + for _, ch := range a.Children { + traverseAnalysis(ch, results) + } +} + +func AnalyzesMerge(analysis ...*Analysis) *Analysis { + if len(analysis) == 0 { + return &Analysis{} + } + + root := analysis[0] + + var rootElements []*Analysis + traverseAnalysis(root, &rootElements) + + for _, a := range analysis[1:] { + var elements []*Analysis + traverseAnalysis(a, &elements) + + for i := 0; i < len(elements) && i < len(rootElements); i++ { + rootElements[i].ExecutionTime += analysis[i].ExecutionTime + } + } + + return root +} + type sortPlan int const ( diff --git a/pkg/querier/tripperware/query.go b/pkg/querier/tripperware/query.go index 580f4a5c826..1ac40c37083 100644 --- a/pkg/querier/tripperware/query.go +++ b/pkg/querier/tripperware/query.go @@ -6,6 +6,7 @@ import ( "context" "encoding/binary" "fmt" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" "io" "net/http" "strconv" @@ -155,6 +156,7 @@ type PrometheusRequest struct { Headers http.Header Stats string CachingOptions CachingOptions + Analyze string } func (m *PrometheusRequest) GetPath() string { @@ -519,6 +521,7 @@ func (s *PrometheusData) UnmarshalJSON(data []byte) error { var queryData struct { ResultType string `json:"resultType"` Stats *PrometheusResponseStats `json:"stats,omitempty"` + Analysis *Analysis `json:"analysis,omitempty"` } if err := json.Unmarshal(data, &queryData); err != nil { @@ -526,6 +529,7 @@ func (s *PrometheusData) UnmarshalJSON(data []byte) error { } s.ResultType = queryData.ResultType s.Stats = queryData.Stats + s.Analysis = queryData.Analysis switch s.ResultType { case model.ValVector.String(): var result struct { @@ -567,10 +571,12 @@ func (s *PrometheusData) MarshalJSON() ([]byte, error) { ResultType string `json:"resultType"` Data []Sample `json:"result"` Stats *PrometheusResponseStats `json:"stats,omitempty"` + Analysis *Analysis `json:"analysis,omitempty"` }{ ResultType: s.ResultType, Data: s.Result.GetVector().Samples, Stats: s.Stats, + Analysis: s.Analysis, } return json.Marshal(res) case model.ValMatrix.String(): @@ -578,10 +584,12 @@ func (s *PrometheusData) MarshalJSON() ([]byte, error) { ResultType string `json:"resultType"` Data []SampleStream `json:"result"` Stats *PrometheusResponseStats `json:"stats,omitempty"` + Analysis *Analysis `json:"analysis,omitempty"` }{ ResultType: s.ResultType, Data: s.Result.GetMatrix().SampleStreams, Stats: s.Stats, + Analysis: s.Analysis, } return json.Marshal(res) default: @@ -792,3 +800,51 @@ func UnmarshalResponse(r *http.Response, buf []byte, resp *PrometheusResponse) e return json.Unmarshal(buf, resp) } } + +type Duration time.Duration + +func (d Duration) MarshalJSON() ([]byte, error) { + return json.Marshal(time.Duration(d).String()) +} + +func (d *Duration) UnmarshalJSON(b []byte) error { + var v interface{} + if err := json.Unmarshal(b, &v); err != nil { + return err + } + switch value := v.(type) { + case float64: + *d = Duration(time.Duration(value)) + return nil + case string: + tmp, err := time.ParseDuration(value) + if err != nil { + return err + } + *d = Duration(tmp) + return nil + default: + return errors.New("invalid duration") + } +} + +func (d *Duration) Size() int { + return github_com_gogo_protobuf_types.SizeOfStdDuration(time.Duration(*d)) +} + +func (d *Duration) Unmarshal(b []byte) error { + var td time.Duration + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&td, b); err != nil { + return err + } + *d = Duration(td) + return nil +} + +func (d *Duration) MarshalTo(b []byte) (int, error) { + return github_com_gogo_protobuf_types.StdDurationMarshalTo(time.Duration(*d), b) +} + +func (d *Duration) Equal(b Duration) bool { + return *d == b +} diff --git a/pkg/querier/tripperware/query.pb.go b/pkg/querier/tripperware/query.pb.go index 5b493380f8a..7bd33562824 100644 --- a/pkg/querier/tripperware/query.pb.go +++ b/pkg/querier/tripperware/query.pb.go @@ -126,6 +126,7 @@ type PrometheusData struct { ResultType string `protobuf:"bytes,1,opt,name=ResultType,proto3" json:"resultType"` Result PrometheusQueryResult `protobuf:"bytes,2,opt,name=Result,proto3" json:"result"` Stats *PrometheusResponseStats `protobuf:"bytes,3,opt,name=stats,proto3" json:"stats,omitempty"` + Analysis *Analysis `protobuf:"bytes,4,opt,name=analysis,proto3" json:"analysis,omitempty"` } func (m *PrometheusData) Reset() { *m = PrometheusData{} } @@ -181,6 +182,13 @@ func (m *PrometheusData) GetStats() *PrometheusResponseStats { return nil } +func (m *PrometheusData) GetAnalysis() *Analysis { + if m != nil { + return m.Analysis + } + return nil +} + type CachedResponse struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key"` // List of cached responses; non-overlapping and in order. @@ -982,6 +990,74 @@ func (m *Matrix) GetSampleStreams() []SampleStream { return nil } +type Analysis struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` + ExecutionTime Duration `protobuf:"bytes,2,opt,name=executionTime,proto3,customtype=Duration" json:"executionTime"` + PeakSamples int64 `protobuf:"varint,3,opt,name=peakSamples,proto3" json:"peakSamples,omitempty"` + TotalSamples int64 `protobuf:"varint,4,opt,name=totalSamples,proto3" json:"totalSamples,omitempty"` + Children []*Analysis `protobuf:"bytes,99,rep,name=children,proto3" json:"children,omitempty"` +} + +func (m *Analysis) Reset() { *m = Analysis{} } +func (*Analysis) ProtoMessage() {} +func (*Analysis) Descriptor() ([]byte, []int) { + return fileDescriptor_5c6ac9b241082464, []int{16} +} +func (m *Analysis) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Analysis) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Analysis.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 *Analysis) XXX_Merge(src proto.Message) { + xxx_messageInfo_Analysis.Merge(m, src) +} +func (m *Analysis) XXX_Size() int { + return m.Size() +} +func (m *Analysis) XXX_DiscardUnknown() { + xxx_messageInfo_Analysis.DiscardUnknown(m) +} + +var xxx_messageInfo_Analysis proto.InternalMessageInfo + +func (m *Analysis) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Analysis) GetPeakSamples() int64 { + if m != nil { + return m.PeakSamples + } + return 0 +} + +func (m *Analysis) GetTotalSamples() int64 { + if m != nil { + return m.TotalSamples + } + return 0 +} + +func (m *Analysis) GetChildren() []*Analysis { + if m != nil { + return m.Children + } + return nil +} + func init() { proto.RegisterType((*PrometheusResponse)(nil), "tripperware.PrometheusResponse") proto.RegisterType((*PrometheusData)(nil), "tripperware.PrometheusData") @@ -999,90 +1075,99 @@ func init() { proto.RegisterType((*Vector)(nil), "tripperware.Vector") proto.RegisterType((*Sample)(nil), "tripperware.Sample") proto.RegisterType((*Matrix)(nil), "tripperware.Matrix") + proto.RegisterType((*Analysis)(nil), "tripperware.Analysis") } func init() { proto.RegisterFile("query.proto", fileDescriptor_5c6ac9b241082464) } var fileDescriptor_5c6ac9b241082464 = []byte{ - // 1233 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xc6, 0xf6, 0x26, 0x7e, 0x4e, 0x93, 0x32, 0xe9, 0x87, 0x53, 0xca, 0xae, 0x59, 0x81, - 0x14, 0x04, 0x75, 0x44, 0x2a, 0x40, 0x80, 0xa8, 0xe8, 0x42, 0x21, 0x2d, 0x94, 0xb6, 0x93, 0xaa, - 0x48, 0x5c, 0xaa, 0xb1, 0x3d, 0x75, 0x96, 0x78, 0x3f, 0x3a, 0x3b, 0xdb, 0xc4, 0x9c, 0x38, 0x73, - 0xe2, 0x8c, 0xc4, 0x81, 0x1b, 0x07, 0xfe, 0x90, 0x1c, 0x2b, 0x4e, 0x15, 0x12, 0x2b, 0xea, 0x5c, - 0xd0, 0x9e, 0xfa, 0x27, 0xa0, 0xf9, 0xd8, 0xf5, 0x3a, 0x71, 0x12, 0xf5, 0xc4, 0xc5, 0xd9, 0x79, - 0xef, 0xf7, 0x7b, 0x5f, 0xf3, 0xde, 0x9b, 0x40, 0x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98, - 0xa5, 0xf6, 0x0a, 0xcd, 0x85, 0x25, 0xc6, 0x04, 0x89, 0xde, 0x82, 0xba, 0x3c, 0xb4, 0x6a, 0x92, - 0xb2, 0x92, 0xa5, 0xf6, 0xb2, 0xa4, 0x94, 0xe0, 0x0a, 0x81, 0xbe, 0x80, 0xf9, 0x4d, 0x4a, 0xfa, - 0x94, 0xc5, 0xad, 0x7a, 0xbb, 0xba, 0xd6, 0xdc, 0x78, 0xf3, 0x98, 0x68, 0xf3, 0x02, 0x28, 0xb4, - 0x5b, 0xcf, 0x52, 0xdb, 0xb8, 0x82, 0x73, 0x32, 0xda, 0x80, 0x85, 0x6f, 0x09, 0x0b, 0xbc, 0x60, - 0x10, 0xb7, 0xcc, 0x76, 0x75, 0xad, 0xe1, 0x5e, 0xc8, 0x52, 0x1b, 0xed, 0x6a, 0x59, 0xc9, 0x71, - 0x81, 0x13, 0x61, 0xde, 0x0c, 0x1e, 0x85, 0x71, 0x6b, 0x5e, 0x12, 0x64, 0x98, 0x9e, 0x10, 0x94, - 0xc3, 0x94, 0x08, 0xe7, 0x6f, 0x03, 0x96, 0xa6, 0x2b, 0x87, 0x3a, 0x00, 0x98, 0xc6, 0xc9, 0x90, - 0xcb, 0xe2, 0xa8, 0xcb, 0x58, 0xca, 0x52, 0x1b, 0x58, 0x21, 0xc5, 0x25, 0x04, 0xba, 0x05, 0xa6, - 0x3a, 0xe9, 0x6b, 0x71, 0x8e, 0x49, 0xf4, 0x9e, 0x68, 0x4e, 0x85, 0x74, 0x97, 0xf4, 0xed, 0x98, - 0xca, 0x26, 0xd6, 0x16, 0xd0, 0x1d, 0xa8, 0x8b, 0x2b, 0x8f, 0xe5, 0x9d, 0x34, 0x37, 0xde, 0x38, - 0xa5, 0x66, 0xa2, 0x2d, 0x62, 0x95, 0x9f, 0xa4, 0x95, 0xf3, 0x93, 0x02, 0x67, 0x07, 0x96, 0x3e, - 0x23, 0xbd, 0x6d, 0xda, 0x2f, 0xfa, 0x6c, 0x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70, 0xf1, 0x98, 0x99, 0x46, 0x78, 0xd2, 0x10, 0x86, 0x2c, 0xe1, 0xdb, 0xa7, - 0xad, 0x02, 0x85, 0x56, 0x1b, 0xa1, 0x29, 0xc6, 0x53, 0xf3, 0x8b, 0x46, 0x71, 0xf6, 0xe7, 0xc0, - 0x3a, 0x99, 0x88, 0xee, 0xc0, 0x79, 0x1e, 0x72, 0x32, 0x94, 0xbb, 0x8a, 0x74, 0x87, 0xb9, 0x56, - 0x8f, 0xf1, 0x6a, 0x96, 0xda, 0xb3, 0x01, 0x78, 0xb6, 0x18, 0xfd, 0x66, 0xc0, 0xe5, 0x99, 0x9a, - 0xbb, 0x94, 0x6d, 0x71, 0x1a, 0xe9, 0x76, 0xff, 0xf8, 0x94, 0xec, 0x0e, 0xb3, 0x65, 0xb4, 0xda, - 0x84, 0xdb, 0xce, 0x52, 0xfb, 0x44, 0x27, 0xf8, 0x44, 0x2d, 0x7a, 0x17, 0x9a, 0x11, 0x25, 0x3b, - 0x79, 0xaa, 0x55, 0x99, 0xea, 0x72, 0x96, 0xda, 0x65, 0x31, 0x2e, 0x1f, 0x1c, 0x0f, 0x5e, 0x32, - 0x48, 0xd1, 0x01, 0x72, 0x70, 0xf5, 0xc4, 0xa8, 0xc3, 0x91, 0x71, 0x9a, 0x3b, 0x32, 0x4e, 0xce, - 0x7d, 0x68, 0x1d, 0xf7, 0x58, 0xa2, 0x55, 0xa8, 0x7d, 0x43, 0xfc, 0xfc, 0x91, 0xd2, 0x5b, 0x52, - 0x8a, 0xd0, 0x6b, 0x60, 0x3e, 0x90, 0x8b, 0x42, 0x56, 0xb8, 0x50, 0x6a, 0xa1, 0xf3, 0xab, 0x01, - 0xe7, 0x67, 0x3e, 0x4d, 0xe8, 0x0a, 0x98, 0x4f, 0x68, 0x8f, 0x87, 0x4c, 0x37, 0xde, 0xf4, 0x1b, - 0xf0, 0x40, 0xaa, 0x36, 0x2b, 0x58, 0x83, 0xd0, 0x65, 0x58, 0x60, 0x64,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x07, - 0x56, 0xe5, 0xe9, 0x81, 0x55, 0x79, 0x76, 0x60, 0x55, 0xbe, 0x2b, 0xff, 0x63, 0xdf, 0x35, 0xe5, - 0x7b, 0x7f, 0xf5, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, 0xa5, 0x92, 0x82, 0xfb, 0x0b, 0x00, - 0x00, + // 1376 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xfa, 0x63, 0xe3, 0x3c, 0xa7, 0x49, 0x99, 0xf4, 0xc3, 0x09, 0x61, 0xd7, 0x5d, 0x81, + 0x14, 0x04, 0x75, 0x44, 0x2a, 0x40, 0x50, 0x51, 0x91, 0xa5, 0x85, 0xb4, 0x50, 0xda, 0x4e, 0xa2, + 0x22, 0x71, 0xa9, 0xc6, 0xf6, 0xd4, 0x59, 0xe2, 0xdd, 0x75, 0x67, 0x67, 0x9b, 0x98, 0x13, 0x67, + 0x4e, 0x9c, 0x91, 0x38, 0x70, 0xe3, 0xd0, 0x3f, 0x24, 0xc7, 0x0a, 0x71, 0xa8, 0x38, 0xac, 0xa8, + 0x73, 0x41, 0x7b, 0xea, 0x9f, 0x80, 0xe6, 0x63, 0xed, 0x75, 0xe2, 0x24, 0xea, 0x89, 0xcb, 0x7a, + 0xde, 0x7b, 0xbf, 0xf7, 0x39, 0x6f, 0xde, 0x8c, 0xa1, 0xf6, 0x24, 0xa6, 0x6c, 0xd0, 0xec, 0xb3, + 0x90, 0x87, 0xa8, 0xc6, 0x99, 0xd7, 0xef, 0x53, 0xb6, 0x47, 0x18, 0x5d, 0xbe, 0xd0, 0x0d, 0xbb, + 0xa1, 0xe4, 0xaf, 0x89, 0x95, 0x82, 0x2c, 0x5b, 0xdd, 0x30, 0xec, 0xf6, 0xe8, 0x9a, 0xa4, 0x5a, + 0xf1, 0xe3, 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0xd2, 0x6a, 0xc6, 0x49, 0x13, 0x7b, 0xd2, 0x06, 0x9e, 0x24, 0xd1, 0xf5, + 0x69, 0x73, 0x40, 0x8e, 0xbc, 0x1c, 0x3b, 0xf7, 0xca, 0xca, 0xa3, 0xd1, 0x0d, 0x98, 0x93, 0x43, + 0x26, 0xd3, 0x2e, 0x4b, 0xed, 0xe5, 0x34, 0xb1, 0x2f, 0xe5, 0xf9, 0x39, 0xf5, 0x09, 0x3c, 0xba, + 0x0d, 0xd5, 0xf6, 0x8e, 0xd7, 0xeb, 0x30, 0x1a, 0xd4, 0xdb, 0xb2, 0x9a, 0x27, 0xbc, 0xfb, 0xe4, + 0x6b, 0x3a, 0x83, 0xe6, 0xdf, 0x7c, 0x19, 0xcf, 0xdd, 0x78, 0xfe, 0xd2, 0x2a, 0xbc, 0x78, 0x69, + 0x15, 0x5e, 0xbd, 0xb4, 0x8c, 0x9f, 0x86, 0x96, 0xf1, 0xc7, 0xd0, 0x32, 0x0e, 0x86, 0x96, 0xf1, + 0x7c, 0x68, 0x19, 0xff, 0x0c, 0x2d, 0xe3, 0xdf, 0xa1, 0x55, 0x78, 0x35, 0xb4, 0x8c, 0x5f, 0x0e, + 0xad, 0xc2, 0xf3, 0x43, 0xab, 0xf0, 0xe2, 0xd0, 0x2a, 0x7c, 0x9f, 0xff, 0xfb, 0xd5, 0x32, 0x65, + 0x3d, 0xaf, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x24, 0x4f, 0xc5, 0xa1, 0x0d, 0x00, 0x00, } func (this *PrometheusResponse) Equal(that interface{}) bool { @@ -1170,6 +1255,9 @@ func (this *PrometheusData) Equal(that interface{}) bool { if !this.Stats.Equal(that1.Stats) { return false } + if !this.Analysis.Equal(that1.Analysis) { + return false + } return true } func (this *CachedResponse) Equal(that interface{}) bool { @@ -1693,6 +1781,47 @@ func (this *Matrix) Equal(that interface{}) bool { } return true } +func (this *Analysis) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Analysis) + if !ok { + that2, ok := that.(Analysis) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if !this.ExecutionTime.Equal(that1.ExecutionTime) { + return false + } + if this.PeakSamples != that1.PeakSamples { + return false + } + if this.TotalSamples != that1.TotalSamples { + return false + } + if len(this.Children) != len(that1.Children) { + return false + } + for i := range this.Children { + if !this.Children[i].Equal(that1.Children[i]) { + return false + } + } + return true +} func (this *PrometheusResponse) GoString() string { if this == nil { return "nil" @@ -1715,13 +1844,16 @@ func (this *PrometheusData) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 7) + s := make([]string, 0, 8) s = append(s, "&tripperware.PrometheusData{") s = append(s, "ResultType: "+fmt.Sprintf("%#v", this.ResultType)+",\n") s = append(s, "Result: "+strings.Replace(this.Result.GoString(), `&`, ``, 1)+",\n") if this.Stats != nil { s = append(s, "Stats: "+fmt.Sprintf("%#v", this.Stats)+",\n") } + if this.Analysis != nil { + s = append(s, "Analysis: "+fmt.Sprintf("%#v", this.Analysis)+",\n") + } s = append(s, "}") return strings.Join(s, "") } @@ -1954,6 +2086,22 @@ func (this *Matrix) GoString() string { s = append(s, "}") return strings.Join(s, "") } +func (this *Analysis) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 9) + s = append(s, "&tripperware.Analysis{") + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "ExecutionTime: "+fmt.Sprintf("%#v", this.ExecutionTime)+",\n") + s = append(s, "PeakSamples: "+fmt.Sprintf("%#v", this.PeakSamples)+",\n") + s = append(s, "TotalSamples: "+fmt.Sprintf("%#v", this.TotalSamples)+",\n") + if this.Children != nil { + s = append(s, "Children: "+fmt.Sprintf("%#v", this.Children)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} func valueToGoStringQuery(v interface{}, typ string) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -2068,6 +2216,18 @@ func (m *PrometheusData) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Analysis != nil { + { + size, err := m.Analysis.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } if m.Stats != nil { { size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) @@ -2782,6 +2942,72 @@ func (m *Matrix) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *Analysis) 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 *Analysis) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Analysis) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Children) > 0 { + for iNdEx := len(m.Children) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Children[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6 + i-- + dAtA[i] = 0x9a + } + } + if m.TotalSamples != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.TotalSamples)) + i-- + dAtA[i] = 0x20 + } + if m.PeakSamples != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.PeakSamples)) + i-- + dAtA[i] = 0x18 + } + { + size := m.ExecutionTime.Size() + i -= size + if _, err := m.ExecutionTime.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2850,6 +3076,10 @@ func (m *PrometheusData) Size() (n int) { l = m.Stats.Size() n += 1 + l + sovQuery(uint64(l)) } + if m.Analysis != nil { + l = m.Analysis.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3151,6 +3381,33 @@ func (m *Matrix) Size() (n int) { return n } +func (m *Analysis) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = m.ExecutionTime.Size() + n += 1 + l + sovQuery(uint64(l)) + if m.PeakSamples != 0 { + n += 1 + sovQuery(uint64(m.PeakSamples)) + } + if m.TotalSamples != 0 { + n += 1 + sovQuery(uint64(m.TotalSamples)) + } + if len(m.Children) > 0 { + for _, e := range m.Children { + l = e.Size() + n += 2 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3186,6 +3443,7 @@ func (this *PrometheusData) String() string { `ResultType:` + fmt.Sprintf("%v", this.ResultType) + `,`, `Result:` + strings.Replace(strings.Replace(this.Result.String(), "PrometheusQueryResult", "PrometheusQueryResult", 1), `&`, ``, 1) + `,`, `Stats:` + strings.Replace(this.Stats.String(), "PrometheusResponseStats", "PrometheusResponseStats", 1) + `,`, + `Analysis:` + strings.Replace(this.Analysis.String(), "Analysis", "Analysis", 1) + `,`, `}`, }, "") return s @@ -3414,6 +3672,25 @@ func (this *Matrix) String() string { }, "") return s } +func (this *Analysis) String() string { + if this == nil { + return "nil" + } + repeatedStringForChildren := "[]*Analysis{" + for _, f := range this.Children { + repeatedStringForChildren += strings.Replace(f.String(), "Analysis", "Analysis", 1) + "," + } + repeatedStringForChildren += "}" + s := strings.Join([]string{`&Analysis{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `ExecutionTime:` + fmt.Sprintf("%v", this.ExecutionTime) + `,`, + `PeakSamples:` + fmt.Sprintf("%v", this.PeakSamples) + `,`, + `TotalSamples:` + fmt.Sprintf("%v", this.TotalSamples) + `,`, + `Children:` + repeatedStringForChildren + `,`, + `}`, + }, "") + return s +} func valueToStringQuery(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -3832,6 +4109,42 @@ func (m *PrometheusData) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Analysis", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Analysis == nil { + m.Analysis = &Analysis{} + } + if err := m.Analysis.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -5555,6 +5868,196 @@ func (m *Matrix) Unmarshal(dAtA []byte) error { } return nil } +func (m *Analysis) 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 ErrIntOverflowQuery + } + 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: Analysis: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Analysis: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ExecutionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + 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 ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PeakSamples |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalSamples", wireType) + } + m.TotalSamples = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalSamples |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 99: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Children", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Children = append(m.Children, &Analysis{}) + if err := m.Children[len(m.Children)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/pkg/querier/tripperware/query.proto b/pkg/querier/tripperware/query.proto index afef3d692bd..b26fe72d4e1 100644 --- a/pkg/querier/tripperware/query.proto +++ b/pkg/querier/tripperware/query.proto @@ -26,6 +26,7 @@ message PrometheusData { string ResultType = 1 [(gogoproto.jsontag) = "resultType"]; tripperware.PrometheusQueryResult Result = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "result"]; tripperware.PrometheusResponseStats stats = 3 [(gogoproto.jsontag) = "stats,omitempty"]; + Analysis analysis = 4 [(gogoproto.jsontag) = "analysis,omitempty", (gogoproto.nullable) = true]; } message CachedResponse { @@ -112,3 +113,11 @@ message Sample { message Matrix { repeated SampleStream sampleStreams = 1 [(gogoproto.nullable) = false]; } + +message Analysis { + string name = 1 [(gogoproto.jsontag) = "name"]; + google.protobuf.Duration executionTime = 2 [(gogoproto.customtype) = "Duration", (gogoproto.nullable) = false, (gogoproto.jsontag) = "executionTime"]; + int64 peakSamples = 3 [(gogoproto.jsontag) = "peakSamples,omitempty"]; + int64 totalSamples = 4 [(gogoproto.jsontag) = "totalSamples,omitempty"]; + repeated Analysis children = 99 [(gogoproto.jsontag) = "children,omitempty"]; +} diff --git a/pkg/querier/tripperware/queryrange/query_range.go b/pkg/querier/tripperware/queryrange/query_range.go index 9d82031fc0b..a988d83189e 100644 --- a/pkg/querier/tripperware/queryrange/query_range.go +++ b/pkg/querier/tripperware/queryrange/query_range.go @@ -129,6 +129,7 @@ func (c prometheusCodec) DecodeRequest(_ context.Context, r *http.Request, forwa result.Query = r.FormValue("query") result.Stats = r.FormValue("stats") + result.Analyze = r.FormValue("analyze") result.Path = r.URL.Path // Include the specified headers from http request in prometheusRequest. @@ -163,6 +164,9 @@ func (c prometheusCodec) EncodeRequest(ctx context.Context, r tripperware.Reques "query": []string{promReq.Query}, "stats": []string{promReq.Stats}, } + if promReq.Analyze != "" { + params.Add("analyze", promReq.Analyze) + } u := &url.URL{ Path: promReq.Path, RawQuery: params.Encode(), diff --git a/pkg/util/analysis/analysis.go b/pkg/util/analysis/analysis.go new file mode 100644 index 00000000000..cb5bd5c3cdb --- /dev/null +++ b/pkg/util/analysis/analysis.go @@ -0,0 +1,11 @@ +package analysis + +type QueryTelemetry struct { + // TODO(saswatamcode): Replace with engine.TrackedTelemetry once it has exported fields. + // TODO(saswatamcode): Add aggregate fields to enrich data. + OperatorName string `json:"name,omitempty"` + Execution string `json:"executionTime,omitempty"` + PeakSamples int64 `json:"peakSamples,omitempty"` + TotalSamples int64 `json:"totalSamples,omitempty"` + Children []QueryTelemetry `json:"children,omitempty"` +} From cfca111f6b54ac7cbfebf1453274c7dc65ae1c91 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Fri, 6 Jun 2025 05:38:05 +0000 Subject: [PATCH 2/3] add more analyze fields Signed-off-by: Ben Ye --- go.mod | 3 +- go.sum | 4 +- pkg/api/queryapi/query_api.go | 14 +- pkg/querier/codec/protobuf_codec.go | 13 +- pkg/querier/tripperware/merge.go | 5 + pkg/querier/tripperware/query.go | 2 +- pkg/querier/tripperware/query.pb.go | 338 +++++++++++++----- pkg/querier/tripperware/query.proto | 7 +- pkg/util/analysis/analysis.go | 15 +- .../execution/aggregate/accumulator.go | 6 + .../execution/aggregate/count_values.go | 13 +- .../execution/aggregate/hashaggregate.go | 14 +- .../execution/aggregate/khashaggregate.go | 14 +- .../promql-engine/execution/binary/scalar.go | 16 +- .../promql-engine/execution/binary/vector.go | 13 +- .../execution/exchange/coalesce.go | 13 +- .../execution/exchange/concurrent.go | 17 +- .../promql-engine/execution/exchange/dedup.go | 13 +- .../execution/exchange/duplicate_label.go | 19 +- .../execution/function/absent.go | 15 +- .../execution/function/histogram.go | 15 +- .../promql-engine/execution/function/noarg.go | 10 - .../execution/function/operator.go | 16 +- .../execution/function/relabel.go | 15 +- .../execution/function/scalar.go | 13 +- .../execution/function/timestamp.go | 14 +- .../execution/remote/operator.go | 21 +- .../execution/scan/literal_selector.go | 13 +- .../promql-engine/execution/scan/subquery.go | 18 +- .../step_invariant/step_invariant.go | 11 +- .../execution/telemetry/telemetry.go | 103 +++++- .../promql-engine/execution/unary/unary.go | 12 +- .../promql-engine/ringbuffer/generic.go | 14 + .../promql-engine/ringbuffer/rate.go | 18 +- .../storage/prometheus/matrix_selector.go | 14 +- .../storage/prometheus/vector_selector.go | 19 +- vendor/modules.txt | 4 +- 37 files changed, 478 insertions(+), 406 deletions(-) diff --git a/go.mod b/go.mod index 2443c8de78f..35773cdffd7 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( github.com/spf13/afero v1.11.0 github.com/stretchr/testify v1.10.0 github.com/thanos-io/objstore v0.0.0-20250317105316-a0136a6f898d - github.com/thanos-io/promql-engine v0.0.0-20250522103302-dd83bd8fdb50 + github.com/thanos-io/promql-engine v0.0.0-20250605204400-0c7d03a38861 github.com/thanos-io/thanos v0.37.3-0.20250603135757-4ad45948cd10 github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/weaveworks/common v0.0.0-20230728070032-dd9e68f319d5 @@ -136,7 +136,6 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/edsrzf/mmap-go v1.2.0 // indirect github.com/efficientgo/tools/extkingpin v0.0.0-20230505153745-6b7392939a60 // indirect - github.com/envoyproxy/go-control-plane v0.12.0 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect diff --git a/go.sum b/go.sum index abe004c1355..f0b94973cc8 100644 --- a/go.sum +++ b/go.sum @@ -1695,8 +1695,8 @@ github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e h1:f1 github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e/go.mod h1:jXcofnrSln/cLI6/dhlBxPQZEEQHVPCcFaH75M+nSzM= github.com/thanos-io/objstore v0.0.0-20241111205755-d1dd89d41f97 h1:VjG0mwhN1DkncwDHFvrpd12/2TLfgYNRmEQA48ikp+0= github.com/thanos-io/objstore v0.0.0-20241111205755-d1dd89d41f97/go.mod h1:vyzFrBXgP+fGNG2FopEGWOO/zrIuoy7zt3LpLeezRsw= -github.com/thanos-io/promql-engine v0.0.0-20250522103302-dd83bd8fdb50 h1:RGdaDAyFOjrFJSjaPT2z8robLvQ3KxNiNEN3DojpLOs= -github.com/thanos-io/promql-engine v0.0.0-20250522103302-dd83bd8fdb50/go.mod h1:agUazAk1yHLYSL87MdEcRbjN12DJ9OZfSUcfFLqy+F8= +github.com/thanos-io/promql-engine v0.0.0-20250605204400-0c7d03a38861 h1:vatMMwRfIBjVK8Jkq2hdufIbmXGzCv0mUfPzF6SvO4Q= +github.com/thanos-io/promql-engine v0.0.0-20250605204400-0c7d03a38861/go.mod h1:agUazAk1yHLYSL87MdEcRbjN12DJ9OZfSUcfFLqy+F8= github.com/thanos-io/thanos v0.37.3-0.20250603135757-4ad45948cd10 h1:mtmcivEm0EoXeHTJAgjXTthyQSTLNFWrPTzpiovau3Y= github.com/thanos-io/thanos v0.37.3-0.20250603135757-4ad45948cd10/go.mod h1:2NvA8ZJtoGcOTriumDnJQzDmbxJz1ISGPovVAGGYDbg= github.com/tjhop/slog-gokit v0.1.4 h1:uj/vbDt3HaF0Py8bHPV4ti/s0utnO0miRbO277FLBKM= diff --git a/pkg/api/queryapi/query_api.go b/pkg/api/queryapi/query_api.go index 7db6e5223da..7e6d7d5cfa8 100644 --- a/pkg/api/queryapi/query_api.go +++ b/pkg/api/queryapi/query_api.go @@ -3,28 +3,27 @@ package queryapi import ( "context" "fmt" - "github.com/pkg/errors" - "github.com/prometheus/prometheus/promql/parser" - "github.com/prometheus/prometheus/util/stats" "net/http" "time" - "github.com/cortexproject/cortex/pkg/util/analysis" - thanosengine "github.com/thanos-io/promql-engine/engine" - "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/grafana/regexp" "github.com/munnerz/goautoneg" + "github.com/pkg/errors" "github.com/prometheus/prometheus/promql" + "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/util/annotations" "github.com/prometheus/prometheus/util/httputil" + "github.com/prometheus/prometheus/util/stats" v1 "github.com/prometheus/prometheus/web/api/v1" + thanosengine "github.com/thanos-io/promql-engine/engine" "github.com/weaveworks/common/httpgrpc" "github.com/cortexproject/cortex/pkg/engine" "github.com/cortexproject/cortex/pkg/util" + "github.com/cortexproject/cortex/pkg/util/analysis" "github.com/cortexproject/cortex/pkg/util/api" ) @@ -305,6 +304,9 @@ func processAnalysis(a *thanosengine.AnalyzeOutputNode) analysis.QueryTelemetry var analysis analysis.QueryTelemetry analysis.OperatorName = a.OperatorTelemetry.String() analysis.Execution = a.OperatorTelemetry.ExecutionTimeTaken().String() + analysis.SeriesExecution = a.OperatorTelemetry.SeriesExecutionTime().String() + analysis.SamplesExecution = a.OperatorTelemetry.NextExecutionTime().String() + analysis.Series = a.OperatorTelemetry.MaxSeriesCount() analysis.PeakSamples = a.PeakSamples() analysis.TotalSamples = a.TotalSamples() for _, c := range a.Children { diff --git a/pkg/querier/codec/protobuf_codec.go b/pkg/querier/codec/protobuf_codec.go index 44fc6096bc4..1f427cb442e 100644 --- a/pkg/querier/codec/protobuf_codec.go +++ b/pkg/querier/codec/protobuf_codec.go @@ -111,11 +111,16 @@ func queryTelemetryToAnalysis(telemetry *analysis.QueryTelemetry) *tripperware.A } duration, _ := time.ParseDuration(telemetry.Execution) + seriesDuration, _ := time.ParseDuration(telemetry.SeriesExecution) + samplesDuration, _ := time.ParseDuration(telemetry.SamplesExecution) result := &tripperware.Analysis{ - Name: telemetry.OperatorName, - ExecutionTime: tripperware.Duration(duration), - PeakSamples: telemetry.PeakSamples, - TotalSamples: telemetry.TotalSamples, + Name: telemetry.OperatorName, + ExecutionTime: tripperware.Duration(duration), + SeriesExecutionTime: tripperware.Duration(seriesDuration), + SamplesExecutionTime: tripperware.Duration(samplesDuration), + Series: int64(telemetry.Series), + PeakSamples: telemetry.PeakSamples, + TotalSamples: telemetry.TotalSamples, } if len(telemetry.Children) > 0 { diff --git a/pkg/querier/tripperware/merge.go b/pkg/querier/tripperware/merge.go index 777e57e1ed5..b03fadf5197 100644 --- a/pkg/querier/tripperware/merge.go +++ b/pkg/querier/tripperware/merge.go @@ -292,6 +292,11 @@ func AnalyzesMerge(analysis ...*Analysis) *Analysis { for i := 0; i < len(elements) && i < len(rootElements); i++ { rootElements[i].ExecutionTime += analysis[i].ExecutionTime + rootElements[i].SeriesExecutionTime += analysis[i].SeriesExecutionTime + rootElements[i].SamplesExecutionTime += analysis[i].SamplesExecutionTime + rootElements[i].Series += analysis[i].Series + rootElements[i].PeakSamples += analysis[i].PeakSamples + rootElements[i].TotalSamples += analysis[i].TotalSamples } } diff --git a/pkg/querier/tripperware/query.go b/pkg/querier/tripperware/query.go index 1ac40c37083..add19cfd463 100644 --- a/pkg/querier/tripperware/query.go +++ b/pkg/querier/tripperware/query.go @@ -6,7 +6,6 @@ import ( "context" "encoding/binary" "fmt" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" "io" "net/http" "strconv" @@ -16,6 +15,7 @@ import ( "github.com/go-kit/log" "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" jsoniter "github.com/json-iterator/go" "github.com/opentracing/opentracing-go" otlog "github.com/opentracing/opentracing-go/log" diff --git a/pkg/querier/tripperware/query.pb.go b/pkg/querier/tripperware/query.pb.go index 7bd33562824..6457e0c0d43 100644 --- a/pkg/querier/tripperware/query.pb.go +++ b/pkg/querier/tripperware/query.pb.go @@ -991,11 +991,14 @@ func (m *Matrix) GetSampleStreams() []SampleStream { } type Analysis struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` - ExecutionTime Duration `protobuf:"bytes,2,opt,name=executionTime,proto3,customtype=Duration" json:"executionTime"` - PeakSamples int64 `protobuf:"varint,3,opt,name=peakSamples,proto3" json:"peakSamples,omitempty"` - TotalSamples int64 `protobuf:"varint,4,opt,name=totalSamples,proto3" json:"totalSamples,omitempty"` - Children []*Analysis `protobuf:"bytes,99,rep,name=children,proto3" json:"children,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` + ExecutionTime Duration `protobuf:"bytes,2,opt,name=executionTime,proto3,customtype=Duration" json:"executionTime"` + SeriesExecutionTime Duration `protobuf:"bytes,3,opt,name=seriesExecutionTime,proto3,customtype=Duration" json:"seriesExecutionTime"` + SamplesExecutionTime Duration `protobuf:"bytes,4,opt,name=samplesExecutionTime,proto3,customtype=Duration" json:"samplesExecutionTime"` + PeakSamples int64 `protobuf:"varint,5,opt,name=peakSamples,proto3" json:"peakSamples,omitempty"` + TotalSamples int64 `protobuf:"varint,6,opt,name=totalSamples,proto3" json:"totalSamples,omitempty"` + Series int64 `protobuf:"varint,7,opt,name=series,proto3" json:"series,omitempty"` + Children []*Analysis `protobuf:"bytes,99,rep,name=children,proto3" json:"children,omitempty"` } func (m *Analysis) Reset() { *m = Analysis{} } @@ -1051,6 +1054,13 @@ func (m *Analysis) GetTotalSamples() int64 { return 0 } +func (m *Analysis) GetSeries() int64 { + if m != nil { + return m.Series + } + return 0 +} + func (m *Analysis) GetChildren() []*Analysis { if m != nil { return m.Children @@ -1081,93 +1091,97 @@ func init() { func init() { proto.RegisterFile("query.proto", fileDescriptor_5c6ac9b241082464) } var fileDescriptor_5c6ac9b241082464 = []byte{ - // 1376 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xfa, 0x63, 0xe3, 0x3c, 0xa7, 0x49, 0x99, 0xf4, 0xc3, 0x09, 0x61, 0xd7, 0x5d, 0x81, - 0x14, 0x04, 0x75, 0x44, 0x2a, 0x40, 0x50, 0x51, 0x91, 0xa5, 0x85, 0xb4, 0x50, 0xda, 0x4e, 0xa2, - 0x22, 0x71, 0xa9, 0xc6, 0xf6, 0xd4, 0x59, 0xe2, 0xdd, 0x75, 0x67, 0x67, 0x9b, 0x98, 0x13, 0x67, - 0x4e, 0x9c, 0x91, 0x38, 0x70, 0xe3, 0xd0, 0x3f, 0x24, 0xc7, 0x0a, 0x71, 0xa8, 0x38, 0xac, 0xa8, - 0x73, 0x41, 0x7b, 0xea, 0x9f, 0x80, 0xe6, 0x63, 0xed, 0x75, 0xe2, 0x24, 0xea, 0x89, 0xcb, 0x7a, - 0xde, 0x7b, 0xbf, 0xf7, 0x39, 0x6f, 0xde, 0x8c, 0xa1, 0xf6, 0x24, 0xa6, 0x6c, 0xd0, 0xec, 0xb3, - 0x90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81, 0x68, 0x1f, 0x16, 0x74, 0xd7, 0x16, 0xdd, 0x56, + 0xce, 0x73, 0xbb, 0x3a, 0xc6, 0xed, 0x58, 0x53, 0x78, 0x2c, 0x8a, 0x6e, 0x14, 0xc7, 0x5e, 0x75, + 0x34, 0xe1, 0x73, 0x70, 0xee, 0xa5, 0x32, 0xcf, 0x46, 0x37, 0x61, 0x5a, 0xce, 0xd4, 0x4c, 0xdb, + 0x94, 0xda, 0x4b, 0x69, 0x62, 0x5f, 0xca, 0xe3, 0x39, 0xf5, 0x02, 0x1f, 0x5d, 0x05, 0x53, 0x25, + 0xa3, 0x31, 0x29, 0x35, 0x17, 0xd2, 0xc4, 0x9e, 0x53, 0x48, 0x4e, 0x47, 0x73, 0xd0, 0x6d, 0xa8, + 0xb5, 0x77, 0xbd, 0x5e, 0x87, 0xd1, 0xa0, 0xd1, 0x96, 0xad, 0x76, 0xca, 0x4b, 0xb1, 0xfc, 0xd4, + 0xc8, 0xa8, 0xf9, 0x17, 0xe2, 0x0c, 0x73, 0x37, 0x9e, 0xbf, 0xb4, 0x4a, 0x2f, 0x5e, 0x5a, 0xa5, + 0xd7, 0x2f, 0x2d, 0xe3, 0x87, 0x81, 0x65, 0xfc, 0x36, 0xb0, 0x8c, 0xa3, 0x81, 0x65, 0x3c, 0x1f, + 0x58, 0xc6, 0x9f, 0x03, 0xcb, 0xf8, 0x6b, 0x60, 0x95, 0x5e, 0x0f, 0x2c, 0xe3, 0xa7, 0x57, 0x56, + 0xe9, 0xf9, 0x2b, 0xab, 0xf4, 0xe2, 0x95, 0x55, 0xfa, 0x36, 0xff, 0x6d, 0xda, 0x32, 0x65, 0x2d, + 0xae, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0x86, 0xb1, 0xcb, 0xe2, 0xbe, 0x0e, 0x00, 0x00, } func (this *PrometheusResponse) Equal(that interface{}) bool { @@ -1806,12 +1820,21 @@ func (this *Analysis) Equal(that interface{}) bool { if !this.ExecutionTime.Equal(that1.ExecutionTime) { return false } + if !this.SeriesExecutionTime.Equal(that1.SeriesExecutionTime) { + return false + } + if !this.SamplesExecutionTime.Equal(that1.SamplesExecutionTime) { + return false + } if this.PeakSamples != that1.PeakSamples { return false } if this.TotalSamples != that1.TotalSamples { return false } + if this.Series != that1.Series { + return false + } if len(this.Children) != len(that1.Children) { return false } @@ -2090,12 +2113,15 @@ func (this *Analysis) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 9) + s := make([]string, 0, 12) s = append(s, "&tripperware.Analysis{") s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") s = append(s, "ExecutionTime: "+fmt.Sprintf("%#v", this.ExecutionTime)+",\n") + s = append(s, "SeriesExecutionTime: "+fmt.Sprintf("%#v", this.SeriesExecutionTime)+",\n") + s = append(s, "SamplesExecutionTime: "+fmt.Sprintf("%#v", this.SamplesExecutionTime)+",\n") s = append(s, "PeakSamples: "+fmt.Sprintf("%#v", this.PeakSamples)+",\n") s = append(s, "TotalSamples: "+fmt.Sprintf("%#v", this.TotalSamples)+",\n") + s = append(s, "Series: "+fmt.Sprintf("%#v", this.Series)+",\n") if this.Children != nil { s = append(s, "Children: "+fmt.Sprintf("%#v", this.Children)+",\n") } @@ -2978,16 +3004,41 @@ func (m *Analysis) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x9a } } + if m.Series != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Series)) + i-- + dAtA[i] = 0x38 + } if m.TotalSamples != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.TotalSamples)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x30 } if m.PeakSamples != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.PeakSamples)) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x28 } + { + size := m.SamplesExecutionTime.Size() + i -= size + if _, err := m.SamplesExecutionTime.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.SeriesExecutionTime.Size() + i -= size + if _, err := m.SeriesExecutionTime.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a { size := m.ExecutionTime.Size() i -= size @@ -3393,12 +3444,19 @@ func (m *Analysis) Size() (n int) { } l = m.ExecutionTime.Size() n += 1 + l + sovQuery(uint64(l)) + l = m.SeriesExecutionTime.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.SamplesExecutionTime.Size() + n += 1 + l + sovQuery(uint64(l)) if m.PeakSamples != 0 { n += 1 + sovQuery(uint64(m.PeakSamples)) } if m.TotalSamples != 0 { n += 1 + sovQuery(uint64(m.TotalSamples)) } + if m.Series != 0 { + n += 1 + sovQuery(uint64(m.Series)) + } if len(m.Children) > 0 { for _, e := range m.Children { l = e.Size() @@ -3684,8 +3742,11 @@ func (this *Analysis) String() string { s := strings.Join([]string{`&Analysis{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `ExecutionTime:` + fmt.Sprintf("%v", this.ExecutionTime) + `,`, + `SeriesExecutionTime:` + fmt.Sprintf("%v", this.SeriesExecutionTime) + `,`, + `SamplesExecutionTime:` + fmt.Sprintf("%v", this.SamplesExecutionTime) + `,`, `PeakSamples:` + fmt.Sprintf("%v", this.PeakSamples) + `,`, `TotalSamples:` + fmt.Sprintf("%v", this.TotalSamples) + `,`, + `Series:` + fmt.Sprintf("%v", this.Series) + `,`, `Children:` + repeatedStringForChildren + `,`, `}`, }, "") @@ -5963,6 +6024,72 @@ func (m *Analysis) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SeriesExecutionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SeriesExecutionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SamplesExecutionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SamplesExecutionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PeakSamples", wireType) } @@ -5981,7 +6108,7 @@ func (m *Analysis) Unmarshal(dAtA []byte) error { break } } - case 4: + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field TotalSamples", wireType) } @@ -6000,6 +6127,25 @@ func (m *Analysis) Unmarshal(dAtA []byte) error { break } } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Series", wireType) + } + m.Series = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Series |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } case 99: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Children", wireType) diff --git a/pkg/querier/tripperware/query.proto b/pkg/querier/tripperware/query.proto index b26fe72d4e1..2054800d58e 100644 --- a/pkg/querier/tripperware/query.proto +++ b/pkg/querier/tripperware/query.proto @@ -117,7 +117,10 @@ message Matrix { message Analysis { string name = 1 [(gogoproto.jsontag) = "name"]; google.protobuf.Duration executionTime = 2 [(gogoproto.customtype) = "Duration", (gogoproto.nullable) = false, (gogoproto.jsontag) = "executionTime"]; - int64 peakSamples = 3 [(gogoproto.jsontag) = "peakSamples,omitempty"]; - int64 totalSamples = 4 [(gogoproto.jsontag) = "totalSamples,omitempty"]; + google.protobuf.Duration seriesExecutionTime = 3 [(gogoproto.customtype) = "Duration", (gogoproto.nullable) = false, (gogoproto.jsontag) = "seriesExecutionTime"]; + google.protobuf.Duration samplesExecutionTime = 4 [(gogoproto.customtype) = "Duration", (gogoproto.nullable) = false, (gogoproto.jsontag) = "samplesExecutionTime"]; + int64 peakSamples = 5 [(gogoproto.jsontag) = "peakSamples,omitempty"]; + int64 totalSamples = 6 [(gogoproto.jsontag) = "totalSamples,omitempty"]; + int64 series = 7 [(gogoproto.jsontag) = "series,omitempty"]; repeated Analysis children = 99 [(gogoproto.jsontag) = "children,omitempty"]; } diff --git a/pkg/util/analysis/analysis.go b/pkg/util/analysis/analysis.go index cb5bd5c3cdb..38a44c1f18c 100644 --- a/pkg/util/analysis/analysis.go +++ b/pkg/util/analysis/analysis.go @@ -1,11 +1,12 @@ package analysis type QueryTelemetry struct { - // TODO(saswatamcode): Replace with engine.TrackedTelemetry once it has exported fields. - // TODO(saswatamcode): Add aggregate fields to enrich data. - OperatorName string `json:"name,omitempty"` - Execution string `json:"executionTime,omitempty"` - PeakSamples int64 `json:"peakSamples,omitempty"` - TotalSamples int64 `json:"totalSamples,omitempty"` - Children []QueryTelemetry `json:"children,omitempty"` + OperatorName string `json:"name,omitempty"` + Execution string `json:"executionTime,omitempty"` + SeriesExecution string `json:"seriesExecutionTime,omitempty"` + SamplesExecution string `json:"samplesExecutionTime,omitempty"` + Series int `json:"series,omitempty"` + PeakSamples int64 `json:"peakSamples,omitempty"` + TotalSamples int64 `json:"totalSamples,omitempty"` + Children []QueryTelemetry `json:"children,omitempty"` } diff --git a/vendor/github.com/thanos-io/promql-engine/execution/aggregate/accumulator.go b/vendor/github.com/thanos-io/promql-engine/execution/aggregate/accumulator.go index e96f6f306ee..ffb4780bdab 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/aggregate/accumulator.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/aggregate/accumulator.go @@ -105,6 +105,9 @@ func (s *sumAcc) Add(ctx context.Context, v float64, h *histogram.FloatHistogram } func (s *sumAcc) Value() (float64, *histogram.FloatHistogram) { + if s.histSum != nil { + s.histSum.Compact(0) + } return s.value, s.histSum } @@ -451,6 +454,9 @@ func (a *avgAcc) AddVector(ctx context.Context, vs []float64, hs []*histogram.Fl } func (a *avgAcc) Value() (float64, *histogram.FloatHistogram) { + if a.histSum != nil { + a.histSum.Compact(0) + } if a.incremental { return a.avg + a.kahanC, a.histSum } diff --git a/vendor/github.com/thanos-io/promql-engine/execution/aggregate/count_values.go b/vendor/github.com/thanos-io/promql-engine/execution/aggregate/count_values.go index 8c9e121e063..84e861b7f5f 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/aggregate/count_values.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/aggregate/count_values.go @@ -9,7 +9,6 @@ import ( "slices" "strconv" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -19,8 +18,6 @@ import ( ) type countValuesOperator struct { - telemetry.OperatorTelemetry - pool *model.VectorPool next model.VectorOperator param string @@ -51,9 +48,7 @@ func NewCountValues(pool *model.VectorPool, next model.VectorOperator, param str by: by, grouping: grouping, } - op.OperatorTelemetry = telemetry.NewTelemetry(op, opts) - - return op + return telemetry.NewOperator(telemetry.NewTelemetry(op, opts), op) } func (c *countValuesOperator) Explain() []model.VectorOperator { @@ -72,18 +67,12 @@ func (c *countValuesOperator) String() string { } func (c *countValuesOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { c.AddExecutionTimeTaken(time.Since(start)) }() - var err error c.once.Do(func() { err = c.initSeriesOnce(ctx) }) return c.series, err } func (c *countValuesOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { c.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/aggregate/hashaggregate.go b/vendor/github.com/thanos-io/promql-engine/execution/aggregate/hashaggregate.go index 9155d771ee5..977944f514f 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/aggregate/hashaggregate.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/aggregate/hashaggregate.go @@ -8,7 +8,6 @@ import ( "fmt" "math" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/parse" @@ -25,8 +24,6 @@ import ( ) type aggregate struct { - telemetry.OperatorTelemetry - next model.VectorOperator paramOp model.VectorOperator // params holds the aggregate parameter for each step. @@ -74,9 +71,7 @@ func NewHashAggregate( stepsBatch: opts.StepsBatch, } - a.OperatorTelemetry = telemetry.NewTelemetry(a, opts) - - return a, nil + return telemetry.NewOperator(telemetry.NewTelemetry(a, opts), a), nil } func (a *aggregate) String() string { @@ -96,15 +91,11 @@ func (a *aggregate) Explain() (next []model.VectorOperator) { } func (a *aggregate) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { a.AddExecutionTimeTaken(time.Since(start)) }() - var err error a.once.Do(func() { err = a.initializeTables(ctx) }) if err != nil { return nil, err } - return a.series, nil } @@ -113,9 +104,6 @@ func (a *aggregate) GetPool() *model.VectorPool { } func (a *aggregate) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { a.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/aggregate/khashaggregate.go b/vendor/github.com/thanos-io/promql-engine/execution/aggregate/khashaggregate.go index e59c48e79a2..5c3120e4f57 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/aggregate/khashaggregate.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/aggregate/khashaggregate.go @@ -10,7 +10,6 @@ import ( "math" "sort" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -27,8 +26,6 @@ import ( ) type kAggregate struct { - telemetry.OperatorTelemetry - next model.VectorOperator paramOp model.VectorOperator // params holds the aggregate parameter for each step. @@ -84,15 +81,10 @@ func NewKHashAggregate( params: make([]float64, opts.StepsBatch), } - op.OperatorTelemetry = telemetry.NewTelemetry(op, opts) - - return op, nil + return telemetry.NewOperator(telemetry.NewTelemetry(op, opts), op), nil } func (a *kAggregate) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { a.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() @@ -174,15 +166,11 @@ func (a *kAggregate) Next(ctx context.Context) ([]model.StepVector, error) { } func (a *kAggregate) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { a.AddExecutionTimeTaken(time.Since(start)) }() - var err error a.once.Do(func() { err = a.init(ctx) }) if err != nil { return nil, err } - return a.series, nil } diff --git a/vendor/github.com/thanos-io/promql-engine/execution/binary/scalar.go b/vendor/github.com/thanos-io/promql-engine/execution/binary/scalar.go index 89a07a8784c..ab5a15feed8 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/binary/scalar.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/binary/scalar.go @@ -8,7 +8,6 @@ import ( "fmt" "math" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -29,8 +28,6 @@ const ( // scalarOperator evaluates expressions where one operand is a scalarOperator. type scalarOperator struct { - telemetry.OperatorTelemetry - seriesOnce sync.Once series []labels.Labels @@ -58,7 +55,7 @@ func NewScalar( scalarSide ScalarSide, returnBool bool, opts *query.Options, -) (*scalarOperator, error) { +) (model.VectorOperator, error) { binaryOperation, err := newOperation(op, scalarSide != ScalarSideBoth) if err != nil { return nil, err @@ -85,10 +82,7 @@ func NewScalar( bothScalars: scalarSide == ScalarSideBoth, } - oper.OperatorTelemetry = telemetry.NewTelemetry(op, opts) - - return oper, nil - + return telemetry.NewOperator(telemetry.NewTelemetry(op, opts), oper), nil } func (o *scalarOperator) Explain() (next []model.VectorOperator) { @@ -96,9 +90,6 @@ func (o *scalarOperator) Explain() (next []model.VectorOperator) { } func (o *scalarOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - var err error o.seriesOnce.Do(func() { err = o.loadSeries(ctx) }) if err != nil { @@ -112,9 +103,6 @@ func (o *scalarOperator) String() string { } func (o *scalarOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/binary/vector.go b/vendor/github.com/thanos-io/promql-engine/execution/binary/vector.go index aa0469794cc..4f40754d6f7 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/binary/vector.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/binary/vector.go @@ -8,7 +8,6 @@ import ( "fmt" "math" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -58,8 +57,6 @@ type vectorOperator struct { // If true then 1/0 needs to be returned instead of the value. returnBool bool - - telemetry.OperatorTelemetry } func NewVectorOperator( @@ -81,9 +78,7 @@ func NewVectorOperator( sigFunc: signatureFunc(matching.On, matching.MatchingLabels...), } - oper.OperatorTelemetry = telemetry.NewTelemetry(oper, opts) - - return oper, nil + return telemetry.NewOperator(telemetry.NewTelemetry(oper, opts), oper), nil } func (o *vectorOperator) String() string { @@ -98,9 +93,6 @@ func (o *vectorOperator) Explain() (next []model.VectorOperator) { } func (o *vectorOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - if err := o.initOnce(ctx); err != nil { return nil, err } @@ -108,9 +100,6 @@ func (o *vectorOperator) Series(ctx context.Context) ([]labels.Labels, error) { } func (o *vectorOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/exchange/coalesce.go b/vendor/github.com/thanos-io/promql-engine/execution/exchange/coalesce.go index 52671e03436..390cb9615a2 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/exchange/coalesce.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/exchange/coalesce.go @@ -8,7 +8,6 @@ import ( "math" "sync" "sync/atomic" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -35,8 +34,6 @@ func (c errorChan) getError() error { // coalesce guarantees that samples from different input vectors will be added to the output in the same order // as the input vectors themselves are provided in NewCoalesce. type coalesce struct { - telemetry.OperatorTelemetry - once sync.Once series []labels.Labels @@ -63,9 +60,7 @@ func NewCoalesce(pool *model.VectorPool, opts *query.Options, batchSize int64, o batchSize: batchSize, } - oper.OperatorTelemetry = telemetry.NewTelemetry(oper, opts) - - return oper + return telemetry.NewOperator(telemetry.NewTelemetry(oper, opts), oper) } func (c *coalesce) Explain() (next []model.VectorOperator) { @@ -81,9 +76,6 @@ func (c *coalesce) GetPool() *model.VectorPool { } func (c *coalesce) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { c.AddExecutionTimeTaken(time.Since(start)) }() - var err error c.once.Do(func() { err = c.loadSeries(ctx) }) if err != nil { @@ -93,9 +85,6 @@ func (c *coalesce) Series(ctx context.Context) ([]labels.Labels, error) { } func (c *coalesce) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { c.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/exchange/concurrent.go b/vendor/github.com/thanos-io/promql-engine/execution/exchange/concurrent.go index acf4d34e9e9..78ea488cbc8 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/exchange/concurrent.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/exchange/concurrent.go @@ -7,7 +7,6 @@ import ( "context" "fmt" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -26,7 +25,6 @@ type concurrencyOperator struct { next model.VectorOperator buffer chan maybeStepVector bufferSize int - telemetry.OperatorTelemetry } func NewConcurrent(next model.VectorOperator, bufferSize int, opts *query.Options) model.VectorOperator { @@ -36,8 +34,7 @@ func NewConcurrent(next model.VectorOperator, bufferSize int, opts *query.Option bufferSize: bufferSize, } - oper.OperatorTelemetry = telemetry.NewTelemetry(oper, opts) - return oper + return telemetry.NewOperator(telemetry.NewTelemetry(oper, opts), oper) } func (c *concurrencyOperator) Explain() (next []model.VectorOperator) { @@ -49,10 +46,11 @@ func (c *concurrencyOperator) String() string { } func (c *concurrencyOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { c.AddExecutionTimeTaken(time.Since(start)) }() - - return c.next.Series(ctx) + series, err := c.next.Series(ctx) + if err != nil { + return nil, err + } + return series, nil } func (c *concurrencyOperator) GetPool() *model.VectorPool { @@ -60,9 +58,6 @@ func (c *concurrencyOperator) GetPool() *model.VectorPool { } func (c *concurrencyOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { c.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/exchange/dedup.go b/vendor/github.com/thanos-io/promql-engine/execution/exchange/dedup.go index 517ad93fe93..95c8d0e31c6 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/exchange/dedup.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/exchange/dedup.go @@ -6,7 +6,6 @@ package exchange import ( "context" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -32,8 +31,6 @@ type dedupCache []dedupSample // if multiple samples with the same ID are present in a StepVector, dedupOperator // will keep the last sample in that vector. type dedupOperator struct { - telemetry.OperatorTelemetry - once sync.Once series []labels.Labels @@ -49,15 +46,10 @@ func NewDedupOperator(pool *model.VectorPool, next model.VectorOperator, opts *q next: next, pool: pool, } - oper.OperatorTelemetry = telemetry.NewTelemetry(oper, opts) - - return oper + return telemetry.NewOperator(telemetry.NewTelemetry(oper, opts), oper) } func (d *dedupOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { d.AddExecutionTimeTaken(time.Since(start)) }() - var err error d.once.Do(func() { err = d.loadSeries(ctx) }) if err != nil { @@ -107,9 +99,6 @@ func (d *dedupOperator) Next(ctx context.Context) ([]model.StepVector, error) { } func (d *dedupOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { d.AddExecutionTimeTaken(time.Since(start)) }() - var err error d.once.Do(func() { err = d.loadSeries(ctx) }) if err != nil { diff --git a/vendor/github.com/thanos-io/promql-engine/execution/exchange/duplicate_label.go b/vendor/github.com/thanos-io/promql-engine/execution/exchange/duplicate_label.go index ae1d69e1ff2..c6599067fba 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/exchange/duplicate_label.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/exchange/duplicate_label.go @@ -6,7 +6,6 @@ package exchange import ( "context" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -19,8 +18,6 @@ import ( type pair struct{ a, b int } type duplicateLabelCheckOperator struct { - telemetry.OperatorTelemetry - once sync.Once next model.VectorOperator @@ -32,15 +29,10 @@ func NewDuplicateLabelCheck(next model.VectorOperator, opts *query.Options) mode oper := &duplicateLabelCheckOperator{ next: next, } - oper.OperatorTelemetry = telemetry.NewTelemetry(oper, opts) - - return oper + return telemetry.NewOperator(telemetry.NewTelemetry(oper, opts), oper) } func (d *duplicateLabelCheckOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { d.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() @@ -84,13 +76,14 @@ func (d *duplicateLabelCheckOperator) Next(ctx context.Context) ([]model.StepVec } func (d *duplicateLabelCheckOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { d.AddExecutionTimeTaken(time.Since(start)) }() - if err := d.init(ctx); err != nil { return nil, err } - return d.next.Series(ctx) + series, err := d.next.Series(ctx) + if err != nil { + return nil, err + } + return series, nil } func (d *duplicateLabelCheckOperator) GetPool() *model.VectorPool { diff --git a/vendor/github.com/thanos-io/promql-engine/execution/function/absent.go b/vendor/github.com/thanos-io/promql-engine/execution/function/absent.go index 8be1cc031e9..e605ab62cf3 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/function/absent.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/function/absent.go @@ -6,7 +6,6 @@ package function import ( "context" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -17,8 +16,6 @@ import ( ) type absentOperator struct { - telemetry.OperatorTelemetry - once sync.Once funcExpr *logicalplan.FunctionCall series []labels.Labels @@ -31,15 +28,13 @@ func newAbsentOperator( pool *model.VectorPool, next model.VectorOperator, opts *query.Options, -) *absentOperator { +) model.VectorOperator { oper := &absentOperator{ funcExpr: funcExpr, pool: pool, next: next, } - oper.OperatorTelemetry = telemetry.NewTelemetry(oper, opts) - - return oper + return telemetry.NewOperator(telemetry.NewTelemetry(oper, opts), oper) } func (o *absentOperator) String() string { @@ -51,9 +46,6 @@ func (o *absentOperator) Explain() (next []model.VectorOperator) { } func (o *absentOperator) Series(_ context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - o.loadSeries() return o.series, nil } @@ -98,9 +90,6 @@ func (o *absentOperator) GetPool() *model.VectorPool { } func (o *absentOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/function/histogram.go b/vendor/github.com/thanos-io/promql-engine/execution/function/histogram.go index f878e4c148c..050159f2aa8 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/function/histogram.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/function/histogram.go @@ -9,7 +9,6 @@ import ( "math" "strconv" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -33,7 +32,6 @@ type histogramSeries struct { // histogramOperator is a function operator that calculates percentiles. type histogramOperator struct { - telemetry.OperatorTelemetry once sync.Once series []labels.Labels @@ -60,7 +58,7 @@ func newHistogramOperator( scalarOp model.VectorOperator, vectorOp model.VectorOperator, opts *query.Options, -) *histogramOperator { +) model.VectorOperator { oper := &histogramOperator{ pool: pool, funcArgs: funcArgs, @@ -68,9 +66,7 @@ func newHistogramOperator( vectorOp: vectorOp, scalarPoints: make([]float64, opts.StepsBatch), } - oper.OperatorTelemetry = telemetry.NewTelemetry(oper, opts) - - return oper + return telemetry.NewOperator(telemetry.NewTelemetry(oper, opts), oper) } func (o *histogramOperator) String() string { @@ -82,15 +78,11 @@ func (o *histogramOperator) Explain() (next []model.VectorOperator) { } func (o *histogramOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - var err error o.once.Do(func() { err = o.loadSeries(ctx) }) if err != nil { return nil, err } - return o.series, nil } @@ -99,9 +91,6 @@ func (o *histogramOperator) GetPool() *model.VectorPool { } func (o *histogramOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/function/noarg.go b/vendor/github.com/thanos-io/promql-engine/execution/function/noarg.go index 9d841280861..c07a752ca73 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/function/noarg.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/function/noarg.go @@ -5,18 +5,14 @@ package function import ( "context" - "time" "github.com/thanos-io/promql-engine/execution/model" - "github.com/thanos-io/promql-engine/execution/telemetry" "github.com/thanos-io/promql-engine/logicalplan" "github.com/prometheus/prometheus/model/labels" ) type noArgFunctionOperator struct { - telemetry.OperatorTelemetry - mint int64 maxt int64 step int64 @@ -38,9 +34,6 @@ func (o *noArgFunctionOperator) String() string { } func (o *noArgFunctionOperator) Series(_ context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - return o.series, nil } @@ -49,9 +42,6 @@ func (o *noArgFunctionOperator) GetPool() *model.VectorPool { } func (o *noArgFunctionOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/function/operator.go b/vendor/github.com/thanos-io/promql-engine/execution/function/operator.go index c740a0fbf02..885567792cf 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/function/operator.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/function/operator.go @@ -8,7 +8,6 @@ import ( "fmt" "math" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/parse" @@ -67,7 +66,6 @@ func newNoArgsFunctionOperator(funcExpr *logicalplan.FunctionCall, stepsBatch in call: call, vectorPool: model.NewVectorPool(stepsBatch), } - op.OperatorTelemetry = telemetry.NewTelemetry(op, opts) switch funcExpr.Func.Name { case "pi", "time": @@ -78,13 +76,11 @@ func newNoArgsFunctionOperator(funcExpr *logicalplan.FunctionCall, stepsBatch in op.sampleIDs = []uint64{0} } - return op, nil + return telemetry.NewOperator(telemetry.NewTelemetry(op, opts), op), nil } // functionOperator returns []model.StepVector after processing input with desired function. type functionOperator struct { - telemetry.OperatorTelemetry - funcExpr *logicalplan.FunctionCall series []labels.Labels once sync.Once @@ -113,7 +109,6 @@ func newInstantVectorFunctionOperator(funcExpr *logicalplan.FunctionCall, nextOp vectorIndex: 0, scalarPoints: scalarPoints, } - f.OperatorTelemetry = telemetry.NewTelemetry(f, opts) for i := range funcExpr.Args { if funcExpr.Args[i].ReturnType() == parser.ValueTypeVector { @@ -125,7 +120,7 @@ func newInstantVectorFunctionOperator(funcExpr *logicalplan.FunctionCall, nextOp // Check selector type. switch funcExpr.Args[f.vectorIndex].ReturnType() { case parser.ValueTypeVector, parser.ValueTypeScalar: - return f, nil + return telemetry.NewOperator(telemetry.NewTelemetry(f, opts), f), nil default: return nil, errors.Wrapf(parse.ErrNotImplemented, "got %s:", funcExpr.String()) } @@ -140,13 +135,9 @@ func (o *functionOperator) String() string { } func (o *functionOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - if err := o.loadSeries(ctx); err != nil { return nil, err } - return o.series, nil } @@ -155,9 +146,6 @@ func (o *functionOperator) GetPool() *model.VectorPool { } func (o *functionOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/function/relabel.go b/vendor/github.com/thanos-io/promql-engine/execution/function/relabel.go index 81f24ffeabb..383b89c72a0 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/function/relabel.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/function/relabel.go @@ -8,7 +8,6 @@ import ( "regexp" "strings" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -21,8 +20,6 @@ import ( ) type relabelOperator struct { - telemetry.OperatorTelemetry - next model.VectorOperator funcExpr *logicalplan.FunctionCall once sync.Once @@ -33,14 +30,12 @@ func newRelabelOperator( next model.VectorOperator, funcExpr *logicalplan.FunctionCall, opts *query.Options, -) *relabelOperator { +) model.VectorOperator { oper := &relabelOperator{ next: next, funcExpr: funcExpr, } - oper.OperatorTelemetry = telemetry.NewTelemetry(oper, opts) - - return oper + return telemetry.NewOperator(telemetry.NewTelemetry(oper, opts), oper) } func (o *relabelOperator) String() string { @@ -52,9 +47,6 @@ func (o *relabelOperator) Explain() (next []model.VectorOperator) { } func (o *relabelOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - var err error o.once.Do(func() { err = o.loadSeries(ctx) }) return o.series, err @@ -65,9 +57,6 @@ func (o *relabelOperator) GetPool() *model.VectorPool { } func (o *relabelOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - return o.next.Next(ctx) } diff --git a/vendor/github.com/thanos-io/promql-engine/execution/function/scalar.go b/vendor/github.com/thanos-io/promql-engine/execution/function/scalar.go index 17aaadc33f6..97e56be9a4d 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/function/scalar.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/function/scalar.go @@ -6,7 +6,6 @@ package function import ( "context" "math" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -18,17 +17,15 @@ import ( type scalarOperator struct { pool *model.VectorPool next model.VectorOperator - telemetry.OperatorTelemetry } -func newScalarOperator(pool *model.VectorPool, next model.VectorOperator, opts *query.Options) *scalarOperator { +func newScalarOperator(pool *model.VectorPool, next model.VectorOperator, opts *query.Options) model.VectorOperator { oper := &scalarOperator{ pool: pool, next: next, } - oper.OperatorTelemetry = telemetry.NewTelemetry(oper, opts) - return oper + return telemetry.NewOperator(telemetry.NewTelemetry(oper, opts), oper) } func (o *scalarOperator) String() string { @@ -40,9 +37,6 @@ func (o *scalarOperator) Explain() (next []model.VectorOperator) { } func (o *scalarOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - return nil, nil } @@ -51,9 +45,6 @@ func (o *scalarOperator) GetPool() *model.VectorPool { } func (o *scalarOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/function/timestamp.go b/vendor/github.com/thanos-io/promql-engine/execution/function/timestamp.go index 0926d87443d..2b80b85aa4c 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/function/timestamp.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/function/timestamp.go @@ -6,7 +6,6 @@ package function import ( "context" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -18,19 +17,16 @@ import ( type timestampOperator struct { next model.VectorOperator - telemetry.OperatorTelemetry series []labels.Labels once sync.Once } -func newTimestampOperator(next model.VectorOperator, opts *query.Options) *timestampOperator { +func newTimestampOperator(next model.VectorOperator, opts *query.Options) model.VectorOperator { oper := ×tampOperator{ next: next, } - oper.OperatorTelemetry = telemetry.NewTelemetry(oper, opts) - - return oper + return telemetry.NewOperator(telemetry.NewTelemetry(oper, opts), oper) } func (o *timestampOperator) Explain() (next []model.VectorOperator) { @@ -38,9 +34,6 @@ func (o *timestampOperator) Explain() (next []model.VectorOperator) { } func (o *timestampOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - if err := o.loadSeries(ctx); err != nil { return nil, err } @@ -76,9 +69,6 @@ func (o *timestampOperator) GetPool() *model.VectorPool { } func (o *timestampOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/remote/operator.go b/vendor/github.com/thanos-io/promql-engine/execution/remote/operator.go index b3726ae7e14..081046a5478 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/remote/operator.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/remote/operator.go @@ -30,10 +30,9 @@ type Execution struct { queryRangeEnd time.Time vectorSelector model.VectorOperator - telemetry.OperatorTelemetry } -func NewExecution(query promql.Query, pool *model.VectorPool, queryRangeStart, queryRangeEnd time.Time, engineLabels []labels.Labels, opts *query.Options, _ storage.SelectHints) *Execution { +func NewExecution(query promql.Query, pool *model.VectorPool, queryRangeStart, queryRangeEnd time.Time, engineLabels []labels.Labels, opts *query.Options, _ storage.SelectHints) model.VectorOperator { storage := newStorageFromQuery(query, opts, engineLabels) oper := &Execution{ storage: storage, @@ -44,18 +43,15 @@ func NewExecution(query promql.Query, pool *model.VectorPool, queryRangeStart, q vectorSelector: promstorage.NewVectorSelector(pool, storage, opts, 0, 0, false, 0, 1), } - oper.OperatorTelemetry = telemetry.NewTelemetry(oper, opts) - - return oper + return telemetry.NewOperator(telemetry.NewTelemetry(oper, opts), oper) } func (e *Execution) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { - e.AddExecutionTimeTaken(time.Since(start)) - }() - - return e.vectorSelector.Series(ctx) + series, err := e.vectorSelector.Series(ctx) + if err != nil { + return nil, err + } + return series, nil } func (e *Execution) String() string { @@ -63,9 +59,6 @@ func (e *Execution) String() string { } func (e *Execution) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { e.AddExecutionTimeTaken(time.Since(start)) }() - next, err := e.vectorSelector.Next(ctx) if next == nil { // Closing the storage prematurely can lead to results from the query diff --git a/vendor/github.com/thanos-io/promql-engine/execution/scan/literal_selector.go b/vendor/github.com/thanos-io/promql-engine/execution/scan/literal_selector.go index 4f8cc8c347e..f3387dc8797 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/scan/literal_selector.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/scan/literal_selector.go @@ -7,7 +7,6 @@ import ( "context" "fmt" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -29,10 +28,9 @@ type numberLiteralSelector struct { once sync.Once val float64 - telemetry.OperatorTelemetry } -func NewNumberLiteralSelector(pool *model.VectorPool, opts *query.Options, val float64) *numberLiteralSelector { +func NewNumberLiteralSelector(pool *model.VectorPool, opts *query.Options, val float64) model.VectorOperator { oper := &numberLiteralSelector{ vectorPool: pool, numSteps: opts.NumSteps(), @@ -43,8 +41,7 @@ func NewNumberLiteralSelector(pool *model.VectorPool, opts *query.Options, val f val: val, } - oper.OperatorTelemetry = telemetry.NewTelemetry(oper, opts) - return oper + return telemetry.NewOperator(telemetry.NewTelemetry(oper, opts), oper) } func (o *numberLiteralSelector) Explain() (next []model.VectorOperator) { @@ -56,9 +53,6 @@ func (o *numberLiteralSelector) String() string { } func (o *numberLiteralSelector) Series(context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - o.loadSeries() return o.series, nil } @@ -68,9 +62,6 @@ func (o *numberLiteralSelector) GetPool() *model.VectorPool { } func (o *numberLiteralSelector) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/scan/subquery.go b/vendor/github.com/thanos-io/promql-engine/execution/scan/subquery.go index e9870ed5a9e..2bc6d083d5b 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/scan/subquery.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/scan/subquery.go @@ -8,7 +8,6 @@ import ( "fmt" "math" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -21,7 +20,7 @@ import ( ) type subqueryOperator struct { - telemetry.OperatorTelemetry + telemetry telemetry.OperatorTelemetry next model.VectorOperator paramOp model.VectorOperator @@ -81,9 +80,8 @@ func NewSubqueryOperator(pool *model.VectorPool, next, paramOp, paramOp2 model.V params: make([]float64, opts.StepsBatch), params2: make([]float64, opts.StepsBatch), } - o.OperatorTelemetry = telemetry.NewSubqueryTelemetry(o, opts) - - return o, nil + o.telemetry = telemetry.NewSubqueryTelemetry(o, opts) + return telemetry.NewOperator(o.telemetry, o), nil } func (o *subqueryOperator) String() string { @@ -104,9 +102,6 @@ func (o *subqueryOperator) Explain() (next []model.VectorOperator) { func (o *subqueryOperator) GetPool() *model.VectorPool { return o.pool } func (o *subqueryOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.OperatorTelemetry.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() @@ -204,12 +199,12 @@ func (o *subqueryOperator) Next(ctx context.Context) ([]model.StepVector, error) sv.AppendSample(o.pool, uint64(sampleId), f) } } - o.IncrementSamplesAtTimestamp(rangeSamples.Len(), sv.T) + o.telemetry.IncrementSamplesAtTimestamp(rangeSamples.SampleCount(), sv.T) } res = append(res, sv) - o.currentStep += o.step } + return res, nil } @@ -236,9 +231,6 @@ func (o *subqueryOperator) collect(v model.StepVector, mint int64) { } func (o *subqueryOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.OperatorTelemetry.AddExecutionTimeTaken(time.Since(start)) }() - if err := o.initSeries(ctx); err != nil { return nil, err } diff --git a/vendor/github.com/thanos-io/promql-engine/execution/step_invariant/step_invariant.go b/vendor/github.com/thanos-io/promql-engine/execution/step_invariant/step_invariant.go index b85406e45ac..6a1c78f3245 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/step_invariant/step_invariant.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/step_invariant/step_invariant.go @@ -6,7 +6,6 @@ package step_invariant import ( "context" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -32,7 +31,6 @@ type stepInvariantOperator struct { step int64 currentStep int64 stepsBatch int - telemetry.OperatorTelemetry } func (u *stepInvariantOperator) Explain() (next []model.VectorOperator) { @@ -60,7 +58,6 @@ func NewStepInvariantOperator( stepsBatch: opts.StepsBatch, cacheResult: true, } - u.OperatorTelemetry = telemetry.NewStepInvariantTelemetry(u, opts) if u.step == 0 { u.step = 1 } @@ -71,13 +68,10 @@ func NewStepInvariantOperator( u.cacheResult = false } - return u, nil + return telemetry.NewOperator(telemetry.NewStepInvariantTelemetry(u, opts), u), nil } func (u *stepInvariantOperator) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { u.AddExecutionTimeTaken(time.Since(start)) }() - var err error u.seriesOnce.Do(func() { u.series, err = u.next.Series(ctx) @@ -94,9 +88,6 @@ func (u *stepInvariantOperator) GetPool() *model.VectorPool { } func (u *stepInvariantOperator) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { u.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/execution/telemetry/telemetry.go b/vendor/github.com/thanos-io/promql-engine/execution/telemetry/telemetry.go index 19bdb2dc049..69966989a90 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/telemetry/telemetry.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/telemetry/telemetry.go @@ -4,6 +4,7 @@ package telemetry import ( + "context" "fmt" "time" @@ -11,14 +12,21 @@ import ( "github.com/thanos-io/promql-engine/logicalplan" "github.com/thanos-io/promql-engine/query" + "github.com/prometheus/prometheus/model/histogram" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/util/stats" ) type OperatorTelemetry interface { fmt.Stringer - AddExecutionTimeTaken(time.Duration) + MaxSeriesCount() int + SetMaxSeriesCount(count int) ExecutionTimeTaken() time.Duration + AddSeriesExecutionTime(time.Duration) + SeriesExecutionTime() time.Duration + AddNextExecutionTime(time.Duration) + NextExecutionTime() time.Duration IncrementSamplesAtTimestamp(samples int, t int64) Samples() *stats.QuerySamples LogicalNode() logicalplan.Node @@ -59,10 +67,26 @@ func (tm *NoopTelemetry) ExecutionTimeTaken() time.Duration { return time.Duration(0) } +func (tm *NoopTelemetry) AddSeriesExecutionTime(t time.Duration) {} + +func (tm *NoopTelemetry) SeriesExecutionTime() time.Duration { + return time.Duration(0) +} + +func (tm *NoopTelemetry) AddNextExecutionTime(t time.Duration) {} + +func (tm *NoopTelemetry) NextExecutionTime() time.Duration { + return time.Duration(0) +} + func (tm *NoopTelemetry) IncrementSamplesAtTimestamp(_ int, _ int64) {} func (tm *NoopTelemetry) Samples() *stats.QuerySamples { return nil } +func (tm *NoopTelemetry) MaxSeriesCount() int { return 0 } + +func (tm *NoopTelemetry) SetMaxSeriesCount(_ int) {} + func (tm *NoopTelemetry) LogicalNode() logicalplan.Node { return nil } @@ -70,7 +94,10 @@ func (tm *NoopTelemetry) LogicalNode() logicalplan.Node { type TrackedTelemetry struct { fmt.Stringer + Series int ExecutionTime time.Duration + SeriesTime time.Duration + NextTime time.Duration LoadedSamples *stats.QuerySamples logicalNode logicalplan.Node } @@ -98,6 +125,24 @@ func (ti *TrackedTelemetry) ExecutionTimeTaken() time.Duration { return ti.ExecutionTime } +func (ti *TrackedTelemetry) AddSeriesExecutionTime(t time.Duration) { + ti.SeriesTime += t + ti.ExecutionTime += t +} + +func (ti *TrackedTelemetry) SeriesExecutionTime() time.Duration { + return ti.SeriesTime +} + +func (ti *TrackedTelemetry) AddNextExecutionTime(t time.Duration) { + ti.NextTime += t + ti.ExecutionTime += t +} + +func (ti *TrackedTelemetry) NextExecutionTime() time.Duration { + return ti.NextTime +} + func (ti *TrackedTelemetry) IncrementSamplesAtTimestamp(samples int, t int64) { ti.updatePeak(samples) ti.LoadedSamples.IncrementSamplesAtTimestamp(t, int64(samples)) @@ -113,7 +158,63 @@ func (ti *TrackedTelemetry) updatePeak(samples int) { func (ti *TrackedTelemetry) Samples() *stats.QuerySamples { return ti.LoadedSamples } +func (ti *TrackedTelemetry) MaxSeriesCount() int { return ti.Series } + +func (ti *TrackedTelemetry) SetMaxSeriesCount(count int) { ti.Series = count } + type ObservableVectorOperator interface { model.VectorOperator OperatorTelemetry } + +// CalculateHistogramSampleCount returns the size of the FloatHistogram compared to the size of a Float. +// The total size is calculated considering the histogram timestamp (p.T - 8 bytes), +// and then a number of bytes in the histogram. +// This sum is divided by 16, as samples are 16 bytes. +// See: https://github.com/prometheus/prometheus/blob/2bf6f4c9dcbb1ad2e8fef70c6a48d8fc44a7f57c/promql/value.go#L178 +func CalculateHistogramSampleCount(h *histogram.FloatHistogram) int { + return (h.Size() + 8) / 16 +} + +func NewOperator(telemetry OperatorTelemetry, inner model.VectorOperator) model.VectorOperator { + op := &Operator{ + inner: inner, + } + op.OperatorTelemetry = telemetry + return op +} + +// Operator wraps other inner operator to track its telemetry. +type Operator struct { + OperatorTelemetry + inner model.VectorOperator +} + +func (t *Operator) Series(ctx context.Context) ([]labels.Labels, error) { + start := time.Now() + defer func() { t.OperatorTelemetry.AddSeriesExecutionTime(time.Since(start)) }() + s, err := t.inner.Series(ctx) + if err != nil { + return nil, err + } + t.OperatorTelemetry.SetMaxSeriesCount(len(s)) + return s, err +} + +func (t *Operator) Next(ctx context.Context) ([]model.StepVector, error) { + start := time.Now() + defer func() { t.OperatorTelemetry.AddNextExecutionTime(time.Since(start)) }() + return t.inner.Next(ctx) +} + +func (t *Operator) GetPool() *model.VectorPool { + return t.inner.GetPool() +} + +func (t *Operator) Explain() []model.VectorOperator { + return t.inner.Explain() +} + +func (t *Operator) String() string { + return t.inner.String() +} diff --git a/vendor/github.com/thanos-io/promql-engine/execution/unary/unary.go b/vendor/github.com/thanos-io/promql-engine/execution/unary/unary.go index a521baf7a90..30517731084 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/unary/unary.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/unary/unary.go @@ -6,7 +6,6 @@ package unary import ( "context" "sync" - "time" "github.com/thanos-io/promql-engine/execution/model" "github.com/thanos-io/promql-engine/execution/telemetry" @@ -22,16 +21,13 @@ type unaryNegation struct { once sync.Once series []labels.Labels - telemetry.OperatorTelemetry } func NewUnaryNegation(next model.VectorOperator, opts *query.Options) (model.VectorOperator, error) { u := &unaryNegation{ next: next, } - u.OperatorTelemetry = telemetry.NewTelemetry(u, opts) - - return u, nil + return telemetry.NewOperator(telemetry.NewTelemetry(u, opts), u), nil } func (u *unaryNegation) Explain() (next []model.VectorOperator) { @@ -43,9 +39,6 @@ func (u *unaryNegation) String() string { } func (u *unaryNegation) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { u.AddExecutionTimeTaken(time.Since(start)) }() - if err := u.loadSeries(ctx); err != nil { return nil, err } @@ -74,9 +67,6 @@ func (u *unaryNegation) GetPool() *model.VectorPool { } func (u *unaryNegation) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { u.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() diff --git a/vendor/github.com/thanos-io/promql-engine/ringbuffer/generic.go b/vendor/github.com/thanos-io/promql-engine/ringbuffer/generic.go index 00c7f2efe93..94b2a8de7cd 100644 --- a/vendor/github.com/thanos-io/promql-engine/ringbuffer/generic.go +++ b/vendor/github.com/thanos-io/promql-engine/ringbuffer/generic.go @@ -7,6 +7,8 @@ import ( "context" "math" + "github.com/thanos-io/promql-engine/execution/telemetry" + "github.com/prometheus/prometheus/model/histogram" ) @@ -49,6 +51,18 @@ func NewWithExtLookback(ctx context.Context, size int, selectRange, offset, extL func (r *GenericRingBuffer) Len() int { return len(r.items) } +func (r *GenericRingBuffer) SampleCount() int { + c := 0 + for _, s := range r.items { + if s.V.H != nil { + c += telemetry.CalculateHistogramSampleCount(s.V.H) + continue + } + c++ + } + return c +} + // MaxT returns the maximum timestamp of the ring buffer. // If the ring buffer is empty, it returns math.MinInt64. func (r *GenericRingBuffer) MaxT() int64 { diff --git a/vendor/github.com/thanos-io/promql-engine/ringbuffer/rate.go b/vendor/github.com/thanos-io/promql-engine/ringbuffer/rate.go index 0a137ceeee2..33a01f87979 100644 --- a/vendor/github.com/thanos-io/promql-engine/ringbuffer/rate.go +++ b/vendor/github.com/thanos-io/promql-engine/ringbuffer/rate.go @@ -8,6 +8,7 @@ import ( "math" "slices" + "github.com/thanos-io/promql-engine/execution/telemetry" "github.com/thanos-io/promql-engine/query" "github.com/prometheus/prometheus/model/histogram" @@ -20,6 +21,7 @@ type Buffer interface { Reset(mint int64, evalt int64) Eval(ctx context.Context, _, _ float64, _ *int64) (float64, *histogram.FloatHistogram, bool, error) ReadIntoLast(f func(*Sample)) + SampleCount() int } // RateBuffer is a Buffer which can calculate rate, increase and delta for a @@ -50,9 +52,10 @@ type RateBuffer struct { } type stepRange struct { - mint int64 - maxt int64 - numSamples int + mint int64 + maxt int64 + numSamples int + sampleCount int } // NewRateBuffer creates a new RateBuffer. @@ -94,6 +97,10 @@ func NewRateBuffer(ctx context.Context, opts query.Options, isCounter, isRate bo func (r *RateBuffer) Len() int { return r.stepRanges[0].numSamples } +func (r *RateBuffer) SampleCount() int { + return r.stepRanges[0].sampleCount +} + func (r *RateBuffer) MaxT() int64 { return r.last.T } func (r *RateBuffer) Push(t int64, v Value) { @@ -130,6 +137,11 @@ func (r *RateBuffer) Push(t int64, v Value) { // Set the first sample for each evaluation step where the currently read sample is used. for i := 0; i < len(r.stepRanges) && t > r.stepRanges[i].mint && t <= r.stepRanges[i].maxt; i++ { r.stepRanges[i].numSamples++ + if v.H != nil { + r.stepRanges[i].sampleCount += telemetry.CalculateHistogramSampleCount(v.H) + } else { + r.stepRanges[i].sampleCount++ + } sample := &r.firstSamples[i] if t >= sample.T { continue diff --git a/vendor/github.com/thanos-io/promql-engine/storage/prometheus/matrix_selector.go b/vendor/github.com/thanos-io/promql-engine/storage/prometheus/matrix_selector.go index 381b19671ae..cf46bb95ee9 100644 --- a/vendor/github.com/thanos-io/promql-engine/storage/prometheus/matrix_selector.go +++ b/vendor/github.com/thanos-io/promql-engine/storage/prometheus/matrix_selector.go @@ -39,7 +39,7 @@ type matrixScanner struct { } type matrixSelector struct { - telemetry.OperatorTelemetry + telemetry telemetry.OperatorTelemetry vectorPool *model.VectorPool storage SeriesSelector @@ -120,7 +120,6 @@ func NewMatrixSelector( extLookbackDelta: opts.ExtLookbackDelta.Milliseconds(), } - m.OperatorTelemetry = telemetry.NewTelemetry(m, opts) // For instant queries, set the step to a positive value // so that the operator can terminate. @@ -128,7 +127,8 @@ func NewMatrixSelector( m.step = 1 } - return m, nil + m.telemetry = telemetry.NewTelemetry(m, opts) + return telemetry.NewOperator(m.telemetry, m), nil } func (o *matrixSelector) Explain() []model.VectorOperator { @@ -136,9 +136,6 @@ func (o *matrixSelector) Explain() []model.VectorOperator { } func (o *matrixSelector) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - if err := o.loadSeries(ctx); err != nil { return nil, err } @@ -150,9 +147,6 @@ func (o *matrixSelector) GetPool() *model.VectorPool { } func (o *matrixSelector) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() @@ -210,7 +204,7 @@ func (o *matrixSelector) Next(ctx context.Context) ([]model.StepVector, error) { o.hasFloats = true } } - o.IncrementSamplesAtTimestamp(scanner.buffer.Len(), seriesTs) + o.telemetry.IncrementSamplesAtTimestamp(scanner.buffer.SampleCount(), seriesTs) seriesTs += o.step } } diff --git a/vendor/github.com/thanos-io/promql-engine/storage/prometheus/vector_selector.go b/vendor/github.com/thanos-io/promql-engine/storage/prometheus/vector_selector.go index 769fc6d2299..19fd0809d99 100644 --- a/vendor/github.com/thanos-io/promql-engine/storage/prometheus/vector_selector.go +++ b/vendor/github.com/thanos-io/promql-engine/storage/prometheus/vector_selector.go @@ -28,7 +28,7 @@ type vectorScanner struct { } type vectorSelector struct { - telemetry.OperatorTelemetry + telemetry telemetry.OperatorTelemetry storage SeriesSelector scanners []vectorScanner @@ -82,7 +82,6 @@ func NewVectorSelector( selectTimestamp: selectTimestamp, } - o.OperatorTelemetry = telemetry.NewTelemetry(o, queryOpts) // For instant queries, set the step to a positive value // so that the operator can terminate. @@ -90,7 +89,8 @@ func NewVectorSelector( o.step = 1 } - return o + o.telemetry = telemetry.NewTelemetry(o, queryOpts) + return telemetry.NewOperator(o.telemetry, o) } func (o *vectorSelector) String() string { @@ -102,9 +102,6 @@ func (o *vectorSelector) Explain() (next []model.VectorOperator) { } func (o *vectorSelector) Series(ctx context.Context) ([]labels.Labels, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - if err := o.loadSeries(ctx); err != nil { return nil, err } @@ -116,9 +113,6 @@ func (o *vectorSelector) GetPool() *model.VectorPool { } func (o *vectorSelector) Next(ctx context.Context) ([]model.StepVector, error) { - start := time.Now() - defer func() { o.AddExecutionTimeTaken(time.Since(start)) }() - select { case <-ctx.Done(): return nil, ctx.Err() @@ -139,7 +133,7 @@ func (o *vectorSelector) Next(ctx context.Context) ([]model.StepVector, error) { ts += o.step } - var currStepSamples uint64 + var currStepSamples int // Reset the current timestamp. ts = o.currentStep fromSeries := o.currentSeries @@ -160,12 +154,13 @@ func (o *vectorSelector) Next(ctx context.Context) ([]model.StepVector, error) { if ok { if h != nil && !o.selectTimestamp { vectors[currStep].AppendHistogram(o.vectorPool, series.signature, h) + currStepSamples += telemetry.CalculateHistogramSampleCount(h) } else { vectors[currStep].AppendSample(o.vectorPool, series.signature, v) + currStepSamples++ } - currStepSamples++ } - o.IncrementSamplesAtTimestamp(int(currStepSamples), seriesTs) + o.telemetry.IncrementSamplesAtTimestamp(currStepSamples, seriesTs) seriesTs += o.step } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 52e75854745..95547ab4ab1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -363,8 +363,6 @@ github.com/efficientgo/core/testutil/internal # github.com/efficientgo/tools/extkingpin v0.0.0-20230505153745-6b7392939a60 ## explicit; go 1.19 github.com/efficientgo/tools/extkingpin -# github.com/envoyproxy/go-control-plane v0.12.0 -## explicit; go 1.17 # github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb ## explicit github.com/facette/natsort @@ -1090,7 +1088,7 @@ github.com/thanos-io/objstore/providers/gcs github.com/thanos-io/objstore/providers/s3 github.com/thanos-io/objstore/providers/swift github.com/thanos-io/objstore/tracing/opentracing -# github.com/thanos-io/promql-engine v0.0.0-20250522103302-dd83bd8fdb50 +# github.com/thanos-io/promql-engine v0.0.0-20250605204400-0c7d03a38861 ## explicit; go 1.24.0 github.com/thanos-io/promql-engine/api github.com/thanos-io/promql-engine/engine From 09b4add916ab8e40a859b0f43af80eb08fe9acd4 Mon Sep 17 00:00:00 2001 From: yeya24 Date: Thu, 5 Jun 2025 23:03:25 -0700 Subject: [PATCH 3/3] lint Signed-off-by: yeya24 --- pkg/querier/codec/protobuf_codec.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/querier/codec/protobuf_codec.go b/pkg/querier/codec/protobuf_codec.go index 1f427cb442e..49a83ed4f32 100644 --- a/pkg/querier/codec/protobuf_codec.go +++ b/pkg/querier/codec/protobuf_codec.go @@ -1,7 +1,8 @@ package codec import ( - "github.com/cortexproject/cortex/pkg/api/queryapi" + "time" + "github.com/gogo/protobuf/proto" jsoniter "github.com/json-iterator/go" "github.com/prometheus/common/model" @@ -10,8 +11,7 @@ import ( "github.com/prometheus/prometheus/util/stats" v1 "github.com/prometheus/prometheus/web/api/v1" - "time" - + "github.com/cortexproject/cortex/pkg/api/queryapi" "github.com/cortexproject/cortex/pkg/cortexpb" "github.com/cortexproject/cortex/pkg/querier/tripperware" "github.com/cortexproject/cortex/pkg/util/analysis"