Versions in this module Expand all Collapse all v2 v2.0.0 Jun 14, 2023 Changes in this version + const TenantLabel + var ChunkMetasPool = &index.ChunkMetasPool + var ChunkRefsPool PoolChunkRefs + var ErrAlreadyOnDesiredVersion = errors.New("tsdb file already on desired version") + var ErrEmptyAccumulator = errors.New("no items in result accumulator") + var SeriesPool PoolSeries + func NewIndexCompactor() compactor.IndexCompactor + func NewStore(name string, indexShipperCfg indexshipper.Config, ...) (index.ReaderWriter, func(), error) + func NewTSDBIndexFromFile(location string) (*TSDBIndex, GetRawFileReaderFunc, error) + func OpenShippableTSDB(p string) (index_shipper.Index, error) + func Overlap(a, b Bounded) bool + func PostingsForMatchers(ix IndexReader, shard *index.ShardAnnotation, ms ...*labels.Matcher) (index.Postings, error) + func RebuildWithVersion(ctx context.Context, path string, desiredVer int) (index_shipper.Index, error) + type Bounded interface + Bounds func() (model.Time, model.Time) + type Builder struct + func NewBuilder() *Builder + func (b *Builder) AddSeries(ls labels.Labels, fp model.Fingerprint, chks []index.ChunkMeta) + func (b *Builder) Build(ctx context.Context, scratchDir string, ...) (id Identifier, err error) + func (b *Builder) BuildWithVersion(ctx context.Context, version int, scratchDir string, ...) (id Identifier, err error) + func (b *Builder) DropChunk(streamID string, chk index.ChunkMeta) (bool, error) + func (b *Builder) FinalizeChunks() + func (b *Builder) InsertChunk(streamID string, chk index.ChunkMeta) error + type ChunkMetasRecord struct + Chks index.ChunkMetas + Ref uint64 + type ChunkRef struct + Checksum uint32 + End model.Time + Fingerprint model.Fingerprint + Start model.Time + User string + func (r ChunkRef) Less(x ChunkRef) bool + type GetRawFileReaderFunc func() (io.ReadSeeker, error) + type Head struct + func NewHead(tenant string, metrics *Metrics, logger log.Logger) *Head + func (h *Head) Append(ls labels.Labels, fprint uint64, chks index.ChunkMetas) (created bool, refID uint64) + func (h *Head) Index() IndexReader + func (h *Head) MaxTime() int64 + func (h *Head) MinTime() int64 + type HeadManager struct + func NewHeadManager(name string, logger log.Logger, dir string, metrics *Metrics, ...) *HeadManager + func (m *HeadManager) Append(userID string, ls labels.Labels, fprint uint64, chks index.ChunkMetas) error + func (m *HeadManager) Rotate(t time.Time) (err error) + func (m *HeadManager) Start() error + func (m *HeadManager) Stop() error + type Identifier interface + Name func() string + Path func() string + func NewPrefixedIdentifier(id Identifier, path, name string) Identifier + type Index interface + Close func() error + GetChunkRefs func(ctx context.Context, userID string, from, through model.Time, res []ChunkRef, ...) ([]ChunkRef, error) + LabelNames func(ctx context.Context, userID string, from, through model.Time, ...) ([]string, error) + LabelValues func(ctx context.Context, userID string, from, through model.Time, name string, ...) ([]string, error) + LabelVolume func(ctx context.Context, userID string, from, through model.Time, ...) error + Series func(ctx context.Context, userID string, from, through model.Time, res []Series, ...) ([]Series, error) + SetChunkFilterer func(chunkFilter chunk.RequestChunkFilterer) + Stats func(ctx context.Context, userID string, from, through model.Time, ...) error + type IndexClient struct + func NewIndexClient(idx Index, opts IndexClientOptions) *IndexClient + func (c *IndexClient) GetChunkRefs(ctx context.Context, userID string, from, through model.Time, ...) ([]logproto.ChunkRef, error) + func (c *IndexClient) GetSeries(ctx context.Context, userID string, from, through model.Time, ...) ([]labels.Labels, error) + func (c *IndexClient) LabelNamesForMetricName(ctx context.Context, userID string, from, through model.Time, _ string) ([]string, error) + func (c *IndexClient) LabelValuesForMetricName(ctx context.Context, userID string, from, through model.Time, _ string, ...) ([]string, error) + func (c *IndexClient) LabelVolume(ctx context.Context, userID string, from, through model.Time, limit int32, ...) (*logproto.LabelVolumeResponse, error) + func (c *IndexClient) SetChunkFilterer(chunkFilter chunk.RequestChunkFilterer) + func (c *IndexClient) Stats(ctx context.Context, userID string, from, through model.Time, ...) (*stats.Stats, error) + type IndexClientOptions struct + UseBloomFilters bool + func DefaultIndexClientOptions() IndexClientOptions + type IndexIter interface + For func(context.Context, func(context.Context, Index) error) error + type IndexReader interface + Bounds func() (int64, int64) + Checksum func() uint32 + ChunkStats func(ref storage.SeriesRef, from, through int64, lset *labels.Labels) (uint64, index.ChunkStats, error) + Close func() error + LabelNames func(matchers ...*labels.Matcher) ([]string, error) + LabelNamesFor func(ids ...storage.SeriesRef) ([]string, error) + LabelValueFor func(id storage.SeriesRef, label string) (string, error) + LabelValues func(name string, matchers ...*labels.Matcher) ([]string, error) + Postings func(name string, shard *index.ShardAnnotation, values ...string) (index.Postings, error) + Series func(ref storage.SeriesRef, from int64, through int64, lset *labels.Labels, ...) (uint64, error) + SortedLabelValues func(name string, matchers ...*labels.Matcher) ([]string, error) + Symbols func() index.StringIter + type IndexSlice []Index + func (xs IndexSlice) For(ctx context.Context, fn func(context.Context, Index) error) error + type IndexStatsAccumulator interface + AddChunkStats func(s index.ChunkStats) + AddStream func(fp model.Fingerprint) + Stats func() stats.Stats + type IndexWriter interface + Append func(userID string, ls labels.Labels, fprint uint64, chks tsdb_index.ChunkMetas) error + type LabelVolumeAccumulator interface + AddVolumes func(map[string]map[string]uint64) + Volumes func() *logproto.LabelVolumeResponse + type LazyIndex func() (Index, error) + func (f LazyIndex) Bounds() (model.Time, model.Time) + func (f LazyIndex) Close() error + func (f LazyIndex) GetChunkRefs(ctx context.Context, userID string, from, through model.Time, res []ChunkRef, ...) ([]ChunkRef, error) + func (f LazyIndex) LabelNames(ctx context.Context, userID string, from, through model.Time, ...) ([]string, error) + func (f LazyIndex) LabelValues(ctx context.Context, userID string, from, through model.Time, name string, ...) ([]string, error) + func (f LazyIndex) LabelVolume(ctx context.Context, userID string, from, through model.Time, ...) error + func (f LazyIndex) Series(ctx context.Context, userID string, from, through model.Time, res []Series, ...) ([]Series, error) + func (f LazyIndex) SetChunkFilterer(chunkFilter chunk.RequestChunkFilterer) + func (f LazyIndex) Stats(ctx context.Context, userID string, from, through model.Time, ...) error + type Metrics struct + func NewMetrics(r prometheus.Registerer) *Metrics + type MultiIndex struct + func NewMultiIndex(i IndexIter) *MultiIndex + func (i *MultiIndex) Bounds() (model.Time, model.Time) + func (i *MultiIndex) Close() error + func (i *MultiIndex) GetChunkRefs(ctx context.Context, userID string, from, through model.Time, res []ChunkRef, ...) ([]ChunkRef, error) + func (i *MultiIndex) LabelNames(ctx context.Context, userID string, from, through model.Time, ...) ([]string, error) + func (i *MultiIndex) LabelValues(ctx context.Context, userID string, from, through model.Time, name string, ...) ([]string, error) + func (i *MultiIndex) LabelVolume(ctx context.Context, userID string, from, through model.Time, ...) error + func (i *MultiIndex) Series(ctx context.Context, userID string, from, through model.Time, res []Series, ...) ([]Series, error) + func (i *MultiIndex) SetChunkFilterer(chunkFilter chunk.RequestChunkFilterer) + func (i *MultiIndex) Stats(ctx context.Context, userID string, from, through model.Time, ...) error + type MultiTenantIndex struct + func NewMultiTenantIndex(idx Index) *MultiTenantIndex + func (m *MultiTenantIndex) Bounds() (model.Time, model.Time) + func (m *MultiTenantIndex) Close() error + func (m *MultiTenantIndex) GetChunkRefs(ctx context.Context, userID string, from, through model.Time, res []ChunkRef, ...) ([]ChunkRef, error) + func (m *MultiTenantIndex) LabelNames(ctx context.Context, userID string, from, through model.Time, ...) ([]string, error) + func (m *MultiTenantIndex) LabelValues(ctx context.Context, userID string, from, through model.Time, name string, ...) ([]string, error) + func (m *MultiTenantIndex) LabelVolume(ctx context.Context, userID string, from, through model.Time, ...) error + func (m *MultiTenantIndex) Series(ctx context.Context, userID string, from, through model.Time, res []Series, ...) ([]Series, error) + func (m *MultiTenantIndex) SetChunkFilterer(chunkFilter chunk.RequestChunkFilterer) + func (m *MultiTenantIndex) Stats(ctx context.Context, userID string, from, through model.Time, ...) error + type MultitenantTSDBIdentifier struct + func (id MultitenantTSDBIdentifier) Name() string + func (id MultitenantTSDBIdentifier) Path() string + type NoopIndex struct + func (NoopIndex) Bounds() (_, through model.Time) + func (NoopIndex) Close() error + func (NoopIndex) GetChunkRefs(_ context.Context, _ string, _, _ model.Time, _ []ChunkRef, ...) ([]ChunkRef, error) + func (NoopIndex) LabelNames(_ context.Context, _ string, _, _ model.Time, _ ...*labels.Matcher) ([]string, error) + func (NoopIndex) LabelValues(_ context.Context, _ string, _, _ model.Time, _ string, _ ...*labels.Matcher) ([]string, error) + func (NoopIndex) LabelVolume(_ context.Context, _ string, _, _ model.Time, _ LabelVolumeAccumulator, ...) error + func (NoopIndex) Series(_ context.Context, _ string, _, _ model.Time, _ []Series, ...) ([]Series, error) + func (NoopIndex) SetChunkFilterer(_ chunk.RequestChunkFilterer) + func (NoopIndex) Stats(_ context.Context, _ string, _, _ model.Time, _ IndexStatsAccumulator, ...) error + type PoolChunkRefs struct + func (p *PoolChunkRefs) Get() []ChunkRef + func (p *PoolChunkRefs) Put(xs []ChunkRef) + type PoolSeries struct + func (p *PoolSeries) Get() []Series + func (p *PoolSeries) Put(xs []Series) + type RecordType byte + const WalRecordChunks + const WalRecordSeries + const WalRecordSeriesWithFingerprint + type Series struct + Fingerprint model.Fingerprint + Labels labels.Labels + type SingleTenantTSDBIdentifier struct + Checksum uint32 + From model.Time + TS time.Time + Through model.Time + func (i SingleTenantTSDBIdentifier) Name() string + func (i SingleTenantTSDBIdentifier) Path() string + type TSDBFile struct + func NewShippableTSDBFile(id Identifier) (*TSDBFile, error) + func (f *TSDBFile) Close() error + func (f *TSDBFile) Reader() (io.ReadSeeker, error) + type TSDBIndex struct + func NewTSDBIndex(reader IndexReader) *TSDBIndex + func (i *TSDBIndex) Bounds() (model.Time, model.Time) + func (i *TSDBIndex) Checksum() uint32 + func (i *TSDBIndex) Close() error + func (i *TSDBIndex) ForSeries(ctx context.Context, shard *index.ShardAnnotation, from model.Time, ...) error + func (i *TSDBIndex) GetChunkRefs(ctx context.Context, userID string, from, through model.Time, res []ChunkRef, ...) ([]ChunkRef, error) + func (i *TSDBIndex) Identifier(string) SingleTenantTSDBIdentifier + func (i *TSDBIndex) LabelNames(_ context.Context, _ string, _, _ model.Time, matchers ...*labels.Matcher) ([]string, error) + func (i *TSDBIndex) LabelValues(_ context.Context, _ string, _, _ model.Time, name string, ...) ([]string, error) + func (i *TSDBIndex) LabelVolume(ctx context.Context, _ string, from, through model.Time, ...) error + func (i *TSDBIndex) Series(ctx context.Context, _ string, from, through model.Time, res []Series, ...) ([]Series, error) + func (i *TSDBIndex) SetChunkFilterer(chunkFilter chunk.RequestChunkFilterer) + func (i *TSDBIndex) Stats(ctx context.Context, _ string, from, through model.Time, ...) error + type TSDBManager interface + BuildFromHead func(*tenantHeads) error + BuildFromWALs func(time.Time, []WALIdentifier, bool) error + Start func() error + func NewTSDBManager(name, nodeName, dir string, shipper indexshipper.IndexShipper, ...) TSDBManager + type WAL interface + Log func(*WALRecord) error + Start func(time.Time) error + Stop func() error + type WALIdentifier struct + func (w WALIdentifier) String() string + type WALRecord struct + Chks ChunkMetasRecord + Fingerprint uint64 + Series record.RefSeries + UserID string + type WalGroup struct