From 7191ecb8d8e49f8a283b8b74187e18e12d7b6465 Mon Sep 17 00:00:00 2001 From: SungJin1212 Date: Thu, 5 Dec 2024 05:57:43 +0900 Subject: [PATCH] Upgrade thanos version to v0.37.1 (#6400) Signed-off-by: SungJin1212 --- go.mod | 4 ++-- go.sum | 8 ++++---- .../promql-engine/logicalplan/distribute.go | 13 ++++++------- .../thanos-io/thanos/pkg/promclient/promclient.go | 13 +++++++++---- vendor/modules.txt | 4 ++-- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index a1236dbcb4..1d1594ca97 100644 --- a/go.mod +++ b/go.mod @@ -52,8 +52,8 @@ require ( github.com/spf13/afero v1.11.0 github.com/stretchr/testify v1.10.0 github.com/thanos-io/objstore v0.0.0-20241111205755-d1dd89d41f97 - github.com/thanos-io/promql-engine v0.0.0-20241106100125-097e6e9f425a - github.com/thanos-io/thanos v0.37.0 + github.com/thanos-io/promql-engine v0.0.0-20241203103240-2f49f80c7c68 + github.com/thanos-io/thanos v0.37.1 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.17 diff --git a/go.sum b/go.sum index 323196f3dd..0aeecbfe82 100644 --- a/go.sum +++ b/go.sum @@ -1663,10 +1663,10 @@ github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e h1:f1 github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e/go.mod h1:jXcofnrSln/cLI6/dhlBxPQZEEQHVPCcFaH75M+nSzM= github.com/thanos-io/objstore v0.0.0-20241111205755-d1dd89d41f97 h1:VjG0mwhN1DkncwDHFvrpd12/2TLfgYNRmEQA48ikp+0= github.com/thanos-io/objstore v0.0.0-20241111205755-d1dd89d41f97/go.mod h1:vyzFrBXgP+fGNG2FopEGWOO/zrIuoy7zt3LpLeezRsw= -github.com/thanos-io/promql-engine v0.0.0-20241106100125-097e6e9f425a h1:BhWU58VHOxkxQEMByih9fM2WwuwCGtk5AulIcSRSr0A= -github.com/thanos-io/promql-engine v0.0.0-20241106100125-097e6e9f425a/go.mod h1:wx0JlRZtsB2S10JYUgeg5GqLfMxw31SzArP+28yyE00= -github.com/thanos-io/thanos v0.37.0 h1:RCO2pL3S1sU6Wd3ITviWSzouFg8VVzpz92eCJOUEnow= -github.com/thanos-io/thanos v0.37.0/go.mod h1:bkdS9wnItzpNofJjjp2R7Y5Xt5UeA688dLKcjmf7MaA= +github.com/thanos-io/promql-engine v0.0.0-20241203103240-2f49f80c7c68 h1:cChM/FbpXeYmrSmXO1/MmmSlONviLVxWAWCB0/g4JrY= +github.com/thanos-io/promql-engine v0.0.0-20241203103240-2f49f80c7c68/go.mod h1:wx0JlRZtsB2S10JYUgeg5GqLfMxw31SzArP+28yyE00= +github.com/thanos-io/thanos v0.37.1 h1:PuTMql3S/i5UWlBT0WbCDwwL6Kc6Jf7DLHt2rdj4ivY= +github.com/thanos-io/thanos v0.37.1/go.mod h1:5Ni7Uc1Bc8UCGOYmZ/2f/LVvDkZKNDdqDJZqjDFG+rI= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= 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 b19d3d9c82..0f16847d0a 100644 --- a/vendor/github.com/thanos-io/promql-engine/logicalplan/distribute.go +++ b/vendor/github.com/thanos-io/promql-engine/logicalplan/distribute.go @@ -178,13 +178,6 @@ func (m DistributedExecutionOptimizer) Optimize(plan Node, opts *query.Options) } minEngineOverlap := labelRanges.minOverlap() - // TODO(fpetkovski): Consider changing TraverseBottomUp to pass in a list of parents in the transform function. - parents := make(map[*Node]*Node) - TraverseBottomUp(nil, &plan, func(parent, current *Node) (stop bool) { - parents[current] = parent - return false - }) - // Preprocess rewrite distributable averages as sum/count var warns = annotations.New() TraverseBottomUp(nil, &plan, func(parent, current *Node) (stop bool) { @@ -217,6 +210,12 @@ func (m DistributedExecutionOptimizer) Optimize(plan Node, opts *query.Options) return !(isDistributive(parent, m.SkipBinaryPushdown, engineLabels, warns) || isAvgAggregation(parent)) }) + // TODO(fpetkovski): Consider changing TraverseBottomUp to pass in a list of parents in the transform function. + parents := make(map[*Node]*Node) + TraverseBottomUp(nil, &plan, func(parent, current *Node) (stop bool) { + parents[current] = parent + return false + }) TraverseBottomUp(nil, &plan, func(parent, current *Node) (stop bool) { // If the current operation is not distributive, stop the traversal. if !isDistributive(current, m.SkipBinaryPushdown, engineLabels, warns) { diff --git a/vendor/github.com/thanos-io/thanos/pkg/promclient/promclient.go b/vendor/github.com/thanos-io/thanos/pkg/promclient/promclient.go index eeca44db92..b655ea1ab1 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/promclient/promclient.go +++ b/vendor/github.com/thanos-io/thanos/pkg/promclient/promclient.go @@ -787,7 +787,9 @@ func (c *Client) SeriesInGRPC(ctx context.Context, base *url.URL, matchers []*la q.Add("match[]", storepb.PromMatchersToString(matchers...)) q.Add("start", formatTime(timestamp.Time(startTime))) q.Add("end", formatTime(timestamp.Time(endTime))) - q.Add("limit", strconv.Itoa(limit)) + if limit > 0 { + q.Add("limit", strconv.Itoa(limit)) + } u.RawQuery = q.Encode() var m struct { @@ -809,7 +811,9 @@ func (c *Client) LabelNamesInGRPC(ctx context.Context, base *url.URL, matchers [ } q.Add("start", formatTime(timestamp.Time(startTime))) q.Add("end", formatTime(timestamp.Time(endTime))) - q.Add("limit", strconv.Itoa(limit)) + if limit > 0 { + q.Add("limit", strconv.Itoa(limit)) + } u.RawQuery = q.Encode() var m struct { @@ -830,7 +834,9 @@ func (c *Client) LabelValuesInGRPC(ctx context.Context, base *url.URL, label str } q.Add("start", formatTime(timestamp.Time(startTime))) q.Add("end", formatTime(timestamp.Time(endTime))) - q.Add("limit", strconv.Itoa(limit)) + if limit > 0 { + q.Add("limit", strconv.Itoa(limit)) + } u.RawQuery = q.Encode() var m struct { @@ -898,7 +904,6 @@ func (c *Client) MetricMetadataInGRPC(ctx context.Context, base *url.URL, metric if metric != "" { q.Add("metric", metric) } - // We only set limit when it is >= 0. if limit >= 0 { q.Add("limit", strconv.Itoa(limit)) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 77f3f01cd0..c92285c6a8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -966,7 +966,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-20241106100125-097e6e9f425a +# github.com/thanos-io/promql-engine v0.0.0-20241203103240-2f49f80c7c68 ## explicit; go 1.22.0 github.com/thanos-io/promql-engine/api github.com/thanos-io/promql-engine/engine @@ -989,7 +989,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.37.0 +# github.com/thanos-io/thanos v0.37.1 ## explicit; go 1.23.0 github.com/thanos-io/thanos/pkg/api/query/querypb github.com/thanos-io/thanos/pkg/block