Merge pull request #15849 from linasm/use-histogram-stats-decoder-for-histogram_avg

promql: use histogram stats decoder for histogram_avg
This commit is contained in:
Björn Rabenstein 2025-01-23 15:03:01 +01:00 committed by GitHub
commit 8846e42528
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3721,14 +3721,15 @@ func detectHistogramStatsDecoding(expr parser.Expr) {
if !ok {
continue
}
if call.Func.Name == "histogram_count" || call.Func.Name == "histogram_sum" {
switch call.Func.Name {
case "histogram_count", "histogram_sum", "histogram_avg":
n.SkipHistogramBuckets = true
break
}
if call.Func.Name == "histogram_quantile" || call.Func.Name == "histogram_fraction" {
case "histogram_quantile", "histogram_fraction":
n.SkipHistogramBuckets = false
break
default:
continue
}
break
}
return errors.New("stop")
})