scheduler

package
v2.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SafeReadRing

func SafeReadRing(s *Scheduler) ring.ReadRing

SafeReadRing does a nil check on the Scheduler before attempting to return it's ring this is necessary as many callers of this function will only have a valid Scheduler reference if the QueryScheduler target has been specified, which is not guaranteed

Types

type Config

type Config struct {
	MaxOutstandingPerTenant int               `yaml:"max_outstanding_requests_per_tenant"`
	QuerierForgetDelay      time.Duration     `yaml:"-"`
	GRPCClientConfig        grpcclient.Config `yaml:"grpc_client_config" doc:"description=This configures the gRPC client used to report errors back to the query-frontend."`
	// Schedulers ring
	UseSchedulerRing bool                `yaml:"use_scheduler_ring"`
	SchedulerRing    lokiutil.RingConfig `yaml:"scheduler_ring,omitempty"`
}

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

type Limits

type Limits interface {
	// MaxQueriersPerUser returns max queriers to use per tenant, or 0 if shuffle sharding is disabled.
	MaxQueriersPerUser(user string) int
}

Limits needed for the Query Scheduler - interface used for decoupling.

type Scheduler

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

Scheduler is responsible for queueing and dispatching queries to Queriers.

func NewScheduler

func NewScheduler(cfg Config, limits Limits, log log.Logger, registerer prometheus.Registerer) (*Scheduler, error)

NewScheduler creates a new Scheduler.

func (*Scheduler) FrontendLoop

FrontendLoop handles connection from frontend.

func (*Scheduler) OnRingInstanceHeartbeat

func (s *Scheduler) OnRingInstanceHeartbeat(_ *ring.BasicLifecycler, _ *ring.Desc, _ *ring.InstanceDesc)

func (*Scheduler) OnRingInstanceRegister

func (s *Scheduler) OnRingInstanceRegister(_ *ring.BasicLifecycler, ringDesc ring.Desc, instanceExists bool, instanceID string, instanceDesc ring.InstanceDesc) (ring.InstanceState, ring.Tokens)

func (*Scheduler) OnRingInstanceStopping

func (s *Scheduler) OnRingInstanceStopping(_ *ring.BasicLifecycler)

func (*Scheduler) OnRingInstanceTokens

func (s *Scheduler) OnRingInstanceTokens(_ *ring.BasicLifecycler, _ ring.Tokens)

func (*Scheduler) QuerierLoop

QuerierLoop is started by querier to receive queries from scheduler.

func (*Scheduler) ServeHTTP

func (s *Scheduler) ServeHTTP(w http.ResponseWriter, req *http.Request)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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