frontend

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: AGPL-3.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SchedulerAddress  string            `yaml:"scheduler_address" doc:"hidden"`
	DNSLookupPeriod   time.Duration     `yaml:"scheduler_dns_lookup_period" category:"advanced" doc:"hidden"`
	WorkerConcurrency int               `yaml:"scheduler_worker_concurrency" category:"advanced"`
	GRPCClientConfig  grpcclient.Config `` /* 144-byte string literal not displayed */

	// Used to find local IP address, that is sent to scheduler and querier-worker.
	InfNames []string `yaml:"instance_interface_names" category:"advanced" doc:"default=[<private network interfaces>]"`

	// If set, address is not computed from interfaces.
	Addr string `yaml:"address" category:"advanced"`
	Port int    `yaml:"-"`

	// This configuration is injected internally.
	QuerySchedulerDiscovery schedulerdiscovery.Config `yaml:"-"`
	MaxLoopDuration         time.Duration             `yaml:"-"`
}

Config for a Frontend.

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet, logger log.Logger)

func (*Config) Validate

func (cfg *Config) Validate() error

type Frontend

type Frontend struct {
	services.Service

	frontendpb.UnimplementedFrontendForQuerierServer
	// contains filtered or unexported fields
}

Frontend implements GrpcRoundTripper. It queues HTTP requests, dispatches them to backends via gRPC, and handles retries for requests which failed.

func NewFrontend

func NewFrontend(cfg Config, limits Limits, log log.Logger, reg prometheus.Registerer) (*Frontend, error)

NewFrontend creates a new frontend.

func (*Frontend) CheckReady

func (f *Frontend) CheckReady(_ context.Context) error

CheckReady determines if the query frontend is ready. Function parameters/return chosen to match the same method in the ingester

func (*Frontend) RoundTripGRPC

func (f *Frontend) RoundTripGRPC(ctx context.Context, req *httpgrpc.HTTPRequest) (*httpgrpc.HTTPResponse, error)

RoundTripGRPC round trips a proto (instead of an HTTP request).

type Limits

type Limits interface {
	QuerySplitDuration(string) time.Duration
	MaxQueryParallelism(string) int
	MaxQueryLength(tenantID string) time.Duration
	MaxQueryLookback(tenantID string) time.Duration
	validation.FlameGraphLimits
}

type TimeInterval

type TimeInterval struct{ Start, End time.Time }

type TimeIntervalIterator

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

TimeIntervalIterator splits a time range into non-overlapping sub-ranges, where the boundary adjoining on the left is not included, e.g:

[t1, t2), [t3, t4), ..., [tn-1, tn].

By default, a sub-range start time is a multiple of the interval. See WithAlignment option, if a custom alignment is needed.

func NewTimeIntervalIterator

func NewTimeIntervalIterator(startTime, endTime time.Time, interval time.Duration,
	options ...TimeIntervalIteratorOption) *TimeIntervalIterator

NewTimeIntervalIterator returns a new interval iterator. If the interval is zero, the entire time span is taken as a single interval.

func (*TimeIntervalIterator) At

func (*TimeIntervalIterator) Close

func (*TimeIntervalIterator) Close() error

func (*TimeIntervalIterator) Err

func (*TimeIntervalIterator) Err() error

func (*TimeIntervalIterator) Next

func (i *TimeIntervalIterator) Next() bool

type TimeIntervalIteratorOption

type TimeIntervalIteratorOption func(*TimeIntervalIterator)

func WithAlignment

func WithAlignment(a time.Duration) TimeIntervalIteratorOption

WithAlignment causes a sub-range start time to be a multiple of the alignment. This makes it possible for a sub-range to be shorter than the interval specified, but not more than by the alignment.

The interval can't be less than the alignment.

Directories

Path Synopsis
dot
graph
Package graph collects a set of samples into a directed graph.
Package graph collects a set of samples into a directed graph.
measurement
Package measurement export utility functions to manipulate/format performance profile sample values.
Package measurement export utility functions to manipulate/format performance profile sample values.
report
Package report summarizes a performance profile into a human-readable report.
Package report summarizes a performance profile into a human-readable report.

Jump to

Keyboard shortcuts

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