@@ -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" )
@@ -154,10 +147,6 @@ func (o *matrixSelector) Next(ctx context.Context) ([]model.StepVector, error) {
154147 }
155148
156149 if o .currentStep > o .maxt {
157- if o .nonCounterMetric != "" && o .hasFloats {
158- warnings .AddToContext (annotations .NewPossibleNonCounterInfo (o .nonCounterMetric , posrange.PositionRange {}), ctx )
159- }
160-
161150 return nil , nil
162151 }
163152 if err := o .loadSeries (ctx ); err != nil {
@@ -200,7 +189,6 @@ func (o *matrixSelector) Next(ctx context.Context) ([]model.StepVector, error) {
200189 vectors [currStep ].AppendHistogram (o .vectorPool , scanner .signature , h )
201190 } else {
202191 vectors [currStep ].AppendSample (o .vectorPool , scanner .signature , f )
203- o .hasFloats = true
204192 }
205193 }
206194 o .telemetry .IncrementSamplesAtTimestamp (scanner .buffer .SampleCount (), seriesTs )
@@ -252,20 +240,6 @@ func (o *matrixSelector) loadSeries(ctx context.Context) error {
252240 o .seriesBatchSize = numSeries
253241 }
254242 o .vectorPool .SetStepSize (int (o .seriesBatchSize ))
255-
256- // Add a warning if rate or increase is applied on metrics which are not named like counters.
257- if o .functionName == "rate" || o .functionName == "increase" {
258- if len (series ) > 0 {
259- metricName := series [0 ].Labels ().Get (labels .MetricName )
260- if metricName != "" &&
261- ! strings .HasSuffix (metricName , "_total" ) &&
262- ! strings .HasSuffix (metricName , "_sum" ) &&
263- ! strings .HasSuffix (metricName , "_count" ) &&
264- ! strings .HasSuffix (metricName , "_bucket" ) {
265- o .nonCounterMetric = metricName
266- }
267- }
268- }
269243 })
270244 return err
271245}
0 commit comments