Skip to content

promql(NHCB): histogram_stddev and histogram_stdvar should use arithmetic mean for NHCB #16439

@beorn7

Description

@beorn7

Currently, histogram_stddev and histogram_stdvar use the geometric mean of a bucket range as representative for the observations in that bucket. That makes sense for exponential buckets, but for NHCB, we should simply use the arithmetic mean (as we also use linear interpolation to estimate quantiles and fractions).

Example for the geometric mean in histogram_stddev:

val = math.Sqrt(bucket.Upper * bucket.Lower)

This should be an easy change. Just do the arithmetic mean instead for NHCBs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions