mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
rules: no longer force CounterResetHint to Gauge
Signed-off-by: Trevor Whitney <trevorjwhitney@gmail.com>
This commit is contained in:
parent
dd94ebb87b
commit
c3e0a83725
|
@ -31,7 +31,6 @@ import (
|
|||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
|
||||
"github.com/prometheus/prometheus/model/histogram"
|
||||
"github.com/prometheus/prometheus/model/labels"
|
||||
"github.com/prometheus/prometheus/model/rulefmt"
|
||||
"github.com/prometheus/prometheus/model/timestamp"
|
||||
|
@ -671,9 +670,6 @@ func (g *Group) Eval(ctx context.Context, ts time.Time) {
|
|||
|
||||
for _, s := range vector {
|
||||
if s.H != nil {
|
||||
// We assume that all native histogram results are gauge histograms.
|
||||
// TODO(codesome): once PromQL can give the counter reset info, remove this assumption.
|
||||
s.H.CounterResetHint = histogram.GaugeType
|
||||
_, err = app.AppendHistogram(0, s.Metric, s.T, nil, s.H)
|
||||
} else {
|
||||
_, err = app.Append(0, s.Metric, s.T, s.V)
|
||||
|
|
|
@ -30,7 +30,6 @@ import (
|
|||
"go.uber.org/goleak"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
"github.com/prometheus/prometheus/model/histogram"
|
||||
"github.com/prometheus/prometheus/model/labels"
|
||||
"github.com/prometheus/prometheus/model/rulefmt"
|
||||
"github.com/prometheus/prometheus/model/timestamp"
|
||||
|
@ -1393,7 +1392,6 @@ func TestNativeHistogramsInRecordingRules(t *testing.T) {
|
|||
for _, h := range hists[1:] {
|
||||
expHist = expHist.Add(h.ToFloat())
|
||||
}
|
||||
expHist.CounterResetHint = histogram.GaugeType
|
||||
|
||||
it := s.Iterator(nil)
|
||||
require.Equal(t, chunkenc.ValFloatHistogram, it.Next())
|
||||
|
|
Loading…
Reference in a new issue