prometheus/tsdb/tsdbutil
beorn7 aa82fe198f tsdb: Fix histogram validation
So far, `ValidateHistogram` would not detect if the count did not
include the count in the zero bucket. This commit fixes the problem
and updates all the tests that have been undetected offenders so far.

Note that this problem would only ever create false negatives, so we
never falsely rejected to store a histogram because of it.

On the other hand, `ValidateFloatHistogram` has been to strict with
the count being at least as large as the sum of the counts in all the
buckets. Float precision issues could create false positives here, see
products of PromQL evaluations, it's actually quite hard to put an
upper limit no the floating point imprecision. Users could produce the
weirdest expressions, maxing out float precision problems. Therefore,
this commit simply removes that particular check from
`ValidateFloatHistogram`.

Signed-off-by: beorn7 <beorn@grafana.com>
2023-08-22 23:04:01 +02:00
..
chunks.go Hide histogram chunk append and reset header internals (#12352) 2023-07-26 15:08:16 +02:00
dir_locker.go Share TSDB locker code with agent (#9623) 2021-11-11 11:45:25 -05:00
dir_locker_test.go Share TSDB locker code with agent (#9623) 2021-11-11 11:45:25 -05:00
dir_locker_testutil.go refactor: move from io/ioutil to io and os packages (#10528) 2022-04-27 11:24:36 +02:00
histogram.go tsdb: Fix histogram validation 2023-08-22 23:04:01 +02:00