From 61e35d75277b92ebec1f38a91df5e257335d2ab4 Mon Sep 17 00:00:00 2001 From: Jeanette Tan Date: Mon, 23 Oct 2023 14:57:44 +0800 Subject: [PATCH] Update mimir-prometheus vendor to debd4b196ec2 --- go.mod | 2 +- go.sum | 4 ++-- .../prometheus/prometheus/promql/engine.go | 2 +- .../prometheus/prometheus/promql/functions.go | 14 +++----------- vendor/modules.txt | 4 ++-- 5 files changed, 9 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index b182f6e0d4f..07fe8cf507a 100644 --- a/go.mod +++ b/go.mod @@ -248,7 +248,7 @@ require ( ) // Using a fork of Prometheus with Mimir-specific changes. -replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20231020144705-d0d6240125f9 +replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20231023065343-debd4b196ec2 // Replace memberlist with our fork which includes some fixes that haven't been // merged upstream yet: diff --git a/go.sum b/go.sum index 2b7b05407ca..0f2c555ef61 100644 --- a/go.sum +++ b/go.sum @@ -546,8 +546,8 @@ github.com/grafana/gomemcache v0.0.0-20230914135007-70d78eaabfe1 h1:MLYY2R60/74h github.com/grafana/gomemcache v0.0.0-20230914135007-70d78eaabfe1/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU= github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe h1:yIXAAbLswn7VNWBIvM71O2QsgfgW9fRXZNR0DXe6pDU= github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/grafana/mimir-prometheus v0.0.0-20231020144705-d0d6240125f9 h1:KVelZKI3FNeGvH9V3QYuXc7EGyc1AD7zsKanLqEdvaI= -github.com/grafana/mimir-prometheus v0.0.0-20231020144705-d0d6240125f9/go.mod h1:bHUBXcO5vIkqWBAy86JlejQPQltETv9Cv5whKCeF2FM= +github.com/grafana/mimir-prometheus v0.0.0-20231023065343-debd4b196ec2 h1:NLJ/tb7UMB71WbTx/KFBwnA3iQQxIvP9Kc1tDJB0rFM= +github.com/grafana/mimir-prometheus v0.0.0-20231023065343-debd4b196ec2/go.mod h1:bHUBXcO5vIkqWBAy86JlejQPQltETv9Cv5whKCeF2FM= github.com/grafana/opentracing-contrib-go-stdlib v0.0.0-20230509071955-f410e79da956 h1:em1oddjXL8c1tL0iFdtVtPloq2hRPen2MJQKoAWpxu0= github.com/grafana/opentracing-contrib-go-stdlib v0.0.0-20230509071955-f410e79da956/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU= github.com/grafana/regexp v0.0.0-20221005093135-b4c2bcb0a4b6 h1:A3dhViTeFDSQcGOXuUi6ukCQSMyDtDISBp2z6OOo2YM= diff --git a/vendor/github.com/prometheus/prometheus/promql/engine.go b/vendor/github.com/prometheus/prometheus/promql/engine.go index 034e5455680..1756abbd687 100644 --- a/vendor/github.com/prometheus/prometheus/promql/engine.go +++ b/vendor/github.com/prometheus/prometheus/promql/engine.go @@ -2536,7 +2536,7 @@ type groupedAggregation struct { func (ev *evaluator) aggregation(e *parser.AggregateExpr, grouping []string, param interface{}, vec Vector, seriesHelper []EvalSeriesHelper, enh *EvalNodeHelper) (Vector, annotations.Annotations) { op := e.Op without := e.Without - annos := annotations.Annotations{} + var annos annotations.Annotations result := map[uint64]*groupedAggregation{} orderedResult := []*groupedAggregation{} var k int64 diff --git a/vendor/github.com/prometheus/prometheus/promql/functions.go b/vendor/github.com/prometheus/prometheus/promql/functions.go index ecd6f7c8b4e..5fd54f6c768 100644 --- a/vendor/github.com/prometheus/prometheus/promql/functions.go +++ b/vendor/github.com/prometheus/prometheus/promql/functions.go @@ -77,7 +77,7 @@ func extrapolatedRate(vals []parser.Value, args parser.Expressions, enh *EvalNod resultHistogram *histogram.FloatHistogram firstT, lastT int64 numSamplesMinusOne int - annos = annotations.Annotations{} + annos annotations.Annotations ) // We need either at least two Histograms and no Floats, or at least two @@ -88,14 +88,6 @@ func extrapolatedRate(vals []parser.Value, args parser.Expressions, enh *EvalNod return enh.Out, annos.Add(annotations.NewMixedFloatsHistogramsWarning(metricName, args[0].PositionRange())) } - if isCounter && metricName != "" && len(samples.Floats) > 0 && - !strings.HasSuffix(metricName, "_total") && - !strings.HasSuffix(metricName, "_sum") && - !strings.HasSuffix(metricName, "_count") && - !strings.HasSuffix(metricName, "_bucket") { - annos.Add(annotations.NewPossibleNonCounterInfo(metricName, args[0].PositionRange())) - } - switch { case len(samples.Histograms) > 1: numSamplesMinusOne = len(samples.Histograms) - 1 @@ -642,7 +634,7 @@ func funcQuantileOverTime(vals []parser.Value, args parser.Expressions, enh *Eva return enh.Out, nil } - annos := annotations.Annotations{} + var annos annotations.Annotations if math.IsNaN(q) || q < 0 || q > 1 { annos.Add(annotations.NewInvalidQuantileWarning(q, args[0].PositionRange())) } @@ -1105,7 +1097,7 @@ func funcHistogramFraction(vals []parser.Value, args parser.Expressions, enh *Ev func funcHistogramQuantile(vals []parser.Value, args parser.Expressions, enh *EvalNodeHelper) (Vector, annotations.Annotations) { q := vals[0].(Vector)[0].F inVec := vals[1].(Vector) - annos := annotations.Annotations{} + var annos annotations.Annotations if math.IsNaN(q) || q < 0 || q > 1 { annos.Add(annotations.NewInvalidQuantileWarning(q, args[0].PositionRange())) diff --git a/vendor/modules.txt b/vendor/modules.txt index fd22cbbbf18..232f8665741 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -884,7 +884,7 @@ github.com/prometheus/exporter-toolkit/web github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util -# github.com/prometheus/prometheus v1.99.0 => github.com/grafana/mimir-prometheus v0.0.0-20231020144705-d0d6240125f9 +# github.com/prometheus/prometheus v1.99.0 => github.com/grafana/mimir-prometheus v0.0.0-20231023065343-debd4b196ec2 ## explicit; go 1.20 github.com/prometheus/prometheus/config github.com/prometheus/prometheus/discovery @@ -1466,7 +1466,7 @@ sigs.k8s.io/kustomize/kyaml/yaml/walk # sigs.k8s.io/yaml v1.3.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20231020144705-d0d6240125f9 +# github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20231023065343-debd4b196ec2 # github.com/hashicorp/memberlist => github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe # gopkg.in/yaml.v3 => github.com/colega/go-yaml-yaml v0.0.0-20220720105220-255a8d16d094 # github.com/grafana/regexp => github.com/grafana/regexp v0.0.0-20221005093135-b4c2bcb0a4b6