frontend

package
v1.3.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// StatusClientClosedRequest is the status code for when a client request cancellation of an http request
	StatusClientClosedRequest = 499
)

Variables

This section is empty.

Functions

func NewRoundTripper

func NewRoundTripper(next http.RoundTripper, middlewares ...Middleware) http.RoundTripper

NewRoundTripper takes an ordered set of middlewares and builds a http.RoundTripper around them

Types

type Config

type Config struct {
	Config               frontend.CombinedFrontendConfig `yaml:",inline"`
	MaxRetries           int                             `yaml:"max_retries,omitempty"`
	QueryShards          int                             `yaml:"query_shards,omitempty"`
	TolerateFailedBlocks int                             `yaml:"tolerate_failed_blocks,omitempty"`
	Search               SearchSharderConfig             `yaml:"search"`
}

func (*Config) RegisterFlagsAndApplyDefaults

func (cfg *Config) RegisterFlagsAndApplyDefaults(prefix string, f *flag.FlagSet)

type CortexNoQuerierLimits added in v0.6.0

type CortexNoQuerierLimits struct{}

func (CortexNoQuerierLimits) MaxQueriersPerUser added in v0.6.0

func (CortexNoQuerierLimits) MaxQueriersPerUser(user string) int

type Middleware

type Middleware interface {
	Wrap(http.RoundTripper) http.RoundTripper
}

Middleware is used to build pipelines of http.Roundtrippers

func MergeMiddlewares

func MergeMiddlewares(middleware ...Middleware) Middleware

MergeMiddlewares takes a set of ordered middlewares and merges them into a pipeline

type MiddlewareFunc

type MiddlewareFunc func(http.RoundTripper) http.RoundTripper

MiddlewareFunc is like http.HandlerFunc, but for Middleware.

func (MiddlewareFunc) Wrap

Wrap implements Middleware.

type QueryFrontend added in v1.2.0

type QueryFrontend struct {
	TraceByID, Search http.Handler
	// contains filtered or unexported fields
}

func New added in v1.2.0

func New(cfg Config, next http.RoundTripper, store storage.Store, logger log.Logger, registerer prometheus.Registerer) (*QueryFrontend, error)

New returns a new QueryFrontend

type RoundTripperFunc added in v1.2.0

type RoundTripperFunc func(*http.Request) (*http.Response, error)

RoundTripperFunc is like http.HandlerFunc, but for RoundTripper

chosen for pipeline building over queryrange.Handler b/c of how similar queryrange.Handler is to this existing interface.

func (RoundTripperFunc) RoundTrip added in v1.2.0

func (fn RoundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implememnts http.RoundTripper

type SearchSharderConfig added in v1.3.0

type SearchSharderConfig struct {
	ConcurrentRequests    int           `yaml:"concurrent_jobs,omitempty"`
	TargetBytesPerRequest int           `yaml:"target_bytes_per_job,omitempty"`
	DefaultLimit          uint32        `yaml:"default_result_limit"`
	MaxLimit              uint32        `yaml:"max_result_limit"`
	MaxDuration           time.Duration `yaml:"max_duration"`
	QueryBackendAfter     time.Duration `yaml:"query_backend_after,omitempty"`
	QueryIngestersUntil   time.Duration `yaml:"query_ingesters_until,omitempty"`
}

Jump to

Keyboard shortcuts

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