From 5378c3e5c9fad4362649d434fc95da834a4c2734 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Tue, 9 Apr 2024 14:35:14 -0700 Subject: [PATCH 1/3] update thanos to latest main to disable overlapping sources check Signed-off-by: Ben Ye --- go.mod | 4 ++-- go.sum | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 14584cc118..15da85135c 100644 --- a/go.mod +++ b/go.mod @@ -52,8 +52,8 @@ require ( github.com/spf13/afero v1.11.0 github.com/stretchr/testify v1.9.0 github.com/thanos-io/objstore v0.0.0-20240309075357-e8336a5fd5f3 - github.com/thanos-io/promql-engine v0.0.0-20240327143517-c5e4b2e6ef02 - github.com/thanos-io/thanos v0.34.2-0.20240328185924-943401f726ed + github.com/thanos-io/promql-engine v0.0.0-20240405095051-b7d0da367508 + github.com/thanos-io/thanos v0.34.2-0.20240409164351-953ce26ad746 github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/weaveworks/common v0.0.0-20230728070032-dd9e68f319d5 go.etcd.io/etcd/api/v3 v3.5.12 diff --git a/go.sum b/go.sum index 54878177a9..cd5d7b7a90 100644 --- a/go.sum +++ b/go.sum @@ -1402,8 +1402,12 @@ github.com/thanos-io/objstore v0.0.0-20240309075357-e8336a5fd5f3 h1:Q0BjHI7FMe5K github.com/thanos-io/objstore v0.0.0-20240309075357-e8336a5fd5f3/go.mod h1:ptMYNPgbyAR7a2Ab2t7zHA2/0be2ePyawVR7lp7fZtg= github.com/thanos-io/promql-engine v0.0.0-20240327143517-c5e4b2e6ef02 h1:lSzA+ZGblFAh18uI3ziBmWCASxQR4CqwO3UEstv99Kg= github.com/thanos-io/promql-engine v0.0.0-20240327143517-c5e4b2e6ef02/go.mod h1:FEPnabuTql1bDA4OUM41mwcZOJ20R436k8vq+xtGEG0= +github.com/thanos-io/promql-engine v0.0.0-20240405095051-b7d0da367508 h1:4X0ThYb7/wTTKS73wT13ixw0lj5OJ87g45RWIZhPZDA= +github.com/thanos-io/promql-engine v0.0.0-20240405095051-b7d0da367508/go.mod h1:FEPnabuTql1bDA4OUM41mwcZOJ20R436k8vq+xtGEG0= github.com/thanos-io/thanos v0.34.2-0.20240328185924-943401f726ed h1:WAGbjaUpZUdem8OY3jF0ReTtCXKmQKu+g4sWNkBA2JQ= github.com/thanos-io/thanos v0.34.2-0.20240328185924-943401f726ed/go.mod h1:CVOISIxBlYk+wIzYayY1wlwFrsSpQsqAnPFTn61jAWU= +github.com/thanos-io/thanos v0.34.2-0.20240409164351-953ce26ad746 h1:xJCETicV9i1m9kAn9k1T25GFqbqS25uZ/zTdAbHK4Ig= +github.com/thanos-io/thanos v0.34.2-0.20240409164351-953ce26ad746/go.mod h1:Kjpf/IaJzIGNLxLhoavoS/S8TibhuvjAZjRT9IAXw2o= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/uber/jaeger-client-go v2.28.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= From 62965a377d110fb22d66e2877b54fc99b55625ac Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Tue, 9 Apr 2024 16:10:47 -0700 Subject: [PATCH 2/3] update vendor Signed-off-by: Ben Ye --- go.sum | 4 - .../thanos-io/promql-engine/engine/engine.go | 54 ++- .../thanos-io/promql-engine/engine/explain.go | 24 + .../thanos-io/promql-engine/engine/sort.go | 1 + .../promql-engine/execution/execution.go | 21 +- .../promql-engine/execution/model/operator.go | 40 +- .../execution/remote/operator.go | 15 +- .../promql-engine/execution/scan/functions.go | 19 +- .../promql-engine/execution/scan/subquery.go | 44 +- .../promql-engine/logicalplan/distribute.go | 47 +- .../logicalplan/distribute_avg.go | 9 +- .../storage/prometheus/matrix_selector.go | 7 +- .../storage/prometheus/scanners.go | 9 +- .../storage/prometheus/vector_selector.go | 4 + .../thanos/pkg/api/query/querypb/plan.go | 25 + .../thanos/pkg/api/query/querypb/query.pb.go | 437 ++++++++++++++++-- .../thanos/pkg/api/query/querypb/query.proto | 10 +- .../thanos-io/thanos/pkg/compact/compact.go | 13 +- .../thanos-io/thanos/pkg/extkingpin/flags.go | 2 +- .../thanos/pkg/query/remote_engine.go | 22 +- .../thanos-io/thanos/pkg/shipper/shipper.go | 4 +- .../thanos/pkg/targets/targetspb/rpc.pb.go | 101 ++-- .../thanos/pkg/targets/targetspb/rpc.proto | 1 + vendor/modules.txt | 4 +- 24 files changed, 716 insertions(+), 201 deletions(-) create mode 100644 vendor/github.com/thanos-io/thanos/pkg/api/query/querypb/plan.go diff --git a/go.sum b/go.sum index cd5d7b7a90..1432037b63 100644 --- a/go.sum +++ b/go.sum @@ -1400,12 +1400,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-20240309075357-e8336a5fd5f3 h1:Q0BjHI7FMe5KkKVXBFYto5VNASxiA/+AEhHup/IT7N0= github.com/thanos-io/objstore v0.0.0-20240309075357-e8336a5fd5f3/go.mod h1:ptMYNPgbyAR7a2Ab2t7zHA2/0be2ePyawVR7lp7fZtg= -github.com/thanos-io/promql-engine v0.0.0-20240327143517-c5e4b2e6ef02 h1:lSzA+ZGblFAh18uI3ziBmWCASxQR4CqwO3UEstv99Kg= -github.com/thanos-io/promql-engine v0.0.0-20240327143517-c5e4b2e6ef02/go.mod h1:FEPnabuTql1bDA4OUM41mwcZOJ20R436k8vq+xtGEG0= github.com/thanos-io/promql-engine v0.0.0-20240405095051-b7d0da367508 h1:4X0ThYb7/wTTKS73wT13ixw0lj5OJ87g45RWIZhPZDA= github.com/thanos-io/promql-engine v0.0.0-20240405095051-b7d0da367508/go.mod h1:FEPnabuTql1bDA4OUM41mwcZOJ20R436k8vq+xtGEG0= -github.com/thanos-io/thanos v0.34.2-0.20240328185924-943401f726ed h1:WAGbjaUpZUdem8OY3jF0ReTtCXKmQKu+g4sWNkBA2JQ= -github.com/thanos-io/thanos v0.34.2-0.20240328185924-943401f726ed/go.mod h1:CVOISIxBlYk+wIzYayY1wlwFrsSpQsqAnPFTn61jAWU= github.com/thanos-io/thanos v0.34.2-0.20240409164351-953ce26ad746 h1:xJCETicV9i1m9kAn9k1T25GFqbqS25uZ/zTdAbHK4Ig= github.com/thanos-io/thanos v0.34.2-0.20240409164351-953ce26ad746/go.mod h1:Kjpf/IaJzIGNLxLhoavoS/S8TibhuvjAZjRT9IAXw2o= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= diff --git a/vendor/github.com/thanos-io/promql-engine/engine/engine.go b/vendor/github.com/thanos-io/promql-engine/engine/engine.go index 823ee08749..36e5b8dda1 100644 --- a/vendor/github.com/thanos-io/promql-engine/engine/engine.go +++ b/vendor/github.com/thanos-io/promql-engine/engine/engine.go @@ -264,6 +264,44 @@ func (e *Engine) NewInstantQuery(ctx context.Context, q storage.Queryable, opts }, nil } +func (e *Engine) NewInstantQueryFromPlan(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, root logicalplan.Node, ts time.Time) (promql.Query, error) { + if opts == nil { + opts = promql.NewPrometheusQueryOpts(false, e.lookbackDelta) + } + if opts.LookbackDelta() <= 0 { + opts = promql.NewPrometheusQueryOpts(opts.EnablePerStepStats(), e.lookbackDelta) + } + + qOpts := e.makeQueryOpts(ctx, ts, ts, 0, opts) + if qOpts.StepsBatch > 64 { + return nil, ErrStepsBatchTooLarge + } + planOpts := logicalplan.PlanOptions{ + DisableDuplicateLabelCheck: e.disableDuplicateLabelChecks, + } + lplan, warns := logicalplan.New(root, qOpts, planOpts).Optimize(e.logicalOptimizers) + exec, err := execution.New(lplan.Root(), e.storageScanners(q), qOpts) + if e.triggerFallback(err) { + e.metrics.queries.WithLabelValues("true").Inc() + return e.prom.NewInstantQuery(ctx, q, opts, root.String(), ts) + } + e.metrics.queries.WithLabelValues("false").Inc() + if err != nil { + return nil, err + } + + return &compatibilityQuery{ + Query: &Query{exec: exec, opts: opts}, + engine: e, + plan: lplan, + ts: ts, + warns: warns, + t: InstantQuery, + // TODO(fpetkovski): Infer the sort order from the plan, ideally without copying the newResultSort function. + resultSort: noSortResultSort{}, + }, nil +} + func (e *Engine) NewRangeQuery(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, qs string, start, end time.Time, step time.Duration) (promql.Query, error) { expr, err := parser.NewParser(qs, parser.WithFunctions(e.functions)).ParseExpr() if err != nil { @@ -341,10 +379,6 @@ func (e *Engine) NewRangeQueryFromPlan(ctx context.Context, q storage.Queryable, }, nil } -func (e *Engine) NewInstantQueryFromPlan(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, plan logicalplan.Node, ts time.Time) (promql.Query, error) { - return e.NewRangeQueryFromPlan(ctx, q, opts, plan, ts, ts, 0) -} - func (e *Engine) makeQueryOpts(ctx context.Context, start time.Time, end time.Time, step time.Duration, opts promql.QueryOpts) *query.Options { qOpts := &query.Options{ Context: ctx, @@ -528,7 +562,7 @@ loop: } result = promql.Scalar{V: v, T: q.ts.UnixMilli()} default: - panic(errors.Newf("new.Engine.exec: unexpected expression type %q", q.plan.Root().Type())) + panic(errors.Newf("new.Engine.exec: unexpected expression type %q", q.plan.Root().ReturnType())) } ret.Value = result @@ -553,7 +587,15 @@ func (q *compatibilityQuery) Stats() *stats.Statistics { if q.opts != nil { enablePerStepStats = q.opts.EnablePerStepStats() } - return &stats.Statistics{Timers: stats.NewQueryTimers(), Samples: stats.NewQuerySamples(enablePerStepStats)} + + analysis := q.Analyze() + samples := stats.NewQuerySamples(enablePerStepStats) + if analysis != nil { + samples.PeakSamples = int(analysis.PeakSamples()) + samples.TotalSamples = analysis.TotalSamples() + } + + return &stats.Statistics{Timers: stats.NewQueryTimers(), Samples: samples} } func (q *compatibilityQuery) Close() { q.Cancel() } diff --git a/vendor/github.com/thanos-io/promql-engine/engine/explain.go b/vendor/github.com/thanos-io/promql-engine/engine/explain.go index 48f61208ce..a8a2b52731 100644 --- a/vendor/github.com/thanos-io/promql-engine/engine/explain.go +++ b/vendor/github.com/thanos-io/promql-engine/engine/explain.go @@ -4,6 +4,8 @@ package engine import ( + "math" + "github.com/prometheus/prometheus/promql" "github.com/thanos-io/promql-engine/execution/model" @@ -28,6 +30,28 @@ type ExplainOutputNode struct { var _ ExplainableQuery = &compatibilityQuery{} +func (a *AnalyzeOutputNode) TotalSamples() int64 { + var total int64 + for _, child := range a.Children { + total += child.TotalSamples() + } + if a.OperatorTelemetry.Samples() != nil { + total += a.OperatorTelemetry.Samples().TotalSamples + } + return total +} + +func (a *AnalyzeOutputNode) PeakSamples() int64 { + var peak int64 + for _, child := range a.Children { + peak = int64(math.Max(float64(peak), float64(child.PeakSamples()))) + } + if a.OperatorTelemetry.Samples() != nil { + peak = int64(math.Max(float64(peak), float64(a.OperatorTelemetry.Samples().PeakSamples))) + } + return peak +} + func analyzeQuery(obsv model.ObservableVectorOperator) *AnalyzeOutputNode { children := obsv.Explain() var childTelemetry []AnalyzeOutputNode diff --git a/vendor/github.com/thanos-io/promql-engine/engine/sort.go b/vendor/github.com/thanos-io/promql-engine/engine/sort.go index 130c7e9ce8..87cf2e072e 100644 --- a/vendor/github.com/thanos-io/promql-engine/engine/sort.go +++ b/vendor/github.com/thanos-io/promql-engine/engine/sort.go @@ -63,6 +63,7 @@ func newResultSort(expr parser.Expr) resultSorter { } return noSortResultSort{} } + func (s noSortResultSort) comparer(samples *promql.Vector) func(i, j int) bool { return func(i, j int) bool { return i < j } } diff --git a/vendor/github.com/thanos-io/promql-engine/execution/execution.go b/vendor/github.com/thanos-io/promql-engine/execution/execution.go index be201134bd..457c2b742e 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/execution.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/execution.go @@ -210,7 +210,26 @@ func newSubqueryFunction(e *logicalplan.FunctionCall, t *logicalplan.Subquery, s outerOpts.Start = time.UnixMilli(*t.Timestamp) outerOpts.End = time.UnixMilli(*t.Timestamp) } - return scan.NewSubqueryOperator(model.NewVectorPool(opts.StepsBatch), inner, &outerOpts, e, t) + + var scalarArg model.VectorOperator + switch e.Func.Name { + case "quantile_over_time": + // quantile_over_time(scalar, range-vector) + scalarArg, err = newOperator(e.Args[0], storage, opts, hints) + if err != nil { + return nil, err + } + case "predict_linear": + // predict_linear(range-vector, scalar) + scalarArg, err = newOperator(e.Args[1], storage, opts, hints) + if err != nil { + return nil, err + } + default: + scalarArg = noop.NewOperator() + } + + return scan.NewSubqueryOperator(model.NewVectorPool(opts.StepsBatch), inner, scalarArg, &outerOpts, e, t) } func newInstantVectorFunction(e *logicalplan.FunctionCall, storage storage.Scanners, opts *query.Options, hints promstorage.SelectHints) (model.VectorOperator, error) { diff --git a/vendor/github.com/thanos-io/promql-engine/execution/model/operator.go b/vendor/github.com/thanos-io/promql-engine/execution/model/operator.go index cadf876e3d..474151395a 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/model/operator.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/model/operator.go @@ -9,12 +9,16 @@ import ( "time" "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/util/stats" ) type OperatorTelemetry interface { + fmt.Stringer + AddExecutionTimeTaken(time.Duration) ExecutionTimeTaken() time.Duration - fmt.Stringer + IncrementSamplesAtStep(samples int, step int) + Samples() *stats.QuerySamples } func NewTelemetry(operator fmt.Stringer, enabled bool) OperatorTelemetry { @@ -39,18 +43,21 @@ func (tm *NoopTelemetry) ExecutionTimeTaken() time.Duration { return time.Duration(0) } +func (tm *NoopTelemetry) IncrementSamplesAtStep(_, _ int) {} + +func (tm *NoopTelemetry) Samples() *stats.QuerySamples { return nil } + type TrackedTelemetry struct { - name string - ExecutionTime time.Duration fmt.Stringer -} -func NewTrackedTelemetry(operator fmt.Stringer) *TrackedTelemetry { - return &TrackedTelemetry{Stringer: operator} + ExecutionTime time.Duration + LoadedSamples *stats.QuerySamples } -func (ti *TrackedTelemetry) Name() string { - return ti.name +func NewTrackedTelemetry(operator fmt.Stringer) *TrackedTelemetry { + return &TrackedTelemetry{ + Stringer: operator, + } } func (ti *TrackedTelemetry) AddExecutionTimeTaken(t time.Duration) { ti.ExecutionTime += t } @@ -59,6 +66,23 @@ func (ti *TrackedTelemetry) ExecutionTimeTaken() time.Duration { return ti.ExecutionTime } +func (ti *TrackedTelemetry) IncrementSamplesAtStep(samples, step int) { + ti.updatePeak(samples) + if ti.LoadedSamples == nil { + ti.LoadedSamples = stats.NewQuerySamples(false) + } + ti.LoadedSamples.IncrementSamplesAtStep(step, int64(samples)) +} + +func (ti *TrackedTelemetry) updatePeak(samples int) { + if ti.LoadedSamples == nil { + ti.LoadedSamples = stats.NewQuerySamples(false) + } + ti.LoadedSamples.UpdatePeak(samples) +} + +func (ti *TrackedTelemetry) Samples() *stats.QuerySamples { return ti.LoadedSamples } + type ObservableVectorOperator interface { VectorOperator OperatorTelemetry 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 0872e8bfcb..c158151778 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 @@ -28,7 +28,7 @@ type Execution struct { model.OperatorTelemetry } -func NewExecution(query promql.Query, pool *model.VectorPool, queryRangeStart time.Time, opts *query.Options, hints storage.SelectHints) *Execution { +func NewExecution(query promql.Query, pool *model.VectorPool, queryRangeStart time.Time, opts *query.Options, _ storage.SelectHints) *Execution { storage := newStorageFromQuery(query, opts) oper := &Execution{ storage: storage, @@ -45,7 +45,10 @@ func NewExecution(query promql.Query, pool *model.VectorPool, queryRangeStart ti func (e *Execution) Series(ctx context.Context) ([]labels.Labels, error) { start := time.Now() - defer func() { e.AddExecutionTimeTaken(time.Since(start)) }() + defer func() { + e.AddExecutionTimeTaken(time.Since(start)) + e.updateStats() + }() return e.vectorSelector.Series(ctx) } @@ -76,6 +79,14 @@ func (e *Execution) Explain() (next []model.VectorOperator) { return nil } +func (e *Execution) updateStats() { + existingStats := e.query.Stats() + if existingStats == nil || existingStats.Samples == nil { + return + } + e.IncrementSamplesAtStep(int(existingStats.Samples.TotalSamples), 0) +} + type storageAdapter struct { query promql.Query opts *query.Options diff --git a/vendor/github.com/thanos-io/promql-engine/execution/scan/functions.go b/vendor/github.com/thanos-io/promql-engine/execution/scan/functions.go index 110cd082f7..939ba9d884 100644 --- a/vendor/github.com/thanos-io/promql-engine/execution/scan/functions.go +++ b/vendor/github.com/thanos-io/promql-engine/execution/scan/functions.go @@ -25,9 +25,12 @@ type FunctionArgs struct { Samples []ringbuffer.Sample[Value] StepTime int64 SelectRange int64 - ScalarPoints []float64 Offset int64 MetricAppearedTs *int64 + + // Only holt-winters uses two arguments, we fall back for that. + // quantile_over_time and predict_linear use one, so we only use one here. + ScalarPoint float64 } type FunctionCall func(f FunctionArgs) (float64, *histogram.FloatHistogram, bool) @@ -124,7 +127,7 @@ var rangeVectorFuncs = map[string]FunctionCall{ for i, sample := range f.Samples { floats[i] = sample.V.F } - return aggregate.Quantile(f.ScalarPoints[0], floats), nil, true + return aggregate.Quantile(f.ScalarPoint, floats), nil, true }, "changes": func(f FunctionArgs) (float64, *histogram.FloatHistogram, bool) { if len(f.Samples) == 0 { @@ -217,6 +220,13 @@ var rangeVectorFuncs = map[string]FunctionCall{ v, h := extendedRate(f.Samples, true, false, f.StepTime, f.SelectRange, f.Offset, *f.MetricAppearedTs) return v, h, true }, + "predict_linear": func(f FunctionArgs) (float64, *histogram.FloatHistogram, bool) { + if len(f.Samples) < 2 { + return 0., nil, false + } + v := predictLinear(f.Samples, f.ScalarPoint, f.StepTime) + return v, nil, true + }, } func NewRangeVectorFunc(name string) (FunctionCall, error) { @@ -561,6 +571,11 @@ func deriv(points []ringbuffer.Sample[Value]) float64 { return slope } +func predictLinear(points []ringbuffer.Sample[Value], duration float64, stepTime int64) float64 { + slope, intercept := linearRegression(points, stepTime) + return slope*duration + intercept +} + func resets(points []ringbuffer.Sample[Value]) float64 { count := 0 prev := points[0].V.F 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 26a2dfb933..9ffe73a022 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 @@ -6,14 +6,13 @@ package scan import ( "context" "fmt" + "math" "sync" "time" - "github.com/efficientgo/core/errors" "github.com/prometheus/prometheus/model/labels" "github.com/thanos-io/promql-engine/execution/model" - "github.com/thanos-io/promql-engine/execution/parse" "github.com/thanos-io/promql-engine/extlabels" "github.com/thanos-io/promql-engine/logicalplan" "github.com/thanos-io/promql-engine/query" @@ -23,7 +22,9 @@ import ( type subqueryOperator struct { model.OperatorTelemetry - next model.VectorOperator + next model.VectorOperator + nextScalar model.VectorOperator + pool *model.VectorPool call FunctionCall mint int64 @@ -32,9 +33,8 @@ type subqueryOperator struct { step int64 stepsBatch int - scalarArgs []float64 - funcExpr *logicalplan.FunctionCall - subQuery *logicalplan.Subquery + funcExpr *logicalplan.FunctionCall + subQuery *logicalplan.Subquery onceSeries sync.Once series []labels.Labels @@ -44,7 +44,7 @@ type subqueryOperator struct { buffers []*ringbuffer.RingBuffer[Value] } -func NewSubqueryOperator(pool *model.VectorPool, next model.VectorOperator, opts *query.Options, funcExpr *logicalplan.FunctionCall, subQuery *logicalplan.Subquery) (model.VectorOperator, error) { +func NewSubqueryOperator(pool *model.VectorPool, next, nextScalar model.VectorOperator, opts *query.Options, funcExpr *logicalplan.FunctionCall, subQuery *logicalplan.Subquery) (model.VectorOperator, error) { call, err := NewRangeVectorFunc(funcExpr.Func.Name) if err != nil { return nil, err @@ -54,20 +54,11 @@ func NewSubqueryOperator(pool *model.VectorPool, next model.VectorOperator, opts step = 1 } - arg := 0.0 - if funcExpr.Func.Name == "quantile_over_time" { - unwrap, err := logicalplan.UnwrapFloat(funcExpr.Args[0]) - if err != nil { - return nil, errors.Wrapf(parse.ErrNotSupportedExpr, "quantile_over_time with expression as first argument is not supported") - } - arg = unwrap - } - oper := &subqueryOperator{ next: next, + nextScalar: nextScalar, call: call, pool: pool, - scalarArgs: []float64{arg}, funcExpr: funcExpr, subQuery: subQuery, mint: opts.Start.UnixMilli(), @@ -108,6 +99,11 @@ func (o *subqueryOperator) Next(ctx context.Context) ([]model.StepVector, error) return nil, err } + scalarArgs, err := o.nextScalar.Next(ctx) + if err != nil { + return nil, err + } + res := o.pool.GetVectorBatch() for i := 0; o.currentStep <= o.maxt && i < o.stepsBatch; i++ { mint := o.currentStep - o.subQuery.Range.Milliseconds() - o.subQuery.OriginalOffset.Milliseconds() @@ -150,13 +146,19 @@ func (o *subqueryOperator) Next(ctx context.Context) ([]model.StepVector, error) o.next.GetPool().PutVectors(vectors) } + scalarArg := math.NaN() + if len(scalarArgs) > 0 { + scalarArg = scalarArgs[i].Samples[0] + } + sv := o.pool.GetStepVector(o.currentStep) for sampleId, rangeSamples := range o.buffers { f, h, ok := o.call(FunctionArgs{ - ScalarPoints: o.scalarArgs, - Samples: rangeSamples.Samples(), - StepTime: maxt, - SelectRange: o.subQuery.Range.Milliseconds(), + ScalarPoint: scalarArg, + Samples: rangeSamples.Samples(), + StepTime: maxt + o.subQuery.Offset.Milliseconds(), + SelectRange: o.subQuery.Range.Milliseconds(), + Offset: o.subQuery.Offset.Milliseconds(), }) if ok { if h != nil { diff --git a/vendor/github.com/thanos-io/promql-engine/logicalplan/distribute.go b/vendor/github.com/thanos-io/promql-engine/logicalplan/distribute.go index ce81275448..a1e420f488 100644 --- a/vendor/github.com/thanos-io/promql-engine/logicalplan/distribute.go +++ b/vendor/github.com/thanos-io/promql-engine/logicalplan/distribute.go @@ -21,7 +21,7 @@ import ( ) var ( - RewrittenExternalLabelWarning = errors.Newf("%s: rewriting an external label with label_replace could lead to unpredictable results", annotations.PromQLWarning.Error()) + RewrittenExternalLabelWarning = errors.Newf("%s: rewriting an external label with label_replace can disable distributed query execution", annotations.PromQLWarning.Error()) ) type timeRange struct { @@ -83,8 +83,6 @@ type RemoteExecution struct { Engine api.RemoteEngine Query Node QueryRangeStart time.Time - - valueType parser.ValueType } func (r RemoteExecution) Clone() Node { @@ -102,7 +100,7 @@ func (r RemoteExecution) String() string { func (r RemoteExecution) Type() NodeType { return RemoteExecutionNode } -func (r RemoteExecution) ReturnType() parser.ValueType { return r.valueType } +func (r RemoteExecution) ReturnType() parser.ValueType { return r.Query.ReturnType() } // Deduplicate is a logical plan which deduplicates samples from multiple RemoteExecutions. type Deduplicate struct { @@ -179,9 +177,6 @@ func (m DistributedExecutionOptimizer) Optimize(plan Node, opts *query.Options) } } minEngineOverlap := labelRanges.minOverlap() - if rewritesEngineLabels(plan, engineLabels) { - return plan, annotations.New().Add(RewrittenExternalLabelWarning) - } // TODO(fpetkovski): Consider changing TraverseBottomUp to pass in a list of parents in the transform function. parents := make(map[*Node]*Node) @@ -189,9 +184,11 @@ func (m DistributedExecutionOptimizer) Optimize(plan Node, opts *query.Options) parents[current] = parent return false }) + + var warns = annotations.New() TraverseBottomUp(nil, &plan, func(parent, current *Node) (stop bool) { // If the current operation is not distributive, stop the traversal. - if !isDistributive(current, m.SkipBinaryPushdown) { + if !isDistributive(current, m.SkipBinaryPushdown, engineLabels, warns) { return true } @@ -220,7 +217,7 @@ func (m DistributedExecutionOptimizer) Optimize(plan Node, opts *query.Options) } // If the parent operation is distributive, continue the traversal. - if isDistributive(parent, m.SkipBinaryPushdown) { + if isDistributive(parent, m.SkipBinaryPushdown, engineLabels, warns) { return false } @@ -228,7 +225,7 @@ func (m DistributedExecutionOptimizer) Optimize(plan Node, opts *query.Options) return true }) - return plan, nil + return plan, *warns } func (m DistributedExecutionOptimizer) subqueryOpts(parents map[*Node]*Node, current *Node, opts *query.Options) *query.Options { @@ -318,7 +315,6 @@ func (m DistributedExecutionOptimizer) distributeQuery(expr *Node, engines []api Engine: e, Query: (*expr).Clone(), QueryRangeStart: start, - valueType: (*expr).ReturnType(), }) } @@ -344,7 +340,6 @@ func (m DistributedExecutionOptimizer) distributeAbsent(expr Node, engines []api Engine: engines[i], Query: expr.Clone(), QueryRangeStart: opts.Start, - valueType: expr.ReturnType(), }) } // We need to make sure that absent is at least evaluated against one engine. @@ -356,7 +351,6 @@ func (m DistributedExecutionOptimizer) distributeAbsent(expr Node, engines []api Engine: engines[len(engines)-1], Query: expr, QueryRangeStart: opts.Start, - valueType: expr.ReturnType(), } } @@ -460,7 +454,7 @@ func numSteps(start, end time.Time, step time.Duration) int64 { return (end.UnixMilli()-start.UnixMilli())/step.Milliseconds() + 1 } -func isDistributive(expr *Node, skipBinaryPushdown bool) bool { +func isDistributive(expr *Node, skipBinaryPushdown bool, engineLabels map[string]struct{}, warns *annotations.Annotations) bool { if expr == nil { return false } @@ -475,6 +469,14 @@ func isDistributive(expr *Node, skipBinaryPushdown bool) bool { if _, ok := distributiveAggregations[e.Op]; !ok { return false } + case *FunctionCall: + if e.Func.Name == "label_replace" { + targetLabel := UnsafeUnwrapString(e.Args[1]) + if _, ok := engineLabels[targetLabel]; ok { + warns.Add(RewrittenExternalLabelWarning) + return false + } + } } return true @@ -537,23 +539,6 @@ func matchesExternalLabels(ms []*labels.Matcher, externalLabels labels.Labels) b return true } -func rewritesEngineLabels(e Node, engineLabels map[string]struct{}) bool { - var result bool - TraverseBottomUp(nil, &e, func(parent *Node, node *Node) bool { - call, ok := (*node).(*FunctionCall) - if !ok || call.Func.Name != "label_replace" { - return false - } - targetLabel := UnsafeUnwrapString(call.Args[1]) - if _, ok := engineLabels[targetLabel]; ok { - result = true - return true - } - return false - }) - return result -} - func maxTime(a, b time.Time) time.Time { if a.After(b) { return a diff --git a/vendor/github.com/thanos-io/promql-engine/logicalplan/distribute_avg.go b/vendor/github.com/thanos-io/promql-engine/logicalplan/distribute_avg.go index 4c9f7c6afc..08359ae595 100644 --- a/vendor/github.com/thanos-io/promql-engine/logicalplan/distribute_avg.go +++ b/vendor/github.com/thanos-io/promql-engine/logicalplan/distribute_avg.go @@ -17,8 +17,9 @@ type DistributeAvgOptimizer struct { } func (r DistributeAvgOptimizer) Optimize(plan Node, _ *query.Options) (Node, annotations.Annotations) { + var warns = annotations.New() TraverseBottomUp(nil, &plan, func(parent, current *Node) (stop bool) { - if !isDistributiveOrAverage(current, r.SkipBinaryPushdown) { + if !isDistributiveOrAverage(current, r.SkipBinaryPushdown, warns) { return true } // If the current node is avg(), distribute the operation and @@ -44,12 +45,12 @@ func (r DistributeAvgOptimizer) Optimize(plan Node, _ *query.Options) (Node, ann } return true } - return !isDistributiveOrAverage(parent, r.SkipBinaryPushdown) + return !isDistributiveOrAverage(parent, r.SkipBinaryPushdown, warns) }) return plan, nil } -func isDistributiveOrAverage(expr *Node, skipBinaryPushdown bool) bool { +func isDistributiveOrAverage(expr *Node, skipBinaryPushdown bool, warns *annotations.Annotations) bool { if expr == nil { return false } @@ -57,5 +58,5 @@ func isDistributiveOrAverage(expr *Node, skipBinaryPushdown bool) bool { if aggr, ok := (*expr).(*Aggregation); ok { isAvg = aggr.Op == parser.AVG } - return isDistributive(expr, skipBinaryPushdown) || isAvg + return isDistributive(expr, skipBinaryPushdown, map[string]struct{}{}, warns) || isAvg } 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 c29c50b910..243e3d4570 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 @@ -40,7 +40,7 @@ type matrixSelector struct { vectorPool *model.VectorPool functionName string storage SeriesSelector - scalarArgs []float64 + scalarArg float64 call scan.FunctionCall scanners []matrixScanner bufferTail []ringbuffer.Sample[scan.Value] @@ -89,7 +89,7 @@ func NewMatrixSelector( call: call, functionName: functionName, vectorPool: pool, - scalarArgs: []float64{arg}, + scalarArg: arg, bufferTail: make([]ringbuffer.Sample[scan.Value], 16), numSteps: opts.NumSteps(), @@ -194,7 +194,7 @@ func (o *matrixSelector) Next(ctx context.Context) ([]model.StepVector, error) { StepTime: seriesTs, SelectRange: o.selectRange, Offset: o.offset, - ScalarPoints: o.scalarArgs, + ScalarPoint: o.scalarArg, MetricAppearedTs: series.metricAppearedTs, }) @@ -206,6 +206,7 @@ func (o *matrixSelector) Next(ctx context.Context) ([]model.StepVector, error) { vectors[currStep].AppendSample(o.vectorPool, series.signature, f) } } + o.IncrementSamplesAtStep(len(series.buffer.Samples()), currStep) seriesTs += o.step } } diff --git a/vendor/github.com/thanos-io/promql-engine/storage/prometheus/scanners.go b/vendor/github.com/thanos-io/promql-engine/storage/prometheus/scanners.go index 4b51f92bad..3a43a10266 100644 --- a/vendor/github.com/thanos-io/promql-engine/storage/prometheus/scanners.go +++ b/vendor/github.com/thanos-io/promql-engine/storage/prometheus/scanners.go @@ -66,12 +66,19 @@ func (p prometheusScanners) NewMatrixSelector( } arg := 0.0 - if call.Func.Name == "quantile_over_time" { + switch call.Func.Name { + case "quantile_over_time": unwrap, err := logicalplan.UnwrapFloat(call.Args[0]) if err != nil { return nil, errors.Wrapf(parse.ErrNotSupportedExpr, "quantile_over_time with expression as first argument is not supported") } arg = unwrap + case "predict_linear": + unwrap, err := logicalplan.UnwrapFloat(call.Args[1]) + if err != nil { + return nil, errors.Wrapf(parse.ErrNotSupportedExpr, "predict_linear with expression as second argument is not supported") + } + arg = unwrap } vs := logicalNode.VectorSelector 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 898276dc36..c7f85e63aa 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 @@ -139,6 +139,7 @@ func (o *vectorSelector) Next(ctx context.Context) ([]model.StepVector, error) { ts += o.step } + var currStepSamples uint64 // Reset the current timestamp. ts = o.currentStep fromSeries := o.currentSeries @@ -148,6 +149,7 @@ func (o *vectorSelector) Next(ctx context.Context) ([]model.StepVector, error) { seriesTs = ts ) for currStep := 0; currStep < o.numSteps && seriesTs <= o.maxt; currStep++ { + currStepSamples = 0 t, v, h, ok, err := selectPoint(series.samples, seriesTs, o.lookbackDelta, o.offset) if err != nil { return nil, err @@ -161,8 +163,10 @@ func (o *vectorSelector) Next(ctx context.Context) ([]model.StepVector, error) { } else { vectors[currStep].AppendSample(o.vectorPool, series.signature, v) } + currStepSamples++ } seriesTs += o.step + o.IncrementSamplesAtStep(int(currStepSamples), currStep) } } if o.currentSeries == int64(len(o.scanners)) { diff --git a/vendor/github.com/thanos-io/thanos/pkg/api/query/querypb/plan.go b/vendor/github.com/thanos-io/thanos/pkg/api/query/querypb/plan.go new file mode 100644 index 0000000000..8f025ce4b7 --- /dev/null +++ b/vendor/github.com/thanos-io/thanos/pkg/api/query/querypb/plan.go @@ -0,0 +1,25 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +package querypb + +import ( + "github.com/pkg/errors" + "github.com/thanos-io/promql-engine/api" + "github.com/thanos-io/promql-engine/logicalplan" +) + +func NewJSONEncodedPlan(plan api.RemoteQuery) (*QueryPlan, error) { + node, ok := plan.(logicalplan.Node) + if !ok { + return nil, errors.New("plan is not a logicalplan.Node") + } + bytes, err := logicalplan.Marshal(node) + if err != nil { + return nil, err + } + + return &QueryPlan{ + Encoding: &QueryPlan_Json{Json: bytes}, + }, nil +} diff --git a/vendor/github.com/thanos-io/thanos/pkg/api/query/querypb/query.pb.go b/vendor/github.com/thanos-io/thanos/pkg/api/query/querypb/query.pb.go index b055b923bd..ca70d93e5e 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/api/query/querypb/query.pb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/api/query/querypb/query.pb.go @@ -60,6 +60,7 @@ func (EngineType) EnumDescriptor() ([]byte, []int) { type QueryRequest struct { Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + QueryPlan *QueryPlan `protobuf:"bytes,14,opt,name=queryPlan,proto3" json:"queryPlan,omitempty"` TimeSeconds int64 `protobuf:"varint,2,opt,name=time_seconds,json=timeSeconds,proto3" json:"time_seconds,omitempty"` TimeoutSeconds int64 `protobuf:"varint,3,opt,name=timeout_seconds,json=timeoutSeconds,proto3" json:"timeout_seconds,omitempty"` MaxResolutionSeconds int64 `protobuf:"varint,4,opt,name=max_resolution_seconds,json=maxResolutionSeconds,proto3" json:"max_resolution_seconds,omitempty"` @@ -228,8 +229,81 @@ func (*QueryResponse) XXX_OneofWrappers() []interface{} { } } +type QueryPlan struct { + // Types that are valid to be assigned to Encoding: + // *QueryPlan_Json + Encoding isQueryPlan_Encoding `protobuf_oneof:"encoding"` +} + +func (m *QueryPlan) Reset() { *m = QueryPlan{} } +func (m *QueryPlan) String() string { return proto.CompactTextString(m) } +func (*QueryPlan) ProtoMessage() {} +func (*QueryPlan) Descriptor() ([]byte, []int) { + return fileDescriptor_4b2aba43925d729f, []int{3} +} +func (m *QueryPlan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPlan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPlan.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 *QueryPlan) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPlan.Merge(m, src) +} +func (m *QueryPlan) XXX_Size() int { + return m.Size() +} +func (m *QueryPlan) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPlan.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPlan proto.InternalMessageInfo + +type isQueryPlan_Encoding interface { + isQueryPlan_Encoding() + MarshalTo([]byte) (int, error) + Size() int +} + +type QueryPlan_Json struct { + Json []byte `protobuf:"bytes,1,opt,name=json,proto3,oneof" json:"json,omitempty"` +} + +func (*QueryPlan_Json) isQueryPlan_Encoding() {} + +func (m *QueryPlan) GetEncoding() isQueryPlan_Encoding { + if m != nil { + return m.Encoding + } + return nil +} + +func (m *QueryPlan) GetJson() []byte { + if x, ok := m.GetEncoding().(*QueryPlan_Json); ok { + return x.Json + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*QueryPlan) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*QueryPlan_Json)(nil), + } +} + type QueryRangeRequest struct { Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + QueryPlan *QueryPlan `protobuf:"bytes,16,opt,name=queryPlan,proto3" json:"queryPlan,omitempty"` StartTimeSeconds int64 `protobuf:"varint,2,opt,name=start_time_seconds,json=startTimeSeconds,proto3" json:"start_time_seconds,omitempty"` EndTimeSeconds int64 `protobuf:"varint,3,opt,name=end_time_seconds,json=endTimeSeconds,proto3" json:"end_time_seconds,omitempty"` IntervalSeconds int64 `protobuf:"varint,4,opt,name=interval_seconds,json=intervalSeconds,proto3" json:"interval_seconds,omitempty"` @@ -249,7 +323,7 @@ func (m *QueryRangeRequest) Reset() { *m = QueryRangeRequest{} } func (m *QueryRangeRequest) String() string { return proto.CompactTextString(m) } func (*QueryRangeRequest) ProtoMessage() {} func (*QueryRangeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4b2aba43925d729f, []int{3} + return fileDescriptor_4b2aba43925d729f, []int{4} } func (m *QueryRangeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -289,7 +363,7 @@ func (m *QueryRangeResponse) Reset() { *m = QueryRangeResponse{} } func (m *QueryRangeResponse) String() string { return proto.CompactTextString(m) } func (*QueryRangeResponse) ProtoMessage() {} func (*QueryRangeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4b2aba43925d729f, []int{4} + return fileDescriptor_4b2aba43925d729f, []int{5} } func (m *QueryRangeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -368,6 +442,7 @@ func init() { proto.RegisterType((*QueryRequest)(nil), "thanos.QueryRequest") proto.RegisterType((*StoreMatchers)(nil), "thanos.StoreMatchers") proto.RegisterType((*QueryResponse)(nil), "thanos.QueryResponse") + proto.RegisterType((*QueryPlan)(nil), "thanos.queryPlan") proto.RegisterType((*QueryRangeRequest)(nil), "thanos.QueryRangeRequest") proto.RegisterType((*QueryRangeResponse)(nil), "thanos.QueryRangeResponse") } @@ -375,53 +450,56 @@ func init() { func init() { proto.RegisterFile("api/query/querypb/query.proto", fileDescriptor_4b2aba43925d729f) } var fileDescriptor_4b2aba43925d729f = []byte{ - // 734 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcf, 0x6f, 0xfb, 0x34, - 0x1c, 0x4d, 0xd6, 0xdf, 0x9f, 0xb4, 0x5d, 0x66, 0x75, 0x90, 0x15, 0x08, 0xa1, 0xd2, 0x44, 0x98, - 0x50, 0x3b, 0x95, 0xc1, 0x0d, 0x09, 0xc6, 0x26, 0x0d, 0x34, 0x24, 0x96, 0xed, 0xc4, 0xa5, 0x72, - 0x5b, 0xaf, 0x8d, 0x9a, 0xda, 0x59, 0xec, 0x8c, 0x55, 0xdc, 0xe1, 0xca, 0xdf, 0xc0, 0x5f, 0xb3, - 0xe3, 0x8e, 0x9c, 0x10, 0x6c, 0xff, 0x08, 0x8a, 0xf3, 0x63, 0xc9, 0x34, 0x8d, 0x4e, 0x93, 0xbe, - 0x97, 0x34, 0x7e, 0xef, 0xd9, 0xb1, 0x5f, 0xdf, 0x93, 0xe1, 0x23, 0xec, 0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ec, 0x12, 0x77, 0x3e, 0x84, 0xfa, 0x2f, 0x38, - 0xa0, 0x2e, 0x9d, 0xf1, 0x38, 0x7a, 0x27, 0x8a, 0x93, 0x21, 0xe8, 0x6b, 0x80, 0x28, 0x45, 0x9c, - 0x04, 0x2e, 0x89, 0xd3, 0xa7, 0x0d, 0x3f, 0x88, 0x22, 0xbc, 0x24, 0x62, 0x4e, 0x42, 0x3e, 0x9a, - 0x30, 0x7f, 0xd5, 0xbf, 0x90, 0x71, 0x8c, 0x24, 0x27, 0x8a, 0x93, 0x9b, 0x70, 0x58, 0x87, 0x6a, - 0x40, 0x78, 0xe8, 0x89, 0xde, 0xef, 0x15, 0xd8, 0x8a, 0x3f, 0x8c, 0xe9, 0x8c, 0xbc, 0x1c, 0xfa, - 0xcf, 0x01, 0x71, 0x81, 0x03, 0x31, 0x7a, 0x26, 0xfa, 0xba, 0x64, 0x2e, 0x72, 0xf9, 0xb7, 0x41, - 0x27, 0x74, 0x5a, 0xd4, 0x26, 0x05, 0x20, 0x74, 0x9a, 0x57, 0x7e, 0x06, 0xba, 0x4b, 0x05, 0x09, - 0xae, 0xb1, 0xf7, 0x24, 0xfa, 0x9b, 0x29, 0xfe, 0x42, 0xa9, 0x2a, 0xaf, 0x2c, 0x55, 0xf5, 0x55, - 0xa5, 0xaa, 0xad, 0x55, 0xaa, 0xfa, 0x5b, 0x4b, 0xd5, 0x78, 0x45, 0xa9, 0x60, 0xfd, 0x52, 0x35, - 0xff, 0xa7, 0x54, 0xad, 0x37, 0x95, 0xaa, 0xbd, 0x56, 0xa9, 0x36, 0xd7, 0x28, 0x95, 0xa6, 0x37, - 0x7b, 0xbf, 0x02, 0xca, 0x07, 0xf1, 0x9d, 0xd6, 0x60, 0xef, 0x4b, 0x80, 0xc7, 0x8d, 0x21, 0x0d, - 0x6a, 0x53, 0x72, 0x89, 0x43, 0x4f, 0xe8, 0x0a, 0x6a, 0x03, 0x3c, 0x2e, 0xa8, 0xab, 0x08, 0x20, - 0xb9, 0x97, 0xf4, 0x8d, 0xe1, 0x6f, 0x2a, 0x54, 0xe4, 0xa6, 0xd1, 0x57, 0xe9, 0x4b, 0xd6, 0xf9, - 0xfc, 0x2d, 0xd2, 0xdd, 0x7e, 0x82, 0xc6, 0xa7, 0xdb, 0x57, 0xd1, 0x31, 0xc0, 0xe3, 0xa9, 0xd1, - 0x4e, 0x51, 0x96, 0xab, 0x64, 0xb7, 0xfb, 0x1c, 0x95, 0x2e, 0x73, 0xb8, 0x7b, 0xfb, 0xaf, 0xa9, - 0xdc, 0xde, 0x9b, 0xea, 0xdd, 0xbd, 0xa9, 0xfe, 0x73, 0x6f, 0xaa, 0x7f, 0x3c, 0x98, 0xca, 0xdd, - 0x83, 0xa9, 0xfc, 0xf5, 0x60, 0x2a, 0x3f, 0xd7, 0x92, 0xdb, 0x75, 0x5c, 0x95, 0x97, 0xdc, 0x17, - 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xd2, 0xa3, 0xe4, 0xc6, 0x79, 0x07, 0x00, 0x00, + // 784 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x4f, 0x6f, 0xe3, 0x44, + 0x1c, 0xb5, 0x37, 0xff, 0x7f, 0x4e, 0x52, 0xef, 0x28, 0x05, 0x6f, 0x00, 0x63, 0x22, 0xad, 0x30, + 0x2b, 0x48, 0x56, 0x61, 0xe1, 0x86, 0x04, 0x61, 0x57, 0x2a, 0x68, 0x91, 0xb6, 0x6e, 0x4f, 0x5c, + 0xa2, 0x49, 0x3c, 0x4d, 0x4c, 0x9c, 0x19, 0xd7, 0x33, 0x2e, 0x8d, 0xb8, 0x73, 0xe6, 0xe3, 0xf0, + 0x11, 0x7a, 0xac, 0xc4, 0x85, 0x13, 0x82, 0xf6, 0x8b, 0x20, 0x8f, 0xff, 0xc4, 0xae, 0x2a, 0x48, + 0x54, 0x69, 0x2f, 0xce, 0xcc,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0x43, 0x5f, 0x43, 0x47, 0x7e, 0x84, 0xdc, 0x65, 0x55, 0xba, 0xdc, 0xcb, + 0x76, 0x7a, 0x5d, 0x20, 0x33, 0x93, 0x4b, 0x0b, 0x06, 0x17, 0xd0, 0x49, 0xfb, 0x34, 0x75, 0xe7, + 0x7d, 0x68, 0xfe, 0x8c, 0x43, 0xea, 0xd1, 0x05, 0x4f, 0x7a, 0xf5, 0x48, 0x71, 0x72, 0x04, 0x7d, + 0x05, 0x10, 0x77, 0x11, 0x27, 0xa1, 0x47, 0x92, 0xee, 0xd3, 0xc6, 0xef, 0xc5, 0x3d, 0xbf, 0x26, + 0x62, 0x49, 0x22, 0x3e, 0x9d, 0xb3, 0x60, 0x33, 0x3c, 0x95, 0xed, 0x18, 0x4b, 0x8e, 0x14, 0xa7, + 0xb0, 0x60, 0xd2, 0x84, 0x7a, 0x48, 0x78, 0xe4, 0x8b, 0xc1, 0x67, 0x85, 0xce, 0x47, 0x3d, 0xa8, + 0xfe, 0xc4, 0x19, 0x95, 0xef, 0x6b, 0x1f, 0x29, 0x8e, 0x9c, 0x4d, 0x00, 0x9a, 0x84, 0xce, 0x99, + 0xeb, 0xd1, 0xc5, 0xe0, 0xf7, 0x1a, 0x3c, 0x4e, 0xea, 0xc4, 0x74, 0x41, 0xf6, 0x08, 0x95, 0xbe, + 0x43, 0xa8, 0x3e, 0x05, 0xc4, 0x05, 0x0e, 0xc5, 0xf4, 0x9e, 0x68, 0xe9, 0x92, 0x39, 0x2d, 0xe4, + 0xcb, 0x06, 0x9d, 0x50, 0xb7, 0xac, 0x4d, 0x03, 0x46, 0xa8, 0x5b, 0x54, 0x7e, 0x02, 0xba, 0x47, + 0x05, 0x09, 0x2f, 0xb0, 0x7f, 0x27, 0x5a, 0x07, 0x19, 0xfe, 0x1f, 0xa1, 0xad, 0xed, 0x19, 0xda, + 0xfa, 0x5e, 0xa1, 0x6d, 0xec, 0x14, 0xda, 0xe6, 0x43, 0x43, 0xdb, 0xda, 0x23, 0xb4, 0xb0, 0x7b, + 0x68, 0xdb, 0xff, 0x13, 0xda, 0xce, 0x83, 0x42, 0xdb, 0xdd, 0x29, 0xb4, 0x07, 0x3b, 0x84, 0x56, + 0xd3, 0xdb, 0x83, 0x5f, 0x00, 0x15, 0x3b, 0xf7, 0xad, 0xc6, 0xec, 0xd9, 0x17, 0x00, 0xdb, 0xc2, + 0x90, 0x06, 0x0d, 0x97, 0x9c, 0xe1, 0xc8, 0x17, 0xba, 0x82, 0xba, 0x00, 0xdb, 0x0d, 0x75, 0x15, + 0x01, 0xa4, 0x17, 0xa5, 0xfe, 0x68, 0xfc, 0xab, 0x0a, 0x35, 0x59, 0x34, 0xfa, 0x32, 0x1b, 0xe4, + 0xff, 0x29, 0xc5, 0x6b, 0xad, 0x7f, 0x78, 0x07, 0x4d, 0x4e, 0xf7, 0x5c, 0x45, 0xaf, 0x00, 0xb6, + 0xa7, 0x46, 0x4f, 0xca, 0xb2, 0x42, 0x86, 0xfb, 0xfd, 0xfb, 0xa8, 0x6c, 0x9b, 0xc9, 0xd3, 0xab, + 0x7f, 0x4c, 0xe5, 0xea, 0xc6, 0x54, 0xaf, 0x6f, 0x4c, 0xf5, 0xef, 0x1b, 0x53, 0xfd, 0xed, 0xd6, + 0x54, 0xae, 0x6f, 0x4d, 0xe5, 0xcf, 0x5b, 0x53, 0xf9, 0xb1, 0x91, 0x5e, 0xf7, 0xb3, 0xba, 0xbc, + 0x75, 0x3f, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x9d, 0x9d, 0xab, 0x0a, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -614,6 +692,18 @@ func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.QueryPlan != nil { + { + size, err := m.QueryPlan.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } if m.Engine != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.Engine)) i-- @@ -818,6 +908,54 @@ func (m *QueryResponse_Timeseries) MarshalToSizedBuffer(dAtA []byte) (int, error } return len(dAtA) - i, nil } +func (m *QueryPlan) 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 *QueryPlan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPlan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Encoding != nil { + { + size := m.Encoding.Size() + i -= size + if _, err := m.Encoding.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *QueryPlan_Json) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPlan_Json) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Json != nil { + i -= len(m.Json) + copy(dAtA[i:], m.Json) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Json))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} func (m *QueryRangeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -838,6 +976,20 @@ func (m *QueryRangeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.QueryPlan != nil { + { + size, err := m.QueryPlan.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } if m.Engine != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.Engine)) i-- @@ -1076,6 +1228,10 @@ func (m *QueryRequest) Size() (n int) { if m.Engine != 0 { n += 1 + sovQuery(uint64(m.Engine)) } + if m.QueryPlan != nil { + l = m.QueryPlan.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -1128,6 +1284,30 @@ func (m *QueryResponse_Timeseries) Size() (n int) { } return n } +func (m *QueryPlan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Encoding != nil { + n += m.Encoding.Size() + } + return n +} + +func (m *QueryPlan_Json) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Json != nil { + l = len(m.Json) + n += 1 + l + sovQuery(uint64(l)) + } + return n +} func (m *QueryRangeRequest) Size() (n int) { if m == nil { return 0 @@ -1184,6 +1364,10 @@ func (m *QueryRangeRequest) Size() (n int) { if m.Engine != 0 { n += 1 + sovQuery(uint64(m.Engine)) } + if m.QueryPlan != nil { + l = m.QueryPlan.Size() + n += 2 + l + sovQuery(uint64(l)) + } return n } @@ -1546,6 +1730,42 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error { break } } + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryPlan", 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.QueryPlan == nil { + m.QueryPlan = &QueryPlan{} + } + if err := m.QueryPlan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1768,6 +1988,89 @@ func (m *QueryResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryPlan) 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: queryPlan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: queryPlan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Json", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := make([]byte, postIndex-iNdEx) + copy(v, dAtA[iNdEx:postIndex]) + m.Encoding = &QueryPlan_Json{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryRangeRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2124,6 +2427,42 @@ func (m *QueryRangeRequest) Unmarshal(dAtA []byte) error { break } } + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryPlan", 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.QueryPlan == nil { + m.QueryPlan = &QueryPlan{} + } + if err := m.QueryPlan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/vendor/github.com/thanos-io/thanos/pkg/api/query/querypb/query.proto b/vendor/github.com/thanos-io/thanos/pkg/api/query/querypb/query.proto index ffffb6c53a..d6b5e4628f 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/api/query/querypb/query.proto +++ b/vendor/github.com/thanos-io/thanos/pkg/api/query/querypb/query.proto @@ -30,11 +30,12 @@ enum EngineType { message QueryRequest { string query = 1; + queryPlan queryPlan = 14; int64 time_seconds = 2; int64 timeout_seconds = 3; int64 max_resolution_seconds = 4; - + repeated string replica_labels = 5; repeated StoreMatchers storeMatchers = 6 [(gogoproto.nullable) = false]; @@ -65,8 +66,15 @@ message QueryResponse { } } +message queryPlan { + oneof encoding { + bytes json = 1; + } +} + message QueryRangeRequest { string query = 1; + queryPlan queryPlan = 16; int64 start_time_seconds = 2; int64 end_time_seconds = 3; diff --git a/vendor/github.com/thanos-io/thanos/pkg/compact/compact.go b/vendor/github.com/thanos-io/thanos/pkg/compact/compact.go index ad5c92bdb9..2f0dbfdb27 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/compact/compact.go +++ b/vendor/github.com/thanos-io/thanos/pkg/compact/compact.go @@ -807,14 +807,17 @@ type CompactionLifecycleCallback interface { type DefaultCompactionLifecycleCallback struct { } -func (c DefaultCompactionLifecycleCallback) PreCompactionCallback(_ context.Context, _ log.Logger, _ *Group, toCompactBlocks []*metadata.Meta) error { +func (c DefaultCompactionLifecycleCallback) PreCompactionCallback(_ context.Context, logger log.Logger, cg *Group, toCompactBlocks []*metadata.Meta) error { // Due to #183 we verify that none of the blocks in the plan have overlapping sources. // This is one potential source of how we could end up with duplicated chunks. uniqueSources := map[ulid.ULID]struct{}{} for _, m := range toCompactBlocks { for _, s := range m.Compaction.Sources { if _, ok := uniqueSources[s]; ok { - return halt(errors.Errorf("overlapping sources detected for plan %v", toCompactBlocks)) + if !cg.enableVerticalCompaction { + return halt(errors.Errorf("overlapping sources detected for plan %v", toCompactBlocks)) + } + level.Warn(logger).Log("msg", "overlapping sources detected for plan", "duplicated_block", s, "to_compact_blocks", fmt.Sprintf("%v", toCompactBlocks)) } uniqueSources[s] = struct{}{} } @@ -831,13 +834,9 @@ func (c DefaultCompactionLifecycleCallback) GetBlockPopulator(_ context.Context, } // Compactor provides compaction against an underlying storage of time series data. -// This is similar to tsdb.Compactor just without Plan method. +// It is similar to tsdb.Compactor but only relevant methods are kept. Plan and Write are removed. // TODO(bwplotka): Split the Planner from Compactor on upstream as well, so we can import it. type Compactor interface { - // Write persists a Block into a directory. - // No Block is written when resulting Block has 0 samples, and returns empty ulid.ULID{}. - Write(dest string, b tsdb.BlockReader, mint, maxt int64, parent *tsdb.BlockMeta) (ulid.ULID, error) - // Compact runs compaction against the provided directories. Must // only be called concurrently with results of Plan(). // Can optionally pass a list of already open blocks, diff --git a/vendor/github.com/thanos-io/thanos/pkg/extkingpin/flags.go b/vendor/github.com/thanos-io/thanos/pkg/extkingpin/flags.go index cee8c5df76..558334f47f 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/extkingpin/flags.go +++ b/vendor/github.com/thanos-io/thanos/pkg/extkingpin/flags.go @@ -119,7 +119,7 @@ func RegisterSelectorRelabelFlags(cmd FlagClause) *extflag.PathOrContent { return extflag.RegisterPathOrContent( cmd, "selector.relabel-config", - "YAML file that contains relabeling configuration that allows selecting blocks. It follows native Prometheus relabel-config syntax. See format details: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config ", + "YAML file with relabeling configuration that allows selecting blocks to act on based on their external labels. It follows thanos sharding relabel-config syntax. For format details see: https://thanos.io/tip/thanos/sharding.md/#relabelling ", extflag.WithEnvSubstitution(), ) } diff --git a/vendor/github.com/thanos-io/thanos/pkg/query/remote_engine.go b/vendor/github.com/thanos-io/thanos/pkg/query/remote_engine.go index 5638d7cd07..8e27d28f53 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/query/remote_engine.go +++ b/vendor/github.com/thanos-io/thanos/pkg/query/remote_engine.go @@ -187,7 +187,7 @@ func (r *remoteEngine) NewRangeQuery(_ context.Context, _ promql.QueryOpts, plan client: r.client, opts: r.opts, - query: plan.String(), + plan: plan, start: start, end: end, interval: interval, @@ -200,7 +200,7 @@ func (r *remoteEngine) NewInstantQuery(_ context.Context, _ promql.QueryOpts, pl client: r.client, opts: r.opts, - query: plan.String(), + plan: plan, start: ts, end: ts, interval: 0, @@ -212,7 +212,7 @@ type remoteQuery struct { client Client opts Opts - query string + plan api.RemoteQuery start time.Time end time.Time interval time.Duration @@ -231,11 +231,16 @@ func (r *remoteQuery) Exec(ctx context.Context) *promql.Result { if r.opts.AutoDownsample { maxResolution = int64(r.interval.Seconds() / 5) } + plan, err := querypb.NewJSONEncodedPlan(r.plan) + if err != nil { + level.Warn(r.logger).Log("msg", "Failed to encode query plan", "err", err) + } // Instant query. if r.start == r.end { request := &querypb.QueryRequest{ - Query: r.query, + Query: r.plan.String(), + QueryPlan: plan, TimeSeconds: r.start.Unix(), TimeoutSeconds: int64(r.opts.Timeout.Seconds()), EnablePartialResponse: r.opts.EnablePartialResponse, @@ -286,7 +291,8 @@ func (r *remoteQuery) Exec(ctx context.Context) *promql.Result { } request := &querypb.QueryRangeRequest{ - Query: r.query, + Query: r.plan.String(), + QueryPlan: plan, StartTimeSeconds: r.start.Unix(), EndTimeSeconds: r.end.Unix(), IntervalSeconds: int64(r.interval.Seconds()), @@ -349,7 +355,7 @@ func (r *remoteQuery) Exec(ctx context.Context) *promql.Result { } result = append(result, series) } - level.Debug(r.logger).Log("msg", "Executed query", "query", r.query, "time", time.Since(start)) + level.Debug(r.logger).Log("msg", "Executed query", "query", r.plan.String(), "time", time.Since(start)) return &promql.Result{Value: result, Warnings: warnings} } @@ -360,10 +366,10 @@ func (r *remoteQuery) Statement() parser.Statement { return nil } func (r *remoteQuery) Stats() *stats.Statistics { return nil } -func (r *remoteQuery) String() string { return r.query } - func (r *remoteQuery) Cancel() { if r.cancel != nil { r.cancel() } } + +func (r *remoteQuery) String() string { return r.plan.String() } diff --git a/vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go b/vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go index a3b520d15e..f01c4b2b35 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go +++ b/vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go @@ -383,7 +383,9 @@ func (s *Shipper) upload(ctx context.Context, meta *metadata.Meta) error { } // Attach current labels and write a new meta file with Thanos extensions. if lset := s.getLabels(); !lset.IsEmpty() { - meta.Thanos.Labels = lset.Map() + lset.Range(func(l labels.Label) { + meta.Thanos.Labels[l.Name] = l.Value + }) } meta.Thanos.Source = s.source meta.Thanos.SegmentFiles = block.GetSegmentFiles(updir) diff --git a/vendor/github.com/thanos-io/thanos/pkg/targets/targetspb/rpc.pb.go b/vendor/github.com/thanos-io/thanos/pkg/targets/targetspb/rpc.pb.go index da33a07575..5344c1905e 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/targets/targetspb/rpc.pb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/targets/targetspb/rpc.pb.go @@ -39,18 +39,21 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type TargetHealth int32 const ( - TargetHealth_DOWN TargetHealth = 0 - TargetHealth_UP TargetHealth = 1 + TargetHealth_DOWN TargetHealth = 0 + TargetHealth_UP TargetHealth = 1 + TargetHealth_UNKNOWN TargetHealth = 2 ) var TargetHealth_name = map[int32]string{ 0: "DOWN", 1: "UP", + 2: "UNKNOWN", } var TargetHealth_value = map[string]int32{ - "DOWN": 0, - "UP": 1, + "DOWN": 0, + "UP": 1, + "UNKNOWN": 2, } func (x TargetHealth) String() string { @@ -347,51 +350,51 @@ func init() { func init() { proto.RegisterFile("targets/targetspb/rpc.proto", fileDescriptor_b5cdaee03579e907) } var fileDescriptor_b5cdaee03579e907 = []byte{ - // 694 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x41, 0x4f, 0xdb, 0x4a, - 0x10, 0xb6, 0x03, 0x38, 0x64, 0x80, 0xbc, 0xb0, 0xe2, 0x81, 0xc9, 0x7b, 0x8a, 0x51, 0x2e, 0x8f, - 0xd7, 0x4a, 0x4e, 0x15, 0x2e, 0xad, 0xd4, 0x0b, 0x6e, 0x68, 0xa9, 0xd4, 0x42, 0xba, 0x09, 0x45, - 0xa5, 0x07, 0xb4, 0x49, 0xb6, 0x4e, 0x24, 0x93, 0x75, 0x77, 0x37, 0x54, 0xfc, 0x0b, 0xfe, 0x49, - 0x0f, 0xfd, 0x13, 0x1c, 0x7a, 0xe0, 0xd8, 0x93, 0xdb, 0xc2, 0x2d, 0xbf, 0xa2, 0xf2, 0xda, 0x8e, - 0x1d, 0x48, 0x8f, 0xbd, 0x78, 0x67, 0xbe, 0xf9, 0xe6, 0x9b, 0x59, 0xef, 0xce, 0xc2, 0x3f, 0x92, - 0x70, 0x97, 0x4a, 0x51, 0x8b, 0x57, 0xbf, 0x53, 0xe3, 0x7e, 0xd7, 0xf6, 0x39, 0x93, 0x0c, 0x19, - 0xb2, 0x4f, 0x86, 0x4c, 0x94, 0x37, 0x85, 0x64, 0x9c, 0xd6, 0xd4, 0xd7, 0xef, 0xd4, 0xe4, 0x85, - 0x4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 0x4f, 0x84, 0x0f, 0x07, 0x43, 0x57, 0x75, 0x5f, 0x08, - 0x63, 0x31, 0xe0, 0x2c, 0x82, 0xc1, 0xa9, 0x18, 0x79, 0xb2, 0xfa, 0x45, 0x4f, 0xca, 0x4d, 0x44, - 0xd0, 0x6b, 0x58, 0x21, 0x5d, 0x39, 0x38, 0xa7, 0xed, 0x49, 0xd1, 0xb9, 0xed, 0xa5, 0xfa, 0x5a, - 0x52, 0x74, 0x37, 0x13, 0x74, 0x56, 0xc7, 0x81, 0x35, 0x4d, 0xc7, 0xd3, 0x2e, 0x7a, 0x03, 0xc5, - 0x1e, 0x67, 0xbe, 0x4f, 0x7b, 0x89, 0x5e, 0x4e, 0xe9, 0xfd, 0x9d, 0xe8, 0x35, 0xb2, 0x51, 0x07, - 0x8d, 0x03, 0xeb, 0x4e, 0x02, 0xbe, 0xe3, 0x57, 0x3f, 0xcf, 0xc3, 0x72, 0xb6, 0x0b, 0x74, 0x0c, - 0xa5, 0x5e, 0xdc, 0x3f, 0xed, 0xbd, 0x0a, 0x6f, 0x51, 0xf2, 0xab, 0x56, 0x93, 0x2a, 0x27, 0x0a, - 0x6e, 0x51, 0xe9, 0x98, 0x57, 0x81, 0xa5, 0x8d, 0x03, 0xeb, 0x5e, 0x0a, 0xbe, 0x87, 0xa0, 0x27, - 0x60, 0x78, 0x91, 0x5c, 0xee, 0x77, 0x72, 0xc5, 0x58, 0x2e, 0x26, 0xe2, 0x78, 0x45, 0x36, 0x80, - 0xe8, 0x72, 0xe2, 0xd3, 0x26, 0x63, 0x9e, 0x39, 0x17, 0x9e, 0x81, 0x53, 0x1c, 0x07, 0x56, 0x06, - 0xc5, 0x19, 0x1b, 0x3d, 0x84, 0x42, 0xe4, 0x1d, 0x71, 0xcf, 0x9c, 0x57, 0xf4, 0x95, 0x71, 0x60, - 0xa5, 0x20, 0x4e, 0xcd, 0x90, 0xec, 0x7a, 0xac, 0x43, 0xbc, 0x90, 0xbc, 0x90, 0x92, 0x27, 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 0xc7, 0x50, 0xe7, 0xb6, 0xf3, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xf2, 0x61, - 0x2b, 0xab, 0xbd, 0x05, 0x00, 0x00, + // 702 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x41, 0x53, 0xdb, 0x3a, + 0x10, 0xb6, 0x03, 0x38, 0x64, 0x81, 0xbc, 0xa0, 0xe1, 0x81, 0xc9, 0x7b, 0x13, 0x33, 0xb9, 0x3c, + 0x5e, 0x3b, 0x75, 0x3a, 0xe1, 0xd2, 0xce, 0xf4, 0x82, 0x1b, 0x5a, 0x3a, 0x6d, 0x43, 0xaa, 0x84, + 0x32, 0xa5, 0x07, 0x46, 0x49, 0x54, 0x27, 0x33, 0x26, 0x72, 0x25, 0x85, 0x0e, 0xff, 0x82, 0x7f, + 0xd2, 0x43, 0xff, 0x04, 0x87, 0x1e, 0x38, 0xf6, 0x94, 0xb6, 0x70, 0xcb, 0xaf, 0xe8, 0x58, 0xb6, + 0x63, 0x07, 0xd2, 0x63, 0x2f, 0xd6, 0xee, 0xb7, 0xdf, 0x7e, 0xbb, 0xb2, 0xb4, 0x82, 0x7f, 0x24, + 0xe1, 0x2e, 0x95, 0xa2, 0x12, 0xad, 0x7e, 0xbb, 0xc2, 0xfd, 0x8e, 0xed, 0x73, 0x26, 0x19, 0x32, + 0x64, 0x8f, 0x0c, 0x98, 0x28, 0x6e, 0x0a, 0xc9, 0x38, 0xad, 0xa8, 0xaf, 0xdf, 0xae, 0xc8, 0x73, + 0x9f, 0x8a, 0x90, 0x52, 0x5c, 0x73, 0x99, 0xcb, 0x94, 0x59, 0x09, 0xac, 0x08, 0x8d, 0x12, 0x3c, + 0xd2, 0xa6, 0xde, 0xad, 0x04, 0xcb, 0x65, 0xcc, 0xf5, 0x68, 0x45, 0x79, 0xed, 0xe1, 0x87, 0x8a, + 0xec, 0x9f, 0x52,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0xed, + 0x78, 0x08, 0xed, 0x56, 0x3c, 0x84, 0xce, 0x7a, 0xb4, 0xfd, 0x54, 0xd6, 0xc5, 0x77, 0x4b, 0xc7, + 0x29, 0x1f, 0x3d, 0x03, 0x94, 0x78, 0xb5, 0x21, 0x27, 0xb2, 0xcf, 0x06, 0xe6, 0xe2, 0x96, 0xbe, + 0xad, 0x3b, 0xeb, 0xe3, 0x91, 0x35, 0x23, 0x8a, 0x67, 0x60, 0xe8, 0x11, 0x18, 0x3d, 0x4a, 0x3c, + 0xd9, 0x33, 0x73, 0x6a, 0x20, 0xd7, 0xa6, 0xe7, 0x60, 0x5f, 0xc5, 0x1c, 0x08, 0x0e, 0x23, 0xe4, + 0xe1, 0x68, 0x2d, 0xf7, 0x60, 0x65, 0xea, 0x9a, 0xfd, 0xb1, 0x1b, 0x73, 0xef, 0x01, 0x2c, 0xa7, + 0xbb, 0x41, 0x8b, 0x30, 0x5f, 0x3b, 0x38, 0xaa, 0x17, 0x34, 0x64, 0x40, 0xe6, 0xb0, 0x11, 0x8e, + 0xfb, 0x61, 0xfd, 0x65, 0x3d, 0x00, 0x33, 0xd5, 0xe7, 0x90, 0x8d, 0x07, 0xe5, 0x49, 0x62, 0xae, + 0xcf, 0x7e, 0xb1, 0x8a, 0x1b, 0x77, 0xf0, 0xf0, 0x89, 0x78, 0xa8, 0x3b, 0xff, 0x5d, 0xfe, 0x2c, + 0x69, 0x97, 0xd7, 0x25, 0xfd, 0xea, 0xba, 0xa4, 0xff, 0xb8, 0x2e, 0xe9, 0x17, 0x37, 0x25, 0xed, + 0xea, 0xa6, 0xa4, 0x7d, 0xbb, 0x29, 0x69, 0xc7, 0xb9, 0xc9, 0x73, 0xdd, 0x36, 0xd4, 0x21, 0xee, + 0xfc, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x2a, 0x5c, 0x84, 0x60, 0xca, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/vendor/github.com/thanos-io/thanos/pkg/targets/targetspb/rpc.proto b/vendor/github.com/thanos-io/thanos/pkg/targets/targetspb/rpc.proto index 61863f61b8..6515dc0070 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/targets/targetspb/rpc.proto +++ b/vendor/github.com/thanos-io/thanos/pkg/targets/targetspb/rpc.proto @@ -60,6 +60,7 @@ message TargetDiscovery { enum TargetHealth { DOWN = 0; UP = 1; + UNKNOWN = 2; } message ActiveTarget { diff --git a/vendor/modules.txt b/vendor/modules.txt index c7708fa77d..15a908748e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -920,7 +920,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-20240327143517-c5e4b2e6ef02 +# github.com/thanos-io/promql-engine v0.0.0-20240405095051-b7d0da367508 ## explicit; go 1.21 github.com/thanos-io/promql-engine/api github.com/thanos-io/promql-engine/engine @@ -943,7 +943,7 @@ github.com/thanos-io/promql-engine/query github.com/thanos-io/promql-engine/ringbuffer github.com/thanos-io/promql-engine/storage github.com/thanos-io/promql-engine/storage/prometheus -# github.com/thanos-io/thanos v0.34.2-0.20240328185924-943401f726ed +# github.com/thanos-io/thanos v0.34.2-0.20240409164351-953ce26ad746 ## explicit; go 1.21 github.com/thanos-io/thanos/pkg/api/query/querypb github.com/thanos-io/thanos/pkg/block From 0c32c8fcb5fe483cf99508202d5bb00f87052e3f Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Tue, 9 Apr 2024 16:53:14 -0700 Subject: [PATCH 3/3] update changelog Signed-off-by: Ben Ye --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a90d23e84..1d85494dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * [CHANGE] Main: Mark `mem-ballast-size-bytes` flag as deprecated. #5816 * [CHANGE] Querier: Mark `-querier.ingester-streaming` flag as deprecated. Now query ingester streaming is always enabled. #5817 * [CHANGE] Compactor/Bucket Store: Added `-blocks-storage.bucket-store.block-discovery-strategy` to configure different block listing strategy. Reverted the current recursive block listing mechanism and use the strategy `Concurrent` as in 1.15. #5828 +* [CHANGE] Compactor: Don't halt compactor when overlapped source blocks detected. #5854 * [FEATURE] Ingester: Add per-tenant new metric `cortex_ingester_tsdb_data_replay_duration_seconds`. #5477 * [FEATURE] Query Frontend/Scheduler: Add query priority support. #5605 * [FEATURE] Tracing: Add `kuberesolver` to resolve endpoints address with `kubernetes://` prefix as Kubernetes service. #5731