prometheus/tsdb
Dieter Plaetinck cda025b5b5
TSDB: demistify SeriesRefs and ChunkRefs (#9536)
* TSDB: demistify seriesRefs and ChunkRefs

The TSDB package contains many types of series and chunk references,
all shrouded in uint types.  Often the same uint value may
actually mean one of different types, in non-obvious ways.

This PR aims to clarify the code and help navigating to relevant docs,
usage, etc much quicker.

Concretely:

* Use appropriately named types and document their semantics and
  relations.
* Make multiplexing and demuxing of types explicit
  (on the boundaries between concrete implementations and generic
  interfaces).
* Casting between different types should be free.  None of the changes
  should have any impact on how the code runs.

TODO: Implement BlockSeriesRef where appropriate (for a future PR)

Signed-off-by: Dieter Plaetinck <dieter@grafana.com>

* feedback

Signed-off-by: Dieter Plaetinck <dieter@grafana.com>

* agent: demistify seriesRefs and ChunkRefs

Signed-off-by: Dieter Plaetinck <dieter@grafana.com>
2021-11-06 15:40:04 +05:30
..
agent TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
chunkenc improve bstream comments and doc (#9560) 2021-10-25 18:44:15 +05:30
chunks TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
docs TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
encoding Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
errors Address golint failures from revive 2021-10-23 00:53:11 +02:00
fileutil Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
goversion Add new Go build tags. 2021-08-27 10:24:14 +02:00
index TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
record TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
test Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
testdata tsdb: Delete blocks atomically; Remove tmp blocks on start; Added test. (#7772) 2020-08-11 06:56:08 +01:00
tombstones TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
tsdbutil Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
wal TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
.gitignore Moving tsdb into its own subdirectory 2019-08-13 13:58:49 +05:30
block_test.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
block.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
blockwriter_test.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
blockwriter.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
CHANGELOG.md Rename default branch to main 2021-02-22 20:28:02 +01:00
compact_test.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
compact.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
db_test.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
db.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
exemplar_test.go Fix imports formatting 2021-11-02 19:52:34 +01:00
exemplar.go Fix imports formatting 2021-11-02 19:52:34 +01:00
head_append.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
head_bench_test.go React UI: Add Starting Screen (#8662) 2021-06-05 15:29:32 +01:00
head_read.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
head_test.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
head_wal.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
head.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
isolation_test.go tsdb: Block Head GC till pending readers are done reading (#9081) 2021-07-20 14:17:20 +05:30
isolation.go Add present_over_time (#9097) 2021-07-29 12:38:11 +02:00
mocks_test.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
querier_bench_test.go React UI: Add Starting Screen (#8662) 2021-06-05 15:29:32 +01:00
querier_test.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
querier.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
README.md improve bstream comments and doc (#9560) 2021-10-25 18:44:15 +05:30
repair_test.go Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
repair.go Switched to go-kit/log 2021-06-11 12:28:36 -04:00
tsdbblockutil.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
wal_test.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30
wal.go TSDB: demistify SeriesRefs and ChunkRefs (#9536) 2021-11-06 15:40:04 +05:30

TSDB

GoPkg

This directory contains the Prometheus storage layer that is used in its 2.x releases.

A writeup of its design can be found here.

Based on the Gorilla TSDB white papers.

Video: Storing 16 Bytes at Scale from PromCon 2017.

See also the format documentation and bstream details.

A series of blog posts explaining different components of TSDB: