Documentation
¶
Index ¶
- Constants
- func InitFrontend(cfg v1.Config, limits v1.Limits, log log.Logger, reg prometheus.Registerer) (http.RoundTripper, *v1.Frontend, error)
- func NewDownstreamRoundTripper(downstreamURL string, transport http.RoundTripper) (http.RoundTripper, error)
- func NewRoundTripper(next http.RoundTripper, middlewares ...Middleware) http.RoundTripper
- type Config
- type CortexNoQuerierLimits
- type HedgingConfig
- type Middleware
- type MiddlewareFunc
- type QueryFrontend
- type RoundTripperFunc
- type SLOConfig
- type SearchConfig
- type SearchSharderConfig
- type SnapshotByIDConfig
Constants ¶
const ( // StatusClientClosedRequest is the status code for when a client request cancellation of an http request StatusClientClosedRequest = 499 // nil response in ServeHTTP NilResponseError = "nil resp in ServeHTTP" )
Variables ¶
This section is empty.
Functions ¶
func InitFrontend ¶
func InitFrontend(cfg v1.Config, limits v1.Limits, log log.Logger, reg prometheus.Registerer) (http.RoundTripper, *v1.Frontend, error)
InitFrontend initializes V1 frontend
Returned RoundTripper can be wrapped in more round-tripper middlewares, and then eventually registered into HTTP server using the Handler from this package. Returned RoundTripper is always non-nil (if there are no errors), and it uses the returned frontend (if any).
func NewDownstreamRoundTripper ¶
func NewDownstreamRoundTripper(downstreamURL string, transport http.RoundTripper) (http.RoundTripper, error)
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 v1.Config `yaml:",inline"` MaxRetries int `yaml:"max_retries,omitempty"` TolerateFailedBlocks int `yaml:"tolerate_failed_blocks,omitempty"` Search SearchConfig `yaml:"search"` SnapshotByID SnapshotByIDConfig `yaml:"snapshot_by_id"` }
type CortexNoQuerierLimits ¶
type CortexNoQuerierLimits struct{}
func (CortexNoQuerierLimits) MaxQueriersPerUser ¶
func (CortexNoQuerierLimits) MaxQueriersPerUser(string) int
type HedgingConfig ¶
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 ¶
func (q MiddlewareFunc) Wrap(h http.RoundTripper) http.RoundTripper
Wrap implements Middleware.
type QueryFrontend ¶
type QueryFrontend struct {
SnapshotByID, Search http.Handler
LoadTracepointHandler http.Handler
DelTracepointHandler http.Handler
// contains filtered or unexported fields
}
func New ¶
func New(cfg Config, next http.RoundTripper, o *overrides.Overrides, store storage.Store, logger log.Logger, registerer prometheus.Registerer) (*QueryFrontend, error)
New returns a new QueryFrontend
type RoundTripperFunc ¶
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.
type SearchConfig ¶
type SearchConfig struct { Sharder SearchSharderConfig `yaml:",inline"` SLO SLOConfig `yaml:",inline"` }
type SearchSharderConfig ¶
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"` }
type SnapshotByIDConfig ¶
type SnapshotByIDConfig struct { QueryShards int `yaml:"query_shards,omitempty"` Hedging HedgingConfig `yaml:",inline"` SLO SLOConfig `yaml:",inline"` }