prometheus/tsdb
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
..
agent [PRW 2.0] Merging `remote-write-2.0` feature branch to main (PRW 2.0 support + metadata in WAL) (#14395) 2024-07-04 14:29:20 -07:00
chunkenc Native histograms: fix spurios counter reset when merging recoded chunk to normal chunk (#14513) 2024-08-01 09:22:32 +02:00
chunks TSDB: Simplify OOO Select by copying the head chunk (#14396) 2024-07-03 15:08:07 +01:00
docs Fix language in docs and comments (#14041) 2024-05-08 17:57:09 +02:00
encoding tsdb/encoding: use Go standard errors package 2023-11-11 19:01:11 +01:00
errors Enable default revive rules (#13068) 2023-11-29 17:23:34 +00:00
fileutil tests: remove err from message when testify prints it already 2024-02-01 14:18:01 +00:00
goversion remove obsolete build tag 2024-01-17 22:26:32 +08:00
index Replace `ListPostings.Seek`'s binary search call by the generic `slices.BinarySearch` (#14393) 2024-07-02 14:51:05 +01:00
record Fix a couple of comments 2024-07-05 15:25:42 +02:00
testdata
tombstones Update tombstones.go 2023-11-11 19:22:06 +01:00
tsdbutil Ignore stale histograms for counter reset detection 2024-07-26 10:08:31 +02:00
wlog Merge branch 'release-2.53' into merge-2.53.1 2024-07-10 11:17:53 +01:00
.gitignore
CHANGELOG.md
README.md
block.go tsdb: Extend compactor interface to allow compactions to create multiple output blocks (#14143) 2024-06-12 17:31:25 -04:00
block_test.go tsdb: Extend compactor interface to allow compactions to create multiple output blocks (#14143) 2024-06-12 17:31:25 -04:00
blockwriter.go tsdb: Extend compactor interface to allow compactions to create multiple output blocks (#14143) 2024-06-12 17:31:25 -04:00
blockwriter_test.go Add a chunk size limit in bytes (#12054) 2023-08-24 15:21:17 +02:00
compact.go TSDB: Change block populator to accept postings index function (#14213) 2024-06-25 09:21:48 +01:00
compact_test.go TSDB: Change block populator to accept postings index function (#14213) 2024-06-25 09:21:48 +01:00
db.go TSDB: rebuild labels symbol-table on each compaction 2024-07-05 10:19:07 +01:00
db_test.go feat: add Google cloud roundtripper for remote write (#14346) 2024-07-30 16:25:19 +01:00
example_test.go Add context argument to Querier.Select (#12660) 2023-09-12 12:37:38 +02:00
exemplar.go [ENHANCEMENT] TSDB: Save map lookup on validation 2024-05-30 09:17:11 +01:00
exemplar_test.go [Test] TSDB: BenchmarkResizeExemplar multiple per series 2024-05-30 09:17:11 +01:00
head.go Revert the option regardless of error 2024-07-30 11:31:31 +02:00
head_append.go Merge pull request #14438 from prometheus/cedwards/ooo-chunk-encoding 2024-07-16 11:12:23 -07:00
head_bench_test.go tsdb: use Go standard errors 2023-12-11 12:18:54 +00:00
head_dedupelabels.go tsdb: reset symbol table for exemplars periodically 2024-07-05 10:19:07 +01:00
head_other.go TSDB: rebuild labels symbol-table on each compaction 2024-07-05 10:19:07 +01:00
head_read.go Store mmMaxTime in same field as seriesShard 2024-07-30 10:20:29 +02:00
head_read_test.go TSDB: Simplify OOO Select by copying the head chunk (#14396) 2024-07-03 15:08:07 +01:00
head_test.go Add BenchmarkLoadRealWLs 2024-07-30 10:19:56 +02:00
head_wal.go Store mmMaxTime in same field as seriesShard 2024-07-30 10:20:29 +02:00
isolation.go tsdb: create isolation transaction slice on demand 2023-10-21 13:45:47 +00:00
isolation_test.go
mocks_test.go tsdb: use Go standard errors 2023-12-11 12:18:54 +00:00
ooo_head.go Fix linting 2024-07-16 10:53:23 -07:00
ooo_head_read.go Merge pull request #14438 from prometheus/cedwards/ooo-chunk-encoding 2024-07-16 11:12:23 -07:00
ooo_head_read_test.go Fix test 2024-07-03 09:28:38 -07:00
ooo_head_test.go ci(lint): enable godot; append dot at the end of comments 2023-10-31 19:53:38 +02:00
ooo_isolation.go Fix issue where queries can fail or omit OOO samples if OOO head compaction occurs between creating a querier and reading chunks (#13115) 2023-11-24 12:38:38 +01:00
ooo_isolation_test.go Fix issue where queries can fail or omit OOO samples if OOO head compaction occurs between creating a querier and reading chunks (#13115) 2023-11-24 12:38:38 +01:00
querier.go Pass limit param as hint to storage.Querier 2024-06-20 09:47:38 -07:00
querier_bench_test.go Optimize label values with matchers by taking shortcuts (#13426) 2024-01-23 11:40:21 +01:00
querier_test.go Pass limit param as hint to storage.Querier 2024-06-20 09:47:38 -07:00
repair.go tsdb: use Go standard errors 2023-12-11 12:18:54 +00:00
repair_test.go tsdb tests: use go-cmp instead of DeepEquals 2024-02-08 19:32:33 +00:00
testutil.go Testutil refactoring 2024-07-03 09:28:38 -07:00
tsdbblockutil.go Optimize histogram iterators (#13340) 2024-01-23 17:02:14 +01:00

README.md

TSDB

GoPkg

This directory contains the Prometheus TSDB (Time Series DataBase) library, which handles storage and querying of all Prometheus v2 data.

Documentation

External resources

A series of blog posts explaining different components of TSDB: