Skip to main content

Module index

Module index 

Source
Expand description

Prometheus TSDB index reader (format v1/v2/v3).

Two access patterns share this reader. A sequential export walks the series section in lexicographic label order, which is also the physical order of their chunks in the segment files; IndexReader::series does that without touching any label index. A lookup-driven consumer asks for one label pair instead; IndexReader::postings serves that from a sampled view of the postings offset table, so no full label index is ever held in memory.

Module layout:

ModuleResponsibility
toctable of contents: section offsets, bounds and ordering
symbolssymbol table (v1 inline refs, v2/v3 offset groups)
seriesseries records, chunk metadata, sequential iterator
postingspostings lists, label names/values, sorted unions
postings_opsintersection, union and difference over postings
label_indexthe LabelIndexReader trait over the label space
matcherlabel matchers and the postings plan they compile to
validationsection boundary and layout checks

Re-exports§

pub use label_index::LabelIndexReader;
pub use matcher::LabelMatcher;
pub use matcher::MatchType;
pub use postings::MergedPostings;
pub use postings::Postings;
pub use postings::PostingsList;
pub use postings::PostingsStats;
pub use postings::VecPostings;
pub use postings_ops::difference;
pub use postings_ops::intersect;
pub use postings_ops::intersect_all;
pub use postings_ops::union_all;
pub use postings_ops::BoxPostings;
pub use postings_ops::Difference;
pub use postings_ops::Intersection;
pub use postings_ops::Union;

Modules§

label_index
Label lookups behind a trait, so a query layer can treat any label space uniformly.
matcher
Label matchers and the postings plan they compile to.
postings
Postings lists and label lookups (index v1, v2 and v3).
postings_ops
Set operations over postings: intersection, union and difference.
validation
Structural validation of the index TOC and section boundaries.

Structs§

ChunkMeta
Where one chunk lives and which time range it covers.
IndexReader
Reader for the index of one block.
IndexStats
Series and chunk counts, plus the byte range they were read from.
SeriesIter
Iterator over the series section, in on-disk (label-sorted) order.
SeriesRef
One series: its label set and the chunks that hold its samples.
Toc
The index table of contents: absolute file offsets of every section.