fix(promql): do not loose information about buckets when doing the detect
CI / Go tests (push) Has been cancelled
Details
CI / More Go tests (push) Has been cancelled
Details
CI / Go tests with previous Go version (push) Has been cancelled
Details
CI / UI tests (push) Has been cancelled
Details
CI / Go tests on Windows (push) Has been cancelled
Details
CI / Mixins tests (push) Has been cancelled
Details
CI / Build Prometheus for common architectures (0) (push) Has been cancelled
Details
CI / Build Prometheus for common architectures (1) (push) Has been cancelled
Details
CI / Build Prometheus for common architectures (2) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (0) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (1) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (10) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (11) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (2) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (3) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (4) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (5) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (6) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (7) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (8) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (9) (push) Has been cancelled
Details
CI / Check generated parser (push) Has been cancelled
Details
CI / golangci-lint (push) Has been cancelled
Details
CI / fuzzing (push) Has been cancelled
Details
CI / codeql (push) Has been cancelled
Details
CI / Report status of build Prometheus for all architectures (push) Has been cancelled
Details
CI / Publish main branch artifacts (push) Has been cancelled
Details
CI / Publish release artefacts (push) Has been cancelled
Details
CI / Publish UI on npm Registry (push) Has been cancelled
Details
CI / Go tests (push) Has been cancelled
Details
CI / More Go tests (push) Has been cancelled
Details
CI / Go tests with previous Go version (push) Has been cancelled
Details
CI / UI tests (push) Has been cancelled
Details
CI / Go tests on Windows (push) Has been cancelled
Details
CI / Mixins tests (push) Has been cancelled
Details
CI / Build Prometheus for common architectures (0) (push) Has been cancelled
Details
CI / Build Prometheus for common architectures (1) (push) Has been cancelled
Details
CI / Build Prometheus for common architectures (2) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (0) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (1) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (10) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (11) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (2) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (3) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (4) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (5) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (6) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (7) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (8) (push) Has been cancelled
Details
CI / Build Prometheus for all architectures (9) (push) Has been cancelled
Details
CI / Check generated parser (push) Has been cancelled
Details
CI / golangci-lint (push) Has been cancelled
Details
CI / fuzzing (push) Has been cancelled
Details
CI / codeql (push) Has been cancelled
Details
CI / Report status of build Prometheus for all architectures (push) Has been cancelled
Details
CI / Publish main branch artifacts (push) Has been cancelled
Details
CI / Publish release artefacts (push) Has been cancelled
Details
CI / Publish UI on npm Registry (push) Has been cancelled
Details
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
This commit is contained in:
parent
df94ecebab
commit
bccb1d6459
|
@ -126,17 +126,15 @@ func (f *histogramStatsIterator) getFloatResetHint(hint histogram.CounterResetHi
|
||||||
if hint != histogram.UnknownCounterReset {
|
if hint != histogram.UnknownCounterReset {
|
||||||
return hint
|
return hint
|
||||||
}
|
}
|
||||||
if f.lastFH == nil {
|
prevFH := f.lastFH
|
||||||
// If there was no previous histogram, this will not be used,
|
if prevFH == nil {
|
||||||
// and if there was a previous integer histogram, this will
|
if f.lastH == nil {
|
||||||
// force a reset detection. The later can happen if we used the
|
// We don't know if there's a counter reset.
|
||||||
// iterator to read integer histograms before, but switched to
|
|
||||||
// float histograms for whatever reason.
|
|
||||||
// https://github.com/prometheus/prometheus/issues/16681
|
|
||||||
return histogram.UnknownCounterReset
|
return histogram.UnknownCounterReset
|
||||||
}
|
}
|
||||||
|
prevFH = f.lastH.ToFloat(nil)
|
||||||
if f.currentFH.DetectReset(f.lastFH) {
|
}
|
||||||
|
if f.currentFH.DetectReset(prevFH) {
|
||||||
return histogram.CounterReset
|
return histogram.CounterReset
|
||||||
}
|
}
|
||||||
return histogram.NotCounterReset
|
return histogram.NotCounterReset
|
||||||
|
@ -146,14 +144,17 @@ func (f *histogramStatsIterator) getResetHint(h *histogram.Histogram) histogram.
|
||||||
if h.CounterResetHint != histogram.UnknownCounterReset {
|
if h.CounterResetHint != histogram.UnknownCounterReset {
|
||||||
return h.CounterResetHint
|
return h.CounterResetHint
|
||||||
}
|
}
|
||||||
|
var prevFH *histogram.FloatHistogram
|
||||||
if f.lastH == nil {
|
if f.lastH == nil {
|
||||||
// If there was no previous histogram, this will not be used,
|
if f.lastFH == nil {
|
||||||
// and if there was a previous float histogram, this will
|
// We don't know if there's a counter reset.
|
||||||
// force a reset detection.
|
|
||||||
return histogram.UnknownCounterReset
|
return histogram.UnknownCounterReset
|
||||||
}
|
}
|
||||||
|
prevFH = f.lastFH
|
||||||
fh, prevFH := h.ToFloat(nil), f.lastH.ToFloat(nil)
|
} else {
|
||||||
|
prevFH = f.lastH.ToFloat(nil)
|
||||||
|
}
|
||||||
|
fh := h.ToFloat(nil)
|
||||||
if fh.DetectReset(prevFH) {
|
if fh.DetectReset(prevFH) {
|
||||||
return histogram.CounterReset
|
return histogram.CounterReset
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,7 +156,7 @@ func TestHistogramStatsMixedUse(t *testing.T) {
|
||||||
expectedHints := []histogram.CounterResetHint{
|
expectedHints := []histogram.CounterResetHint{
|
||||||
histogram.UnknownCounterReset,
|
histogram.UnknownCounterReset,
|
||||||
histogram.NotCounterReset,
|
histogram.NotCounterReset,
|
||||||
histogram.UnknownCounterReset,
|
histogram.CounterReset,
|
||||||
}
|
}
|
||||||
actualHints := make([]histogram.CounterResetHint, 3)
|
actualHints := make([]histogram.CounterResetHint, 3)
|
||||||
typ := statsIterator.Next()
|
typ := statsIterator.Next()
|
||||||
|
|
Loading…
Reference in New Issue