ingester

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: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrReadOnly = errors.New("Ingester is shutting down")

ErrReadOnly is returned when the ingester is shutting down and a push was attempted.

View Source
var (
	ErrTraceMissing = errors.New("Trace missing")
)

Errors returned on Query.

Functions

This section is empty.

Types

type Config

type Config struct {
	LifecyclerConfig ring.LifecyclerConfig `yaml:"lifecycler,omitempty"`

	ConcurrentFlushes    int           `yaml:"concurrent_flushes"`
	FlushCheckPeriod     time.Duration `yaml:"flush_check_period"`
	FlushOpTimeout       time.Duration `yaml:"flush_op_timeout"`
	MaxTraceIdle         time.Duration `yaml:"trace_idle_period"`
	MaxBlockDuration     time.Duration `yaml:"max_block_duration"`
	MaxBlockBytes        uint64        `yaml:"max_block_bytes"`
	CompleteBlockTimeout time.Duration `yaml:"complete_block_timeout"`
	OverrideRingKey      string        `yaml:"override_ring_key"`
}

Config for an ingester.

func (*Config) RegisterFlagsAndApplyDefaults

func (cfg *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet)

RegisterFlagsAndApplyDefaults registers the flags.

type Ingester

type Ingester struct {
	services.Service
	// contains filtered or unexported fields
}

Ingester builds blocks out of incoming traces

func New

func New(cfg Config, store storage.Store, limits *overrides.Overrides) (*Ingester, error)

New makes a new Ingester.

func (*Ingester) CheckReady

func (i *Ingester) CheckReady(ctx context.Context) error

func (*Ingester) FindTraceByID

FindTraceByID implements tempopb.Querier.f

func (*Ingester) Flush

func (i *Ingester) Flush()

Flush triggers a flush of all in memory traces to disk. This is called by the lifecycler on shutdown and will put our traces in the WAL to be replayed.

func (*Ingester) FlushHandler

func (i *Ingester) FlushHandler(w http.ResponseWriter, _ *http.Request)

FlushHandler calls sweepAllInstances(true) which will force push all traces into the WAL and force

mark all head blocks as ready to flush.

func (*Ingester) Push

Push implements tempopb.Pusher.Push (super deprecated)

func (*Ingester) PushBytes added in v0.5.0

PushBytes implements tempopb.Pusher.PushBytes

func (*Ingester) ShutdownHandler added in v0.7.0

func (i *Ingester) ShutdownHandler(w http.ResponseWriter, _ *http.Request)

ShutdownHandler handles a graceful shutdown for an ingester. It does the following things in order * Stop incoming writes by exiting from the ring * Flush all blocks to backend

func (*Ingester) TransferOut

func (i *Ingester) TransferOut(ctx context.Context) error

TransferOut implements ring.Lifecycler.

type Limiter

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

Limiter implements primitives to get the maximum number of traces an ingester can handle for a specific tenant

func NewLimiter

func NewLimiter(limits *overrides.Overrides, ring RingCount, replicationFactor int) *Limiter

NewLimiter makes a new limiter

func (*Limiter) AssertMaxTracesPerUser

func (l *Limiter) AssertMaxTracesPerUser(userID string, traces int) error

AssertMaxTracesPerUser ensures limit has not been reached compared to the current number of streams in input and returns an error if so.

type RingCount

type RingCount interface {
	HealthyInstancesCount() int
}

RingCount is the interface exposed by a ring implementation which allows to count members

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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