diff --git a/cmd/thanos/query.go b/cmd/thanos/query.go index 4862440af16..d6dc2535e5b 100644 --- a/cmd/thanos/query.go +++ b/cmd/thanos/query.go @@ -29,6 +29,7 @@ import ( v1 "github.com/prometheus/prometheus/web/api/v1" "github.com/thanos-community/promql-engine/engine" + apiv1 "github.com/thanos-io/thanos/pkg/api/query" "github.com/thanos-io/thanos/pkg/compact/downsample" "github.com/thanos-io/thanos/pkg/component" @@ -97,6 +98,7 @@ func registerQuery(app *extkingpin.App) { queryTimeout := extkingpin.ModelDuration(cmd.Flag("query.timeout", "Maximum time to process query by query node."). Default("2m")) + promqlEngine := cmd.Flag("query.promql-engine", "PromQL engine to use.").Default(string(promqlEnginePrometheus)).Hidden(). Enum(string(promqlEnginePrometheus), string(promqlEngineThanos)) diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index ad75d54a09b..8f2788a3508 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -133,7 +133,6 @@ type bucketStoreMetrics struct { queriesDropped *prometheus.CounterVec seriesRefetches prometheus.Counter emptyPostingCount prometheus.Counter - emptyStreamResponses prometheus.Counter cachedPostingsCompressions *prometheus.CounterVec cachedPostingsCompressionErrors *prometheus.CounterVec @@ -282,11 +281,6 @@ func newBucketStoreMetrics(reg prometheus.Registerer) *bucketStoreMetrics { Help: "Total number of empty postings when fetching block series.", }) - m.emptyStreamResponses = promauto.With(reg).NewCounter(prometheus.CounterOpts{ - Name: "thanos_bucket_store_empty_blocks_total", - Help: "Total number of queried blocks that have no matching series.", - }) - return &m } @@ -885,7 +879,6 @@ func (b *blockSeriesClient) MergeStats(stats *queryStats) *queryStats { func (b *blockSeriesClient) ExpandPostings( matchers []*labels.Matcher, seriesLimiter SeriesLimiter, - emptyPostingsCount prometheus.Counter, ) error { ps, err := b.indexr.ExpandedPostings(b.ctx, matchers, b.bytesLimiter) if err != nil { @@ -893,7 +886,6 @@ func (b *blockSeriesClient) ExpandPostings( } if len(ps) == 0 { - emptyPostingsCount.Inc() return nil } @@ -1225,7 +1217,7 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_Serie "block.resolution": blk.meta.Thanos.Downsample.Resolution, }) - if err := blockClient.ExpandPostings(blockMatchers, seriesLimiter, s.metrics.emptyPostingCount); err != nil { + if err := blockClient.ExpandPostings(blockMatchers, seriesLimiter); err != nil { span.Finish() return errors.Wrapf(err, "fetch series for block %s", blk.meta.ULID) } @@ -1244,7 +1236,7 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_Serie blockClient, shardMatcher, false, - blk.metrics.emptyStreamResponses, + s.metrics.emptyPostingCount, ) mtx.Lock() @@ -1463,7 +1455,6 @@ func (s *BucketStore) LabelNames(ctx context.Context, req *storepb.LabelNamesReq if err := blockClient.ExpandPostings( reqSeriesMatchersNoExtLabels, seriesLimiter, - s.metrics.emptyPostingCount, ); err != nil { return err } @@ -1638,7 +1629,6 @@ func (s *BucketStore) LabelValues(ctx context.Context, req *storepb.LabelValuesR if err := blockClient.ExpandPostings( reqSeriesMatchersNoExtLabels, seriesLimiter, - s.metrics.emptyPostingCount, ); err != nil { return err } diff --git a/pkg/store/proxy_heap.go b/pkg/store/proxy_heap.go index a63e54dd24b..5cdb5a0b781 100644 --- a/pkg/store/proxy_heap.go +++ b/pkg/store/proxy_heap.go @@ -366,7 +366,6 @@ func newLazyRespSet( shardMatcher *storepb.ShardMatcher, applySharding bool, emptyStreamResponses prometheus.Counter, - ) respSet { bufferedResponses := []*storepb.SeriesResponse{} bufferedResponsesMtx := &sync.Mutex{}