mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Merge pull request #14454 from fpetkovski/fix-binop-hist-stats
Fix decoding buckets for native histograms in binops
This commit is contained in:
commit
b1c106a9ce
|
@ -3450,6 +3450,12 @@ func setOffsetForAtModifier(evalTime int64, expr parser.Expr) {
|
||||||
// required for correctness.
|
// required for correctness.
|
||||||
func detectHistogramStatsDecoding(expr parser.Expr) {
|
func detectHistogramStatsDecoding(expr parser.Expr) {
|
||||||
parser.Inspect(expr, func(node parser.Node, path []parser.Node) error {
|
parser.Inspect(expr, func(node parser.Node, path []parser.Node) error {
|
||||||
|
if n, ok := node.(*parser.BinaryExpr); ok {
|
||||||
|
detectHistogramStatsDecoding(n.LHS)
|
||||||
|
detectHistogramStatsDecoding(n.RHS)
|
||||||
|
return fmt.Errorf("stop")
|
||||||
|
}
|
||||||
|
|
||||||
n, ok := (node).(*parser.VectorSelector)
|
n, ok := (node).(*parser.VectorSelector)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -715,6 +715,9 @@ eval instant at 10m histogram_fraction(NaN, NaN, histogram_fraction_4)
|
||||||
eval instant at 10m histogram_fraction(-Inf, +Inf, histogram_fraction_4)
|
eval instant at 10m histogram_fraction(-Inf, +Inf, histogram_fraction_4)
|
||||||
{} 1
|
{} 1
|
||||||
|
|
||||||
|
eval instant at 10m histogram_sum(scalar(histogram_fraction(-Inf, +Inf, sum(histogram_fraction_4))) * histogram_fraction_4)
|
||||||
|
{} 100
|
||||||
|
|
||||||
clear
|
clear
|
||||||
|
|
||||||
# Counter reset only noticeable in a single bucket.
|
# Counter reset only noticeable in a single bucket.
|
||||||
|
|
Loading…
Reference in a new issue