tempodb

package
v1.2.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: AGPL-3.0 Imports: 34 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultFlushSizeBytes uint32 = 30 * 1024 * 1024 // 30 MiB

	DefaultIteratorBufferSize = 1000
)
View Source
const (
	DefaultBlocklistPoll            = 5 * time.Minute
	DefaultBlocklistPollConcurrency = uint(50)
	DefaultRetentionConcurrency     = uint(10)
	DefaultTenantIndexBuilders      = 2
)
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"
)

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"`
	IteratorBufferSize      int           `yaml:"iterator_buffer_size"`
}

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"`
	BlocklistPollFallback            bool          `yaml:"blocklist_poll_fallback"`
	BlocklistPollTenantIndexBuilders int           `yaml:"blocklist_poll_tenant_index_builders"`
	BlocklistPollStaleTenantIndex    time.Duration `yaml:"blocklist_poll_stale_tenant_index"`

	// 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"`
	CacheMinCompactionLevel uint8                          `yaml:"cache_min_compaction_level"`
	CacheMaxBlockAge        time.Duration                  `yaml:"cache_max_block_age"`
	BackgroundCache         *cortex_cache.BackgroundConfig `yaml:"background_cache"`
	Memcached               *memcached.Config              `yaml:"memcached"`
	Redis                   *redis.Config                  `yaml:"redis"`
}

Config holds the entirety of tempodb configuration Defaults are in modules/storage/config.go

type Reader

type Reader interface {
	Find(ctx context.Context, tenantID string, id common.ID, blockStart string, blockEnd string) ([][]byte, []string, []error, error)
	BlockMetas(tenantID string) []*backend.BlockMeta
	EnablePolling(sharder blocklist.JobSharder)

	Shutdown()
}

type WriteableBlock added in v0.5.0

type WriteableBlock interface {
	BlockMeta() *backend.BlockMeta
	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)
	CompleteSearchBlockWithBackend(block *search.StreamingSearchBlock, blockID uuid.UUID, tenantID string, r backend.Reader, w backend.Writer) (*search.BackendSearchBlock, error)
	WAL() *wal.WAL
}

Jump to

Keyboard shortcuts

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