Documentation ¶
Index ¶
- Constants
- func InitFrontend(cfg CombinedFrontendConfig, limits v1.Limits, grpcListenPort int, ...) (http.RoundTripper, *v1.Frontend, *v2.Frontend, error)
- func NewDownstreamRoundTripper(downstreamURL string, transport http.RoundTripper) (http.RoundTripper, error)
- func NewRoundTripper(next http.RoundTripper, middlewares ...Middleware) http.RoundTripper
- type CombinedFrontendConfig
- type Config
- type CortexNoQuerierLimits
- type Middleware
- type MiddlewareFunc
- type QueryFrontend
- type RoundTripperFunc
- type SearchConfig
- type SearchSharderConfig
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 ¶ added in v1.4.0
func InitFrontend(cfg CombinedFrontendConfig, limits v1.Limits, grpcListenPort int, log log.Logger, reg prometheus.Registerer) (http.RoundTripper, *v1.Frontend, *v2.Frontend, error)
InitFrontend initializes frontend (either V1 -- without scheduler, or V2 -- with scheduler) or no frontend at all if downstream Prometheus URL is used instead.
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 ¶ added in v1.4.0
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 CombinedFrontendConfig ¶ added in v1.4.0
type CombinedFrontendConfig struct { Handler transport.HandlerConfig `yaml:",inline"` FrontendV1 v1.Config `yaml:",inline"` FrontendV2 v2.Config `yaml:",inline"` DownstreamURL string `yaml:"downstream_url"` }
This struct combines several configuration options together to preserve backwards compatibility.
func (*CombinedFrontendConfig) RegisterFlags ¶ added in v1.4.0
func (cfg *CombinedFrontendConfig) RegisterFlags(f *flag.FlagSet)
type Config ¶
type Config struct { Config CombinedFrontendConfig `yaml:",inline"` MaxRetries int `yaml:"max_retries,omitempty"` QueryShards int `yaml:"query_shards,omitempty"` TolerateFailedBlocks int `yaml:"tolerate_failed_blocks,omitempty"` Search SearchConfig `yaml:"search"` }
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 ¶
func (q MiddlewareFunc) Wrap(h http.RoundTripper) http.RoundTripper
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
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 ¶ added in v1.4.0
type SearchConfig struct {
Sharder SearchSharderConfig `yaml:",inline"` // jpe - what did this look like before
}
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"` }