frontend

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: AGPL-3.0 Imports: 41 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) Diff

func (f *Frontend) Diff(ctx context.Context,
	c *connect.Request[querierv1.DiffRequest]) (
	*connect.Response[querierv1.DiffResponse], error,
)

func (*Frontend) LabelNames

func (f *Frontend) LabelNames(ctx context.Context, c *connect.Request[typesv1.LabelNamesRequest]) (*connect.Response[typesv1.LabelNamesResponse], error)

func (*Frontend) LabelValues

func (f *Frontend) LabelValues(ctx context.Context, c *connect.Request[typesv1.LabelValuesRequest]) (*connect.Response[typesv1.LabelValuesResponse], error)

func (*Frontend) ProfileTypes

func (f *Frontend) ProfileTypes(ctx context.Context, c *connect.Request[querierv1.ProfileTypesRequest]) (*connect.Response[querierv1.ProfileTypesResponse], error)

func (*Frontend) QueryResult

func (f *Frontend) QueryResult(ctx context.Context, r *connect.Request[frontendpb.QueryResultRequest]) (*connect.Response[frontendpb.QueryResultResponse], error)

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).

func (*Frontend) SelectMergeProfile

func (f *Frontend) SelectMergeProfile(ctx context.Context, c *connect.Request[querierv1.SelectMergeProfileRequest]) (*connect.Response[profilev1.Profile], error)

func (*Frontend) SelectMergeStacktraces

func (f *Frontend) SelectMergeStacktraces(ctx context.Context,
	c *connect.Request[querierv1.SelectMergeStacktracesRequest]) (
	*connect.Response[querierv1.SelectMergeStacktracesResponse], error,
)

func (*Frontend) SelectSeries

func (f *Frontend) SelectSeries(ctx context.Context,
	c *connect.Request[querierv1.SelectSeriesRequest]) (
	*connect.Response[querierv1.SelectSeriesResponse], error,
)

func (*Frontend) Series

func (f *Frontend) Series(ctx context.Context, c *connect.Request[querierv1.SeriesRequest]) (*connect.Response[querierv1.SeriesResponse], error)

type Limits

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

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

Jump to

Keyboard shortcuts

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