tempodb

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: AGPL-3.0 Imports: 33 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// BlockIDMin is the minimum possible value for a block id as a string
	BlockIDMin = "00000000-0000-0000-0000-000000000000"
	// BlockIDMax is the maximum possible value for a block id as a string
	BlockIDMax = "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF"
)
View Source
const DefaultBlocklistPollConcurrency = uint(50)
View Source
const (
	DefaultFlushSizeBytes uint32 = 30 * 1024 * 1024 // 30 MiB
)
View Source
const DefaultRetentionConcurrency = uint(10)

Variables

This section is empty.

Functions

func New

func New(cfg *Config, logger log.Logger) (Reader, Writer, Compactor, error)

New creates a new tempodb

Types

type CompactionBlockSelector

type CompactionBlockSelector interface {
	BlocksToCompact() ([]*backend.BlockMeta, string)
}

CompactionBlockSelector is an interface for different algorithms to pick suitable blocks for compaction

type Compactor

type Compactor interface {
	EnableCompaction(cfg *CompactorConfig, sharder CompactorSharder, overrides CompactorOverrides)
}

type CompactorConfig

type CompactorConfig struct {
	ChunkSizeBytes          uint32        `yaml:"chunk_size_bytes"` // todo: do we need this?
	FlushSizeBytes          uint32        `yaml:"flush_size_bytes"`
	MaxCompactionRange      time.Duration `yaml:"compaction_window"`
	MaxCompactionObjects    int           `yaml:"max_compaction_objects"`
	MaxBlockBytes           uint64        `yaml:"max_block_bytes"`
	BlockRetention          time.Duration `yaml:"block_retention"`
	CompactedBlockRetention time.Duration `yaml:"compacted_block_retention"`
	RetentionConcurrency    uint          `yaml:"retention_concurrency"`
}

CompactorConfig contains compaction configuration options

type CompactorOverrides added in v0.6.0

type CompactorOverrides interface {
	BlockRetentionForTenant(tenantID string) time.Duration
}

type CompactorSharder

type CompactorSharder interface {
	common.ObjectCombiner
	Owns(hash string) bool
}

type Config

type Config struct {
	Pool  *pool.Config          `yaml:"pool,omitempty"`
	WAL   *wal.Config           `yaml:"wal"`
	Block *encoding.BlockConfig `yaml:"block"`

	BlocklistPoll            time.Duration `yaml:"blocklist_poll"`
	BlocklistPollConcurrency uint          `yaml:"blocklist_poll_concurrency"`

	// backends
	Backend string        `yaml:"backend"`
	Local   *local.Config `yaml:"local"`
	GCS     *gcs.Config   `yaml:"gcs"`
	S3      *s3.Config    `yaml:"s3"`
	Azure   *azure.Config `yaml:"azure"`

	// caches
	Cache           string                         `yaml:"cache"`
	BackgroundCache *cortex_cache.BackgroundConfig `yaml:"background_cache"`
	Memcached       *memcached.Config              `yaml:"memcached"`
	Redis           *redis.Config                  `yaml:"redis"`
}

Config holds the entirety of tempodb configuration

type Reader

type Reader interface {
	Find(ctx context.Context, tenantID string, id common.ID, blockStart string, blockEnd string) ([][]byte, []string, error)
	Shutdown()
}

type WriteableBlock added in v0.5.0

type WriteableBlock interface {
	Write(ctx context.Context, w backend.Writer) error
}

type Writer

type Writer interface {
	WriteBlock(ctx context.Context, block WriteableBlock) error
	CompleteBlock(block *wal.AppendBlock, combiner common.ObjectCombiner) (*encoding.BackendBlock, error)
	CompleteBlockWithBackend(ctx context.Context, block *wal.AppendBlock, combiner common.ObjectCombiner, r backend.Reader, w backend.Writer) (*encoding.BackendBlock, error)
	WAL() *wal.WAL
}

Directories

Path Synopsis
gcs
s3
v0
v1
v2

Jump to

Keyboard shortcuts

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