ingester

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: AGPL-3.0 Imports: 53 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, reg prometheus.Registerer) (*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) PushBytes added in v0.5.0

PushBytes implements tempopb.Pusher.PushBytes. Traces pushed to this endpoint are expected to be in the formats

defined by ./pkg/model/v1

This push function is extremely inefficient and is only provided as a migration path from the v1->v2 encodings

func (*Ingester) PushBytesV2 added in v1.4.0

func (i *Ingester) PushBytesV2(ctx context.Context, req *tempopb.PushBytesRequest) (*tempopb.PushResponse, error)

PushBytes implements tempopb.Pusher.PushBytes. Traces pushed to this endpoint are expected to be in the formats

defined by ./pkg/model/v2

func (*Ingester) SearchBlock added in v1.3.0

SearchBlock only exists here to fulfill the protobuf interface. The ingester will never support backend search

func (*Ingester) SearchRecent added in v1.3.0

func (i *Ingester) SearchRecent(ctx context.Context, req *tempopb.SearchRequest) (*tempopb.SearchResponse, error)

func (*Ingester) SearchTagValues added in v1.2.0

func (*Ingester) SearchTags added in v1.2.0

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