prometheus/storage
George Krajcsovits 00ab05c3b9
Native histograms: fix spurios counter reset when merging recoded chunk to normal chunk (#14513)
* chunkenc: allow missing empty buckets on histogram append

Allow appending to chunks when the histogram to be added is missing
some buckets, but the missing buckets are empty in the chunk.
For example bucket at index 5 is present in the chunk, but its value
is 0 and the new histogram doesn't have a bucket at index 5.

This fixes an issue of merging chunks where one chunk was recoded to
retroactively have some empty buckets in all the histograms and we are
merging in a histogram that doesn't have the empty bucket (because it
was not recoded yet).

The operation alters the histogram that is being added, however this has
already been the case when appending gauge histograms. Thus the test
TestHistogramSeriesToChunks in storage package is changed to explicitly
test what happened to the appended histogram - Compact(0) call is removed.

The new expandIntSpansAndBuckets and expandFloatSpansAndBuckets functions
are a merge of expandSpansForward and counterResetInAnyBucket and
counterResetInAnyFloatBucket.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-08-01 09:22:32 +02:00
..
remote remote write: increase time threshold for resharding (#14450) 2024-07-30 14:08:28 -07:00
buffer.go storage: simplify sampleRing fix 2024-03-05 15:41:18 +01:00
buffer_test.go SampleRingIterator: add currType field 2024-03-01 14:59:19 +01:00
errors.go tsdb: add details to duplicate sample error (#13277) 2024-06-04 08:54:09 +01:00
fanout.go storage: skip merging when no remote storage configured 2024-01-18 17:50:06 +00:00
fanout_test.go Merge pull request #14109 from harry671003/pass_limit_to_querier 2024-07-12 10:27:52 +01:00
generic.go Add warnings (and annotations) to PromQL query results (#12152) 2023-09-14 18:57:31 +02:00
interface.go Pass limit param as hint to storage.Querier 2024-06-20 09:47:38 -07:00
lazy.go Add warnings (and annotations) to PromQL query results (#12152) 2023-09-14 18:57:31 +02:00
memoized_iterator.go storage: add AtT method to MemoizedSeriesIterator 2024-07-15 14:09:02 +10:00
memoized_iterator_test.go storage: add AtT method to MemoizedSeriesIterator 2024-07-15 14:09:02 +10:00
merge.go [ENHANCEMENT] Storage: Short-circuit merge of single querier with no-op queriers 2024-07-22 15:35:09 +01:00
merge_test.go lint 2024-07-22 16:34:42 +01:00
noop.go Pass limit param as hint to storage.Querier 2024-06-20 09:47:38 -07:00
secondary.go Pass limit param as hint to storage.Querier 2024-06-20 09:47:38 -07:00
series.go Fix language in docs and comments (#14041) 2024-05-08 17:57:09 +02:00
series_test.go Native histograms: fix spurios counter reset when merging recoded chunk to normal chunk (#14513) 2024-08-01 09:22:32 +02:00