diff --git a/cmd/thanos/query_frontend.go b/cmd/thanos/query_frontend.go index 5b6fc0b9024..c93ee7a54a4 100644 --- a/cmd/thanos/query_frontend.go +++ b/cmd/thanos/query_frontend.go @@ -146,7 +146,8 @@ func registerQueryFrontend(app *extkingpin.App) { cmd.Flag("query-frontend.log-queries-longer-than", "Log queries that are slower than the specified duration. "+ "Set to 0 to disable. Set to < 0 to enable on all queries.").Default("0").DurationVar(&cfg.CortexHandlerConfig.LogQueriesLongerThan) cmd.Flag("query-frontend.query-stats-enabled", "True to enable query statistics tracking. "+ - "When enabled, a message with some statistics is logged for every query.").Default("false").BoolVar(&cfg.CortexHandlerConfig.QueryStatsEnabled) + "When enabled, a message with some statistics is logged for every query.").Default("false").BoolVar(&cfg.QueryStatsEnabled) + cmd.Flag("query-frontend.cache-queryable-samples-stats", "True to enable caching of queryable samples stats in the cache. ").Default("false").BoolVar(&cfg.CacheQueryableSamplesStats) cmd.Flag("query-frontend.org-id-header", "Deprecation Warning - This flag will be soon deprecated in favor of query-frontend.tenant-header"+ " and both flags cannot be used at the same time. "+ @@ -268,8 +269,9 @@ func runQueryFrontend( return errors.Wrap(err, "initializing the query range cache config") } cfg.QueryRangeConfig.ResultsCacheConfig = &queryrange.ResultsCacheConfig{ - Compression: cfg.CacheCompression, - CacheConfig: *cacheConfig, + Compression: cfg.CacheCompression, + CacheQueryableSamplesStats: cfg.CacheQueryableSamplesStats, + CacheConfig: *cacheConfig, } } @@ -283,8 +285,9 @@ func runQueryFrontend( return errors.Wrap(err, "initializing the labels cache config") } cfg.LabelsConfig.ResultsCacheConfig = &queryrange.ResultsCacheConfig{ - Compression: cfg.CacheCompression, - CacheConfig: *cacheConfig, + Compression: cfg.CacheCompression, + CacheQueryableSamplesStats: cfg.CacheQueryableSamplesStats, + CacheConfig: *cacheConfig, } } @@ -313,7 +316,7 @@ func runQueryFrontend( return err } - roundTripper, err := cortexfrontend.NewDownstreamRoundTripper(cfg.DownstreamURL, downstreamTripper, cfg.CortexHandlerConfig.QueryStatsEnabled) + roundTripper, err := cortexfrontend.NewDownstreamRoundTripper(cfg.DownstreamURL, downstreamTripper, cfg.QueryStatsEnabled) if err != nil { return errors.Wrap(err, "setup downstream roundtripper") } @@ -322,7 +325,7 @@ func runQueryFrontend( roundTripper = tripperWare(roundTripper) // Create the query frontend transport. - handler := transport.NewHandler(*cfg.CortexHandlerConfig, roundTripper, logger, nil) + handler := transport.NewHandler(*cfg.CortexHandlerConfig, roundTripper, logger, nil, cfg.QueryStatsEnabled) if cfg.CompressResponses { handler = gzhttp.GzipHandler(handler) } diff --git a/internal/cortex/frontend/downstream_roundtripper.go b/internal/cortex/frontend/downstream_roundtripper.go index 9c165f44764..a4f67a71b29 100644 --- a/internal/cortex/frontend/downstream_roundtripper.go +++ b/internal/cortex/frontend/downstream_roundtripper.go @@ -37,13 +37,6 @@ func (d downstreamRoundTripper) RoundTrip(r *http.Request) (*http.Response, erro } } - if d.queryStatsEnabled { - // add &stats query param to get thanos-query to add query statistics to log - q := r.URL.Query() - q.Set("stats", "true") - r.URL.RawQuery = q.Encode() - } - r.URL.Scheme = d.downstreamURL.Scheme r.URL.Host = d.downstreamURL.Host r.URL.Path = path.Join(d.downstreamURL.Path, r.URL.Path) diff --git a/internal/cortex/frontend/transport/handler.go b/internal/cortex/frontend/transport/handler.go index 27e79326626..6a586033e2f 100644 --- a/internal/cortex/frontend/transport/handler.go +++ b/internal/cortex/frontend/transport/handler.go @@ -44,7 +44,6 @@ var ( type HandlerConfig struct { LogQueriesLongerThan time.Duration `yaml:"log_queries_longer_than"` MaxBodySize int64 `yaml:"max_body_size"` - QueryStatsEnabled bool `yaml:"query_stats_enabled"` } // Handler accepts queries and forwards them to RoundTripper. It can log slow queries, @@ -58,17 +57,19 @@ type Handler struct { querySeconds *prometheus.HistogramVec querySamplesTotal *prometheus.HistogramVec activeUsers *util.ActiveUsersCleanupService + queryStatsEnabled bool } // NewHandler creates a new frontend handler. -func NewHandler(cfg HandlerConfig, roundTripper http.RoundTripper, log log.Logger, reg prometheus.Registerer) http.Handler { +func NewHandler(cfg HandlerConfig, roundTripper http.RoundTripper, log log.Logger, reg prometheus.Registerer, queryStatsEnabled bool) http.Handler { h := &Handler{ - cfg: cfg, - log: log, - roundTripper: roundTripper, + cfg: cfg, + log: log, + roundTripper: roundTripper, + queryStatsEnabled: queryStatsEnabled, } - if cfg.QueryStatsEnabled { + if queryStatsEnabled { h.querySeconds = promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{ Name: "thanos_query_frontend_query_seconds", Help: "Total amount of wall clock time spend processing queries.", @@ -130,7 +131,7 @@ func (f *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.WriteHeader(resp.StatusCode) var respBuf bytes.Buffer - if f.cfg.QueryStatsEnabled { + if f.queryStatsEnabled { // Buffer the response body for query stat tracking later resp.Body = io.NopCloser(io.TeeReader(resp.Body, &respBuf)) } @@ -141,7 +142,7 @@ func (f *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { level.Error(util_log.WithContext(r.Context(), f.log)).Log("msg", "write response body error", "bytesCopied", bytesCopied, "err", err) } - if f.cfg.QueryStatsEnabled { + if f.queryStatsEnabled { // Parse the stats field out of the response body var statsResponse ResponseWithStats if err := json.Unmarshal(respBuf.Bytes(), &statsResponse); err == nil { @@ -160,7 +161,7 @@ func (f *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Check whether we should parse the query string. shouldReportSlowQuery := f.cfg.LogQueriesLongerThan != 0 && queryResponseTime > f.cfg.LogQueriesLongerThan - if shouldReportSlowQuery || f.cfg.QueryStatsEnabled { + if shouldReportSlowQuery || f.queryStatsEnabled { queryString = f.parseRequestQueryString(r, buf) } diff --git a/internal/cortex/querier/querier.go b/internal/cortex/querier/querier.go index 9d3fad079e8..d586f617e19 100644 --- a/internal/cortex/querier/querier.go +++ b/internal/cortex/querier/querier.go @@ -21,7 +21,6 @@ type Config struct { QueryIngestersWithin time.Duration `yaml:"query_ingesters_within"` QueryStoreForLabels bool `yaml:"query_store_for_labels_enabled"` AtModifierEnabled bool `yaml:"at_modifier_enabled"` - EnablePerStepStats bool `yaml:"per_step_stats_enabled"` // QueryStoreAfter the time after which queries should also be sent to the store and not just ingesters. QueryStoreAfter time.Duration `yaml:"query_store_after"` diff --git a/internal/cortex/querier/queryrange/query_range.go b/internal/cortex/querier/queryrange/query_range.go index 5304f9c63d3..d318120e01b 100644 --- a/internal/cortex/querier/queryrange/query_range.go +++ b/internal/cortex/querier/queryrange/query_range.go @@ -665,6 +665,23 @@ func (s *PrometheusInstantQueryData) MarshalJSON() ([]byte, error) { func StatsMerge(resps []Response) *PrometheusResponseStats { output := map[int64]*PrometheusResponseQueryableSamplesStatsPerStep{} hasStats := false + + result := &PrometheusResponseStats{ + Timings: &PrometheusResponseStats_Timings{ + EvalTotalTime: 0, + ResultSortTime: 0, + QueryPreparationTime: 0, + InnerEvalTime: 0, + ExecQueueTime: 0, + ExecTotalTime: 0, + }, + Samples: &PrometheusResponseStats_Samples{ + TotalQueryableSamples: 0, + PeakSamples: 0, + TotalQueryableSamplesPerStep: []*PrometheusResponseQueryableSamplesStatsPerStep{}, + }, + } + for _, resp := range resps { stats := resp.GetStats() if stats == nil { @@ -679,6 +696,18 @@ func StatsMerge(resps []Response) *PrometheusResponseStats { for _, s := range stats.Samples.TotalQueryableSamplesPerStep { output[s.GetTimestampMs()] = s } + + result.Timings.EvalTotalTime += stats.Timings.EvalTotalTime + result.Timings.ResultSortTime += stats.Timings.ResultSortTime + result.Timings.QueryPreparationTime += stats.Timings.QueryPreparationTime + result.Timings.InnerEvalTime += stats.Timings.InnerEvalTime + result.Timings.ExecQueueTime += stats.Timings.ExecQueueTime + result.Timings.ExecTotalTime += stats.Timings.ExecTotalTime + + result.Samples.TotalQueryableSamples += stats.Samples.TotalQueryableSamples + if stats.Samples.PeakSamples > result.Samples.PeakSamples { + result.Samples.PeakSamples = stats.Samples.PeakSamples + } } if !hasStats { @@ -692,10 +721,8 @@ func StatsMerge(resps []Response) *PrometheusResponseStats { sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] }) - result := &PrometheusResponseStats{Samples: &PrometheusResponseSamplesStats{}} for _, key := range keys { result.Samples.TotalQueryableSamplesPerStep = append(result.Samples.TotalQueryableSamplesPerStep, output[key]) - result.Samples.TotalQueryableSamples += output[key].Value } return result diff --git a/internal/cortex/querier/queryrange/queryrange.pb.go b/internal/cortex/querier/queryrange/queryrange.pb.go index 0b97731181d..e09d58723f8 100644 --- a/internal/cortex/querier/queryrange/queryrange.pb.go +++ b/internal/cortex/querier/queryrange/queryrange.pb.go @@ -763,10 +763,11 @@ func (m *Matrix) GetSampleStreams() []*SampleStream { } type PrometheusResponseStats struct { - Samples *PrometheusResponseSamplesStats `protobuf:"bytes,1,opt,name=samples,proto3" json:"samples"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Timings *PrometheusResponseStats_Timings `protobuf:"bytes,1,opt,name=timings,proto3" json:"timings"` + Samples *PrometheusResponseStats_Samples `protobuf:"bytes,2,opt,name=samples,proto3" json:"samples"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *PrometheusResponseStats) Reset() { *m = PrometheusResponseStats{} } @@ -802,33 +803,128 @@ func (m *PrometheusResponseStats) XXX_DiscardUnknown() { var xxx_messageInfo_PrometheusResponseStats proto.InternalMessageInfo -func (m *PrometheusResponseStats) GetSamples() *PrometheusResponseSamplesStats { +func (m *PrometheusResponseStats) GetTimings() *PrometheusResponseStats_Timings { + if m != nil { + return m.Timings + } + return nil +} + +func (m *PrometheusResponseStats) GetSamples() *PrometheusResponseStats_Samples { if m != nil { return m.Samples } return nil } -type PrometheusResponseSamplesStats struct { - TotalQueryableSamples int64 `protobuf:"varint,1,opt,name=totalQueryableSamples,proto3" json:"totalQueryableSamples"` - TotalQueryableSamplesPerStep []*PrometheusResponseQueryableSamplesStatsPerStep `protobuf:"bytes,2,rep,name=totalQueryableSamplesPerStep,proto3" json:"totalQueryableSamplesPerStep"` +type PrometheusResponseStats_Timings struct { + EvalTotalTime float32 `protobuf:"fixed32,1,opt,name=EvalTotalTime,proto3" json:"evalTotalTime"` + ResultSortTime float32 `protobuf:"fixed32,2,opt,name=ResultSortTime,proto3" json:"resultSortTime"` + QueryPreparationTime float32 `protobuf:"fixed32,3,opt,name=QueryPreparationTime,proto3" json:"queryPreparationTime"` + InnerEvalTime float32 `protobuf:"fixed32,4,opt,name=InnerEvalTime,proto3" json:"innerEvalTime"` + ExecQueueTime float32 `protobuf:"fixed32,5,opt,name=ExecQueueTime,proto3" json:"execQueueTime"` + ExecTotalTime float32 `protobuf:"fixed32,6,opt,name=ExecTotalTime,proto3" json:"execTotalTime"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PrometheusResponseStats_Timings) Reset() { *m = PrometheusResponseStats_Timings{} } +func (m *PrometheusResponseStats_Timings) String() string { return proto.CompactTextString(m) } +func (*PrometheusResponseStats_Timings) ProtoMessage() {} +func (*PrometheusResponseStats_Timings) Descriptor() ([]byte, []int) { + return fileDescriptor_9af7607b46ac39b7, []int{10, 0} +} +func (m *PrometheusResponseStats_Timings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PrometheusResponseStats_Timings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PrometheusResponseStats_Timings.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 *PrometheusResponseStats_Timings) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrometheusResponseStats_Timings.Merge(m, src) +} +func (m *PrometheusResponseStats_Timings) XXX_Size() int { + return m.Size() +} +func (m *PrometheusResponseStats_Timings) XXX_DiscardUnknown() { + xxx_messageInfo_PrometheusResponseStats_Timings.DiscardUnknown(m) +} + +var xxx_messageInfo_PrometheusResponseStats_Timings proto.InternalMessageInfo + +func (m *PrometheusResponseStats_Timings) GetEvalTotalTime() float32 { + if m != nil { + return m.EvalTotalTime + } + return 0 +} + +func (m *PrometheusResponseStats_Timings) GetResultSortTime() float32 { + if m != nil { + return m.ResultSortTime + } + return 0 +} + +func (m *PrometheusResponseStats_Timings) GetQueryPreparationTime() float32 { + if m != nil { + return m.QueryPreparationTime + } + return 0 +} + +func (m *PrometheusResponseStats_Timings) GetInnerEvalTime() float32 { + if m != nil { + return m.InnerEvalTime + } + return 0 +} + +func (m *PrometheusResponseStats_Timings) GetExecQueueTime() float32 { + if m != nil { + return m.ExecQueueTime + } + return 0 +} + +func (m *PrometheusResponseStats_Timings) GetExecTotalTime() float32 { + if m != nil { + return m.ExecTotalTime + } + return 0 +} + +type PrometheusResponseStats_Samples struct { + TotalQueryableSamples int64 `protobuf:"varint,1,opt,name=TotalQueryableSamples,proto3" json:"totalQueryableSamples"` + PeakSamples int64 `protobuf:"varint,2,opt,name=PeakSamples,proto3" json:"peakSamples"` + TotalQueryableSamplesPerStep []*PrometheusResponseQueryableSamplesStatsPerStep `protobuf:"bytes,3,rep,name=totalQueryableSamplesPerStep,proto3" json:"totalQueryableSamplesPerStep"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *PrometheusResponseSamplesStats) Reset() { *m = PrometheusResponseSamplesStats{} } -func (m *PrometheusResponseSamplesStats) String() string { return proto.CompactTextString(m) } -func (*PrometheusResponseSamplesStats) ProtoMessage() {} -func (*PrometheusResponseSamplesStats) Descriptor() ([]byte, []int) { - return fileDescriptor_9af7607b46ac39b7, []int{11} +func (m *PrometheusResponseStats_Samples) Reset() { *m = PrometheusResponseStats_Samples{} } +func (m *PrometheusResponseStats_Samples) String() string { return proto.CompactTextString(m) } +func (*PrometheusResponseStats_Samples) ProtoMessage() {} +func (*PrometheusResponseStats_Samples) Descriptor() ([]byte, []int) { + return fileDescriptor_9af7607b46ac39b7, []int{10, 1} } -func (m *PrometheusResponseSamplesStats) XXX_Unmarshal(b []byte) error { +func (m *PrometheusResponseStats_Samples) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PrometheusResponseSamplesStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *PrometheusResponseStats_Samples) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PrometheusResponseSamplesStats.Marshal(b, m, deterministic) + return xxx_messageInfo_PrometheusResponseStats_Samples.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -838,26 +934,33 @@ func (m *PrometheusResponseSamplesStats) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } -func (m *PrometheusResponseSamplesStats) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrometheusResponseSamplesStats.Merge(m, src) +func (m *PrometheusResponseStats_Samples) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrometheusResponseStats_Samples.Merge(m, src) } -func (m *PrometheusResponseSamplesStats) XXX_Size() int { +func (m *PrometheusResponseStats_Samples) XXX_Size() int { return m.Size() } -func (m *PrometheusResponseSamplesStats) XXX_DiscardUnknown() { - xxx_messageInfo_PrometheusResponseSamplesStats.DiscardUnknown(m) +func (m *PrometheusResponseStats_Samples) XXX_DiscardUnknown() { + xxx_messageInfo_PrometheusResponseStats_Samples.DiscardUnknown(m) } -var xxx_messageInfo_PrometheusResponseSamplesStats proto.InternalMessageInfo +var xxx_messageInfo_PrometheusResponseStats_Samples proto.InternalMessageInfo -func (m *PrometheusResponseSamplesStats) GetTotalQueryableSamples() int64 { +func (m *PrometheusResponseStats_Samples) GetTotalQueryableSamples() int64 { if m != nil { return m.TotalQueryableSamples } return 0 } -func (m *PrometheusResponseSamplesStats) GetTotalQueryableSamplesPerStep() []*PrometheusResponseQueryableSamplesStatsPerStep { +func (m *PrometheusResponseStats_Samples) GetPeakSamples() int64 { + if m != nil { + return m.PeakSamples + } + return 0 +} + +func (m *PrometheusResponseStats_Samples) GetTotalQueryableSamplesPerStep() []*PrometheusResponseQueryableSamplesStatsPerStep { if m != nil { return m.TotalQueryableSamplesPerStep } @@ -880,7 +983,7 @@ func (m *PrometheusResponseQueryableSamplesStatsPerStep) String() string { } func (*PrometheusResponseQueryableSamplesStatsPerStep) ProtoMessage() {} func (*PrometheusResponseQueryableSamplesStatsPerStep) Descriptor() ([]byte, []int) { - return fileDescriptor_9af7607b46ac39b7, []int{12} + return fileDescriptor_9af7607b46ac39b7, []int{11} } func (m *PrometheusResponseQueryableSamplesStatsPerStep) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -936,7 +1039,7 @@ func (m *SampleStream) Reset() { *m = SampleStream{} } func (m *SampleStream) String() string { return proto.CompactTextString(m) } func (*SampleStream) ProtoMessage() {} func (*SampleStream) Descriptor() ([]byte, []int) { - return fileDescriptor_9af7607b46ac39b7, []int{13} + return fileDescriptor_9af7607b46ac39b7, []int{12} } func (m *SampleStream) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -993,7 +1096,7 @@ func (m *Sample) Reset() { *m = Sample{} } func (m *Sample) String() string { return proto.CompactTextString(m) } func (*Sample) ProtoMessage() {} func (*Sample) Descriptor() ([]byte, []int) { - return fileDescriptor_9af7607b46ac39b7, []int{14} + return fileDescriptor_9af7607b46ac39b7, []int{13} } func (m *Sample) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1055,7 +1158,7 @@ func (m *StringSample) Reset() { *m = StringSample{} } func (m *StringSample) String() string { return proto.CompactTextString(m) } func (*StringSample) ProtoMessage() {} func (*StringSample) Descriptor() ([]byte, []int) { - return fileDescriptor_9af7607b46ac39b7, []int{15} + return fileDescriptor_9af7607b46ac39b7, []int{14} } func (m *StringSample) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1110,7 +1213,7 @@ func (m *SampleHistogramPair) Reset() { *m = SampleHistogramPair{} } func (m *SampleHistogramPair) String() string { return proto.CompactTextString(m) } func (*SampleHistogramPair) ProtoMessage() {} func (*SampleHistogramPair) Descriptor() ([]byte, []int) { - return fileDescriptor_9af7607b46ac39b7, []int{16} + return fileDescriptor_9af7607b46ac39b7, []int{15} } func (m *SampleHistogramPair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1166,7 +1269,7 @@ func (m *SampleHistogram) Reset() { *m = SampleHistogram{} } func (m *SampleHistogram) String() string { return proto.CompactTextString(m) } func (*SampleHistogram) ProtoMessage() {} func (*SampleHistogram) Descriptor() ([]byte, []int) { - return fileDescriptor_9af7607b46ac39b7, []int{17} + return fileDescriptor_9af7607b46ac39b7, []int{16} } func (m *SampleHistogram) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1230,7 +1333,7 @@ func (m *HistogramBucket) Reset() { *m = HistogramBucket{} } func (m *HistogramBucket) String() string { return proto.CompactTextString(m) } func (*HistogramBucket) ProtoMessage() {} func (*HistogramBucket) Descriptor() ([]byte, []int) { - return fileDescriptor_9af7607b46ac39b7, []int{18} + return fileDescriptor_9af7607b46ac39b7, []int{17} } func (m *HistogramBucket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1300,7 +1403,7 @@ func (m *CachedResponse) Reset() { *m = CachedResponse{} } func (m *CachedResponse) String() string { return proto.CompactTextString(m) } func (*CachedResponse) ProtoMessage() {} func (*CachedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9af7607b46ac39b7, []int{19} + return fileDescriptor_9af7607b46ac39b7, []int{18} } func (m *CachedResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1357,7 +1460,7 @@ func (m *Extent) Reset() { *m = Extent{} } func (m *Extent) String() string { return proto.CompactTextString(m) } func (*Extent) ProtoMessage() {} func (*Extent) Descriptor() ([]byte, []int) { - return fileDescriptor_9af7607b46ac39b7, []int{20} + return fileDescriptor_9af7607b46ac39b7, []int{19} } func (m *Extent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1425,7 +1528,7 @@ func (m *CachingOptions) Reset() { *m = CachingOptions{} } func (m *CachingOptions) String() string { return proto.CompactTextString(m) } func (*CachingOptions) ProtoMessage() {} func (*CachingOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_9af7607b46ac39b7, []int{21} + return fileDescriptor_9af7607b46ac39b7, []int{20} } func (m *CachingOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1473,7 +1576,7 @@ func (m *Explanation) Reset() { *m = Explanation{} } func (m *Explanation) String() string { return proto.CompactTextString(m) } func (*Explanation) ProtoMessage() {} func (*Explanation) Descriptor() ([]byte, []int) { - return fileDescriptor_9af7607b46ac39b7, []int{22} + return fileDescriptor_9af7607b46ac39b7, []int{21} } func (m *Explanation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1528,7 +1631,8 @@ func init() { proto.RegisterType((*Vector)(nil), "queryrange.Vector") proto.RegisterType((*Matrix)(nil), "queryrange.Matrix") proto.RegisterType((*PrometheusResponseStats)(nil), "queryrange.PrometheusResponseStats") - proto.RegisterType((*PrometheusResponseSamplesStats)(nil), "queryrange.PrometheusResponseSamplesStats") + proto.RegisterType((*PrometheusResponseStats_Timings)(nil), "queryrange.PrometheusResponseStats.Timings") + proto.RegisterType((*PrometheusResponseStats_Samples)(nil), "queryrange.PrometheusResponseStats.Samples") proto.RegisterType((*PrometheusResponseQueryableSamplesStatsPerStep)(nil), "queryrange.PrometheusResponseQueryableSamplesStatsPerStep") proto.RegisterType((*SampleStream)(nil), "queryrange.SampleStream") proto.RegisterType((*Sample)(nil), "queryrange.Sample") @@ -1547,97 +1651,107 @@ func init() { } var fileDescriptor_9af7607b46ac39b7 = []byte{ - // 1427 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcd, 0x73, 0x1b, 0xc5, - 0x12, 0xcf, 0x4a, 0xf2, 0x5a, 0x6a, 0xf9, 0xd9, 0xc9, 0x38, 0xef, 0x45, 0xf6, 0xf3, 0xf3, 0xea, - 0x6d, 0x28, 0xca, 0x84, 0x44, 0xaa, 0x32, 0x15, 0x0e, 0xa9, 0x22, 0xe0, 0x25, 0x01, 0x27, 0x95, - 0x0f, 0x67, 0x9c, 0xca, 0x81, 0x4b, 0x6a, 0x24, 0x0d, 0xd2, 0x92, 0xd5, 0xee, 0x66, 0x76, 0x36, - 0xd8, 0x37, 0xfe, 0x08, 0x0e, 0x9c, 0x28, 0xa8, 0xe2, 0x42, 0x15, 0x7f, 0x01, 0x37, 0x6e, 0x39, - 0x72, 0xe6, 0xb0, 0x50, 0x39, 0xee, 0x89, 0x3f, 0x81, 0x9a, 0x8f, 0xd5, 0xce, 0xca, 0x1f, 0x29, - 0x17, 0x17, 0xe0, 0x62, 0xcd, 0xf4, 0xd7, 0x74, 0xff, 0xba, 0xa7, 0xb7, 0xc7, 0x70, 0x65, 0x18, - 0x31, 0x4e, 0x0f, 0xfa, 0xcf, 0x53, 0xca, 0x7c, 0xca, 0xe4, 0xef, 0x21, 0x23, 0xe1, 0x98, 0x1a, - 0xcb, 0x5e, 0xcc, 0x22, 0x1e, 0x21, 0x28, 0x29, 0xeb, 0x17, 0xc7, 0xd1, 0x38, 0x92, 0xe4, 0xbe, - 0x58, 0x29, 0x89, 0xf5, 0xcd, 0x71, 0x14, 0x8d, 0x03, 0xda, 0x97, 0xbb, 0x41, 0xfa, 0x69, 0x7f, - 0x94, 0x32, 0xc2, 0xfd, 0x28, 0xd4, 0xfc, 0x0d, 0x7d, 0x9a, 0xfa, 0x89, 0x07, 0x7a, 0xa1, 0xb9, - 0x6b, 0xf3, 0xda, 0x24, 0x3c, 0x54, 0x2c, 0x77, 0x1f, 0x2e, 0xed, 0xb1, 0x68, 0x4a, 0xf9, 0x84, - 0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a, 0x3b, 0x76, 0xa1, 0xc9, 0x19, 0x19, 0xd2, 0xa7, 0xfe, 0x48, - 0x8f, 0x6e, 0xc5, 0x9c, 0x25, 0xc9, 0x77, 0x46, 0xe8, 0x26, 0x34, 0x99, 0x0e, 0x47, 0x3f, 0x25, - 0x2f, 0x1e, 0x79, 0x4a, 0xee, 0x84, 0x87, 0xde, 0x52, 0x9e, 0x39, 0x33, 0x49, 0x3c, 0x5b, 0xdd, - 0x6d, 0x34, 0xeb, 0xe7, 0x1b, 0xee, 0x55, 0x05, 0x8d, 0xf1, 0x04, 0x5c, 0x87, 0xe6, 0xc8, 0x4f, - 0x44, 0xd3, 0x1d, 0x49, 0xc7, 0x9b, 0x78, 0xb6, 0x77, 0xc3, 0xca, 0xa8, 0x83, 0x36, 0xa0, 0x11, - 0x96, 0xaf, 0xb6, 0x66, 0x9e, 0x39, 0x72, 0x8f, 0xe5, 0x5f, 0xb4, 0x03, 0xcd, 0xe1, 0xc4, 0x0f, - 0x46, 0x8c, 0x86, 0x1a, 0xc9, 0x13, 0x87, 0x22, 0xe9, 0x63, 0x21, 0x8c, 0x67, 0x2b, 0xaf, 0xf3, - 0xf2, 0xd5, 0xa6, 0xf5, 0xf3, 0xab, 0x4d, 0xeb, 0xb7, 0x57, 0x9b, 0xd6, 0x27, 0xc6, 0x7f, 0x1c, - 0x06, 0xb6, 0x8c, 0xf1, 0x9d, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x8e, 0x21, 0xfd, 0xb2, - 0x10, 0x00, 0x00, + // 1598 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, + 0x15, 0xf7, 0x92, 0xd4, 0x92, 0x7c, 0x94, 0x25, 0x7b, 0x24, 0xd7, 0x94, 0xaa, 0x6a, 0xd5, 0x75, + 0x51, 0xa8, 0xfe, 0xa0, 0x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0xd4, 0x99, 0x20, 0xf1, 0xa4, 0xf5, 0xa0, 0xd6, 0xa8, 0x5e, 0xaa, 0xb9, + 0x37, 0x15, 0x35, 0xc6, 0x73, 0x7f, 0x15, 0x1a, 0x03, 0x3f, 0x16, 0x9b, 0xee, 0x40, 0x4e, 0xbc, + 0x81, 0x27, 0x7d, 0x37, 0x28, 0x5d, 0x6b, 0xd1, 0x1a, 0xd4, 0x82, 0xe2, 0x85, 0xde, 0xc8, 0x52, + 0x47, 0xf6, 0xb1, 0xfc, 0x45, 0x3b, 0xd0, 0xe8, 0x1f, 0xfa, 0xa3, 0x01, 0xa3, 0x81, 0x66, 0xf2, + 0xd4, 0x0b, 0xb0, 0x9c, 0x63, 0x0e, 0xc6, 0x93, 0x96, 0xd7, 0x7e, 0xfd, 0x66, 0xdd, 0xfa, 0xea, + 0xcd, 0xba, 0xf5, 0xed, 0x9b, 0x75, 0xeb, 0xbf, 0xc6, 0xd7, 0xa5, 0x9e, 0x2d, 0x63, 0xfc, 0xcb, + 0x8f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd4, 0xd6, 0xab, 0xc8, 0x9e, 0x12, 0x00, 0x00, } func (m *PrometheusRequestHeader) Marshal() (dAtA []byte, err error) { @@ -2341,12 +2455,24 @@ func (m *PrometheusResponseStats) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintQueryrange(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x12 + } + if m.Timings != nil { + { + size, err := m.Timings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryrange(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *PrometheusResponseSamplesStats) Marshal() (dAtA []byte, err error) { +func (m *PrometheusResponseStats_Timings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2356,12 +2482,75 @@ func (m *PrometheusResponseSamplesStats) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PrometheusResponseSamplesStats) MarshalTo(dAtA []byte) (int, error) { +func (m *PrometheusResponseStats_Timings) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PrometheusResponseSamplesStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PrometheusResponseStats_Timings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ExecTotalTime != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.ExecTotalTime)))) + i-- + dAtA[i] = 0x35 + } + if m.ExecQueueTime != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.ExecQueueTime)))) + i-- + dAtA[i] = 0x2d + } + if m.InnerEvalTime != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.InnerEvalTime)))) + i-- + dAtA[i] = 0x25 + } + if m.QueryPreparationTime != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.QueryPreparationTime)))) + i-- + dAtA[i] = 0x1d + } + if m.ResultSortTime != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.ResultSortTime)))) + i-- + dAtA[i] = 0x15 + } + if m.EvalTotalTime != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.EvalTotalTime)))) + i-- + dAtA[i] = 0xd + } + return len(dAtA) - i, nil +} + +func (m *PrometheusResponseStats_Samples) 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 *PrometheusResponseStats_Samples) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrometheusResponseStats_Samples) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2381,9 +2570,14 @@ func (m *PrometheusResponseSamplesStats) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintQueryrange(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } } + if m.PeakSamples != 0 { + i = encodeVarintQueryrange(dAtA, i, uint64(m.PeakSamples)) + i-- + dAtA[i] = 0x10 + } if m.TotalQueryableSamples != 0 { i = encodeVarintQueryrange(dAtA, i, uint64(m.TotalQueryableSamples)) i-- @@ -3258,6 +3452,10 @@ func (m *PrometheusResponseStats) Size() (n int) { } var l int _ = l + if m.Timings != nil { + l = m.Timings.Size() + n += 1 + l + sovQueryrange(uint64(l)) + } if m.Samples != nil { l = m.Samples.Size() n += 1 + l + sovQueryrange(uint64(l)) @@ -3268,7 +3466,37 @@ func (m *PrometheusResponseStats) Size() (n int) { return n } -func (m *PrometheusResponseSamplesStats) Size() (n int) { +func (m *PrometheusResponseStats_Timings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EvalTotalTime != 0 { + n += 5 + } + if m.ResultSortTime != 0 { + n += 5 + } + if m.QueryPreparationTime != 0 { + n += 5 + } + if m.InnerEvalTime != 0 { + n += 5 + } + if m.ExecQueueTime != 0 { + n += 5 + } + if m.ExecTotalTime != 0 { + n += 5 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PrometheusResponseStats_Samples) Size() (n int) { if m == nil { return 0 } @@ -3277,6 +3505,9 @@ func (m *PrometheusResponseSamplesStats) Size() (n int) { if m.TotalQueryableSamples != 0 { n += 1 + sovQueryrange(uint64(m.TotalQueryableSamples)) } + if m.PeakSamples != 0 { + n += 1 + sovQueryrange(uint64(m.PeakSamples)) + } if len(m.TotalQueryableSamplesPerStep) > 0 { for _, e := range m.TotalQueryableSamplesPerStep { l = e.Size() @@ -5270,6 +5501,42 @@ func (m *PrometheusResponseStats) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryrange + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryrange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timings == nil { + m.Timings = &PrometheusResponseStats_Timings{} + } + if err := m.Timings.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) } @@ -5299,7 +5566,7 @@ func (m *PrometheusResponseStats) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Samples == nil { - m.Samples = &PrometheusResponseSamplesStats{} + m.Samples = &PrometheusResponseStats_Samples{} } if err := m.Samples.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -5327,7 +5594,7 @@ func (m *PrometheusResponseStats) Unmarshal(dAtA []byte) error { } return nil } -func (m *PrometheusResponseSamplesStats) Unmarshal(dAtA []byte) error { +func (m *PrometheusResponseStats_Timings) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5350,10 +5617,127 @@ func (m *PrometheusResponseSamplesStats) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PrometheusResponseSamplesStats: wiretype end group for non-group") + return fmt.Errorf("proto: Timings: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PrometheusResponseSamplesStats: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Timings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field EvalTotalTime", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.EvalTotalTime = float32(math.Float32frombits(v)) + case 2: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field ResultSortTime", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.ResultSortTime = float32(math.Float32frombits(v)) + case 3: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryPreparationTime", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.QueryPreparationTime = float32(math.Float32frombits(v)) + case 4: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field InnerEvalTime", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.InnerEvalTime = float32(math.Float32frombits(v)) + case 5: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecQueueTime", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.ExecQueueTime = float32(math.Float32frombits(v)) + case 6: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecTotalTime", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.ExecTotalTime = float32(math.Float32frombits(v)) + default: + iNdEx = preIndex + skippy, err := skipQueryrange(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryrange + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PrometheusResponseStats_Samples) 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 ErrIntOverflowQueryrange + } + 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: Samples: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Samples: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -5376,6 +5760,25 @@ func (m *PrometheusResponseSamplesStats) Unmarshal(dAtA []byte) error { } } case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PeakSamples", wireType) + } + m.PeakSamples = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryrange + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PeakSamples |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TotalQueryableSamplesPerStep", wireType) } diff --git a/internal/cortex/querier/queryrange/queryrange.proto b/internal/cortex/querier/queryrange/queryrange.proto index 77e3bbdc55b..e12fdd60f9a 100644 --- a/internal/cortex/querier/queryrange/queryrange.proto +++ b/internal/cortex/querier/queryrange/queryrange.proto @@ -84,12 +84,22 @@ message Matrix { } message PrometheusResponseStats { - PrometheusResponseSamplesStats samples = 1 [(gogoproto.jsontag) = "samples"]; -} + message Timings { + float EvalTotalTime = 1 [(gogoproto.jsontag) = "evalTotalTime"]; + float ResultSortTime = 2 [(gogoproto.jsontag) = "resultSortTime"]; + float QueryPreparationTime = 3 [(gogoproto.jsontag) = "queryPreparationTime"]; + float InnerEvalTime = 4 [(gogoproto.jsontag) = "innerEvalTime"]; + float ExecQueueTime = 5 [(gogoproto.jsontag) = "execQueueTime"]; + float ExecTotalTime = 6 [(gogoproto.jsontag) = "execTotalTime"]; + } + message Samples { + int64 TotalQueryableSamples = 1 [(gogoproto.jsontag) = "totalQueryableSamples"]; + int64 PeakSamples = 2 [(gogoproto.jsontag) = "peakSamples"]; + repeated PrometheusResponseQueryableSamplesStatsPerStep totalQueryableSamplesPerStep = 3 [(gogoproto.jsontag) = "totalQueryableSamplesPerStep"]; + } -message PrometheusResponseSamplesStats { - int64 totalQueryableSamples = 1 [(gogoproto.jsontag) = "totalQueryableSamples"]; - repeated PrometheusResponseQueryableSamplesStatsPerStep totalQueryableSamplesPerStep = 2 [(gogoproto.jsontag) = "totalQueryableSamplesPerStep"]; + Timings timings = 1 [(gogoproto.jsontag) = "timings"]; + Samples samples = 2 [(gogoproto.jsontag) = "samples"]; } message PrometheusResponseQueryableSamplesStatsPerStep { diff --git a/internal/cortex/querier/queryrange/results_cache.go b/internal/cortex/querier/queryrange/results_cache.go index de0f7e8149e..b54224520f6 100644 --- a/internal/cortex/querier/queryrange/results_cache.go +++ b/internal/cortex/querier/queryrange/results_cache.go @@ -70,10 +70,6 @@ func (cfg *ResultsCacheConfig) Validate(qCfg querier.Config) error { return errors.Errorf("unsupported compression type: %s", cfg.Compression) } - if cfg.CacheQueryableSamplesStats && !qCfg.EnablePerStepStats { - return errors.New("frontend.cache-queryable-samples-stats may only be enabled in conjunction with querier.per-step-stats-enabled. Please set the latter") - } - return cfg.CacheConfig.Validate() } @@ -520,6 +516,15 @@ func (s resultsCache) handleHit(ctx context.Context, r Request, extents []Extent } response, err := s.merger.MergeResponse(r, responses...) + if err == nil { + if promResp, ok := response.(*PrometheusResponse); ok { + promResp.Headers = append(promResp.Headers, &PrometheusResponseHeader{ + Name: "X-Thanos-Results-Cache", + Values: []string{fmt.Sprintf("hit; extents=%d", len(extents))}, + }) + } + } + return response, mergedExtents, err } @@ -704,7 +709,12 @@ func extractStats(start, end int64, stats *PrometheusResponseStats) *PrometheusR return stats } - result := &PrometheusResponseStats{Samples: &PrometheusResponseSamplesStats{}} + result := &PrometheusResponseStats{ + Samples: &PrometheusResponseStats_Samples{ + PeakSamples: stats.Samples.PeakSamples, + }, + Timings: stats.Timings, + } for _, s := range stats.Samples.TotalQueryableSamplesPerStep { if start <= s.TimestampMs && s.TimestampMs <= end { result.Samples.TotalQueryableSamplesPerStep = append(result.Samples.TotalQueryableSamplesPerStep, s) diff --git a/pkg/queryfrontend/config.go b/pkg/queryfrontend/config.go index 176052bd331..9d88ed11e42 100644 --- a/pkg/queryfrontend/config.go +++ b/pkg/queryfrontend/config.go @@ -199,17 +199,19 @@ type Config struct { LabelsConfig DownstreamTripperConfig - CortexHandlerConfig *transport.HandlerConfig - CompressResponses bool - CacheCompression string - RequestLoggingDecision string - DownstreamURL string - ForwardHeaders []string - NumShards int - TenantHeader string - DefaultTenant string - TenantCertField string - EnableXFunctions bool + CortexHandlerConfig *transport.HandlerConfig + CompressResponses bool + CacheCompression string + CacheQueryableSamplesStats bool + QueryStatsEnabled bool + RequestLoggingDecision string + DownstreamURL string + ForwardHeaders []string + NumShards int + TenantHeader string + DefaultTenant string + TenantCertField string + EnableXFunctions bool } // QueryRangeConfig holds the config for query range tripperware. diff --git a/pkg/queryfrontend/queryrange_codec.go b/pkg/queryfrontend/queryrange_codec.go index 36080d68210..8ade7995ea2 100644 --- a/pkg/queryfrontend/queryrange_codec.go +++ b/pkg/queryfrontend/queryrange_codec.go @@ -128,6 +128,8 @@ func (c queryRangeCodec) DecodeRequest(_ context.Context, r *http.Request, forwa return nil, err } + result.Stats = r.FormValue("stats") + result.Query = r.FormValue("query") result.Analyze = r.FormValue(queryv1.QueryAnalyzeParam) result.Engine = r.FormValue(queryv1.EngineParam) @@ -166,6 +168,7 @@ func (c queryRangeCodec) EncodeRequest(ctx context.Context, r queryrange.Request queryv1.DedupParam: []string{strconv.FormatBool(thanosReq.Dedup)}, queryv1.PartialResponseParam: []string{strconv.FormatBool(thanosReq.PartialResponse)}, queryv1.ReplicaLabelsParam: thanosReq.ReplicaLabels, + "stats": []string{thanosReq.Stats}, } if thanosReq.AutoDownsampling { diff --git a/pkg/queryfrontend/roundtrip.go b/pkg/queryfrontend/roundtrip.go index b901950ba89..eaeb6ee0167 100644 --- a/pkg/queryfrontend/roundtrip.go +++ b/pkg/queryfrontend/roundtrip.go @@ -4,6 +4,7 @@ package queryfrontend import ( + "context" "net/http" "regexp" "strings" @@ -62,7 +63,10 @@ func NewTripperware(config Config, reg prometheus.Registerer, logger log.Logger) queryRangeLimits, queryRangeCodec, config.NumShards, - prometheus.WrapRegistererWith(prometheus.Labels{"tripperware": "query_range"}, reg), logger, config.ForwardHeaders) + prometheus.WrapRegistererWith(prometheus.Labels{"tripperware": "query_range"}, reg), + logger, + config.ForwardHeaders, + config.QueryStatsEnabled) if err != nil { return nil, err } @@ -78,6 +82,7 @@ func NewTripperware(config Config, reg prometheus.Registerer, logger log.Logger) queryInstantCodec, prometheus.WrapRegistererWith(prometheus.Labels{"tripperware": "query_instant"}, reg), config.ForwardHeaders, + logger, ) return func(next http.RoundTripper) http.RoundTripper { tripper := newRoundTripper( @@ -165,6 +170,7 @@ func newQueryRangeTripperware( reg prometheus.Registerer, logger log.Logger, forwardHeaders []string, + queryStatsEnabled bool, ) (queryrange.Tripperware, error) { queryRangeMiddleware := []queryrange.Middleware{queryrange.NewLimitsMiddleware(limits)} m := queryrange.NewInstrumentMiddlewareMetrics(reg) @@ -235,6 +241,13 @@ func newQueryRangeTripperware( ) } + if queryStatsEnabled { + queryRangeMiddleware = append( + queryRangeMiddleware, + InjectStatsMiddleware(logger), + ) + } + return func(next http.RoundTripper) http.RoundTripper { rt := queryrange.NewRoundTripper(next, codec, forwardHeaders, queryRangeMiddleware...) return queryrange.RoundTripFunc(func(r *http.Request) (*http.Response, error) { @@ -243,6 +256,16 @@ func newQueryRangeTripperware( }, nil } +func InjectStatsMiddleware(logger log.Logger) queryrange.Middleware { + return queryrange.MiddlewareFunc(func(next queryrange.Handler) queryrange.Handler { + return queryrange.HandlerFunc(func(ctx context.Context, r queryrange.Request) (queryrange.Response, error) { + r = r.WithStats("all") + resp, err := next.Do(ctx, r) + return resp, err + }) + }) +} + func dynamicIntervalFn(config QueryRangeConfig) queryrange.IntervalFn { return func(r queryrange.Request) time.Duration { // Use static interval, by default. @@ -329,13 +352,7 @@ func newLabelsTripperware( }, nil } -func newInstantQueryTripperware( - numShards int, - limits queryrange.Limits, - codec queryrange.Codec, - reg prometheus.Registerer, - forwardHeaders []string, -) queryrange.Tripperware { +func newInstantQueryTripperware(numShards int, limits queryrange.Limits, codec queryrange.Codec, reg prometheus.Registerer, forwardHeaders []string, logger log.Logger) queryrange.Tripperware { instantQueryMiddlewares := []queryrange.Middleware{} m := queryrange.NewInstrumentMiddlewareMetrics(reg) if numShards > 0 { @@ -344,6 +361,7 @@ func newInstantQueryTripperware( instantQueryMiddlewares, queryrange.InstrumentMiddleware("sharding", m), PromQLShardingMiddleware(analyzer, numShards, limits, codec, reg), + InjectStatsMiddleware(logger), ) }