Help us shape the future of Go! Take the 2026 Go Developer Survey

tsdb

package
v2.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotReady = errors.New("TSDB not ready")

ErrNotReady is returned if the underlying storage is not ready yet.

Functions

func Adapter

func Adapter(db *tsdb.DB, startTimeMargin int64) storage.Storage

Adapter return an adapter as storage.Storage.

func Open

func Open(path string, l log.Logger, r prometheus.Registerer, opts *Options) (*tsdb.DB, error)

Open returns a new storage backed by a TSDB database that is configured for Prometheus.

Types

type Options

type Options struct {
	// The timestamp range of head blocks after which they get persisted.
	// It's the minimum duration of any persisted block.
	MinBlockDuration model.Duration

	// The maximum timestamp range of compacted blocks.
	MaxBlockDuration model.Duration

	// The maximum size of each WAL segment file.
	WALSegmentSize units.Base2Bytes

	// Duration for how long to retain data.
	RetentionDuration model.Duration

	// Maximum number of bytes to be retained.
	MaxBytes units.Base2Bytes

	// Disable creation and consideration of lockfile.
	NoLockfile bool

	// When true it disables the overlapping blocks check.
	// This in-turn enables vertical compaction and vertical query merge.
	AllowOverlappingBlocks bool

	// When true records in the WAL will be compressed.
	WALCompression bool
}

Options of the DB storage.

type ReadyStorage

type ReadyStorage struct {
	// contains filtered or unexported fields
}

ReadyStorage implements the Storage interface while allowing to set the actual storage at a later point in time.

func (*ReadyStorage) Appender

func (s *ReadyStorage) Appender() (storage.Appender, error)

Appender implements the Storage interface.

func (*ReadyStorage) Close

func (s *ReadyStorage) Close() error

Close implements the Storage interface.

func (*ReadyStorage) Get

func (s *ReadyStorage) Get() *tsdb.DB

Get the storage.

func (*ReadyStorage) Querier

func (s *ReadyStorage) Querier(ctx context.Context, mint, maxt int64) (storage.Querier, error)

Querier implements the Storage interface.

func (*ReadyStorage) Set

func (s *ReadyStorage) Set(db *tsdb.DB, startTimeMargin int64)

Set the storage.

func (*ReadyStorage) StartTime

func (s *ReadyStorage) StartTime() (int64, error)

StartTime implements the Storage interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL