frontend

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: AGPL-3.0 Imports: 40 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(log log.Logger) 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 added in v0.6.1

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

func (*Frontend) LabelNames added in v0.6.1

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

func (*Frontend) LabelValues added in v0.6.1

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

func (*Frontend) ProfileTypes added in v0.6.1

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 added in v0.6.1

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

func (*Frontend) SelectMergeStacktraces added in v0.6.1

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

func (*Frontend) SelectSeries added in v0.6.1

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

func (*Frontend) Series added in v0.6.1

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

type Limits added in v0.6.1

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

type TimeInterval added in v0.6.1

type TimeInterval struct{ Start, End time.Time }

type TimeIntervalIterator added in v0.6.1

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 added in v0.6.1

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 added in v0.6.1

func (*TimeIntervalIterator) Close added in v0.6.1

func (*TimeIntervalIterator) Close() error

func (*TimeIntervalIterator) Err added in v0.6.1

func (*TimeIntervalIterator) Err() error

func (*TimeIntervalIterator) Next added in v0.6.1

func (i *TimeIntervalIterator) Next() bool

type TimeIntervalIteratorOption added in v0.6.1

type TimeIntervalIteratorOption func(*TimeIntervalIterator)

func WithAlignment added in v0.6.1

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