@@ -7,14 +7,12 @@ import (
77 "context"
88 "fmt"
99 "math"
10- "strings"
1110 "sync"
1211 "time"
1312
1413 "github.com/thanos-io/promql-engine/execution/model"
1514 "github.com/thanos-io/promql-engine/execution/parse"
1615 "github.com/thanos-io/promql-engine/execution/telemetry"
17- "github.com/thanos-io/promql-engine/execution/warnings"
1816 "github.com/thanos-io/promql-engine/extlabels"
1917 "github.com/thanos-io/promql-engine/query"
2018 "github.com/thanos-io/promql-engine/ringbuffer"
@@ -23,9 +21,7 @@ import (
2321 "github.com/prometheus/prometheus/model/histogram"
2422 "github.com/prometheus/prometheus/model/labels"
2523 "github.com/prometheus/prometheus/model/value"
26- "github.com/prometheus/prometheus/promql/parser/posrange"
2724 "github.com/prometheus/prometheus/tsdb/chunkenc"
28- "github.com/prometheus/prometheus/util/annotations"
2925)
3026
3127type matrixScanner struct {
@@ -71,9 +67,6 @@ type matrixSelector struct {
7167
7268 // Lookback delta for extended range functions.
7369 extLookbackDelta int64
74-
75- nonCounterMetric string
76- hasFloats bool
7770}
7871
7972var ErrNativeHistogramsNotSupported = errors .New ("native histograms are not supported in extended range functions" )
@@ -160,10 +153,6 @@ func (o *matrixSelector) Next(ctx context.Context) ([]model.StepVector, error) {
160153 }
161154
162155 if o .currentStep > o .maxt {
163- if o .nonCounterMetric != "" && o .hasFloats {
164- warnings .AddToContext (annotations .NewPossibleNonCounterInfo (o .nonCounterMetric , posrange.PositionRange {}), ctx )
165- }
166-
167156 return nil , nil
168157 }
169158 if err := o .loadSeries (ctx ); err != nil {
@@ -207,7 +196,6 @@ func (o *matrixSelector) Next(ctx context.Context) ([]model.StepVector, error) {
207196 vectors [currStep ].AppendHistogram (o .vectorPool , scanner .signature , h )
208197 } else {
209198 vectors [currStep ].AppendSample (o .vectorPool , scanner .signature , f )
210- o .hasFloats = true
211199 }
212200 }
213201 o .IncrementSamplesAtTimestamp (scanner .buffer .Len (), seriesTs )
@@ -258,20 +246,6 @@ func (o *matrixSelector) loadSeries(ctx context.Context) error {
258246 o .seriesBatchSize = numSeries
259247 }
260248 o .vectorPool .SetStepSize (int (o .seriesBatchSize ))
261-
262- // Add a warning if rate or increase is applied on metrics which are not named like counters.
263- if o .functionName == "rate" || o .functionName == "increase" {
264- if len (series ) > 0 {
265- metricName := series [0 ].Labels ().Get (labels .MetricName )
266- if metricName != "" &&
267- ! strings .HasSuffix (metricName , "_total" ) &&
268- ! strings .HasSuffix (metricName , "_sum" ) &&
269- ! strings .HasSuffix (metricName , "_count" ) &&
270- ! strings .HasSuffix (metricName , "_bucket" ) {
271- o .nonCounterMetric = metricName
272- }
273- }
274- }
275249 })
276250 return err
277251}
0 commit comments