frontend

package
v1.2.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: AGPL-3.0 Imports: 41 Imported by: 1

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"`
}

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, BackendSearch 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

Jump to

Keyboard shortcuts

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