Documentation
¶
Index ¶
- func NewCacheConfig(logger log.Logger, confContentYaml []byte) (*cortexcache.Config, error)
- func NewThanosCodec(partialResponse bool) *codec
- func NewTripperware(config Config, reg prometheus.Registerer, logger log.Logger) (frontend.Tripperware, error)
- type CacheProviderConfig
- type Config
- type InMemoryResponseCacheConfig
- type MemcachedResponseCacheConfig
- type ResponseCacheProvider
- type ThanosRequest
- func (r *ThanosRequest) GetCachingOptions() queryrange.CachingOptions
- func (r *ThanosRequest) GetEnd() int64
- func (r *ThanosRequest) GetQuery() string
- func (r *ThanosRequest) GetStart() int64
- func (r *ThanosRequest) GetStep() int64
- func (r *ThanosRequest) LogToSpan(sp opentracing.Span)
- func (r *ThanosRequest) ProtoMessage()
- func (r *ThanosRequest) Reset()
- func (r *ThanosRequest) String() string
- func (r *ThanosRequest) WithQuery(query string) queryrange.Request
- func (r *ThanosRequest) WithStartEnd(start int64, end int64) queryrange.Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCacheConfig ¶ added in v0.16.0
NewCacheConfig is a parser that converts a Thanos cache config yaml into a cortex cache config struct.
func NewThanosCodec ¶
func NewThanosCodec(partialResponse bool) *codec
func NewTripperware ¶ added in v0.16.0
func NewTripperware( config Config, reg prometheus.Registerer, logger log.Logger, ) (frontend.Tripperware, error)
NewTripperware returns a Tripperware configured with middlewares to limit, align, split,cache requests and retry. Not using the cortex one as it uses query parallelisations based on storage sharding configuration and query ASTs.
Types ¶
type CacheProviderConfig ¶ added in v0.16.0
type CacheProviderConfig struct {
Type ResponseCacheProvider `yaml:"type"`
Config interface{} `yaml:"config"`
}
CacheProviderConfig is the initial CacheProviderConfig struct holder before parsing it into a specific cache provider. Based on the config type the config is then parsed into a specific cache provider.
type Config ¶ added in v0.16.0
type Config struct {
// PartialResponseStrategy is the default strategy used
// when parsing thanos query request.
PartialResponseStrategy bool
CortexFrontendConfig *cortexfrontend.Config
CortexLimits *cortexvalidation.Limits
CortexResultsCacheConfig *queryrange.ResultsCacheConfig
CachePathOrContent extflag.PathOrContent
CacheCompression string
RequestLoggingDecision string
SplitQueriesByInterval time.Duration
MaxRetries int
}
Config holds the query frontend configs.
type InMemoryResponseCacheConfig ¶ added in v0.16.0
type InMemoryResponseCacheConfig struct {
// MaxSize represents overall maximum number of bytes cache can contain.
MaxSize string `yaml:"max_size"`
// MaxSizeItems represents the maximum number of entries in the cache.
MaxSizeItems int `yaml:"max_size_items"`
// Validity represents the expiry duration for the cache.
Validity time.Duration `yaml:"validity"`
}
InMemoryResponseCacheConfig holds the configs for the in-memory cache provider.
type MemcachedResponseCacheConfig ¶ added in v0.16.0
type MemcachedResponseCacheConfig struct {
Memcached cacheutil.MemcachedClientConfig `yaml:",inline"`
// Expiration sets a global expiration limit for all cached items.
Expiration time.Duration `yaml:"expiration"`
}
MemcachedResponseCacheConfig holds the configs for the memcache cache provider.
type ResponseCacheProvider ¶ added in v0.16.0
type ResponseCacheProvider string
const ( INMEMORY ResponseCacheProvider = "IN-MEMORY" MEMCACHED ResponseCacheProvider = "MEMCACHED" )
type ThanosRequest ¶
type ThanosRequest struct {
Path string
Start int64
End int64
Step int64
Timeout time.Duration
Query string
Dedup bool
PartialResponse bool
AutoDownsampling bool
MaxSourceResolution int64
ReplicaLabels []string
StoreMatchers [][]*labels.Matcher
CachingOptions queryrange.CachingOptions
}
func (*ThanosRequest) GetCachingOptions ¶ added in v0.16.0
func (r *ThanosRequest) GetCachingOptions() queryrange.CachingOptions
func (*ThanosRequest) GetEnd ¶
func (r *ThanosRequest) GetEnd() int64
GetEnd returns the end timestamp of the request in milliseconds.
func (*ThanosRequest) GetQuery ¶
func (r *ThanosRequest) GetQuery() string
GetQuery returns the query of the request.
func (*ThanosRequest) GetStart ¶
func (r *ThanosRequest) GetStart() int64
GetStart returns the start timestamp of the request in milliseconds.
func (*ThanosRequest) GetStep ¶
func (r *ThanosRequest) GetStep() int64
GetStep returns the step of the request in milliseconds.
func (*ThanosRequest) LogToSpan ¶
func (r *ThanosRequest) LogToSpan(sp opentracing.Span)
LogToSpan writes information about this request to an OpenTracing span.
func (*ThanosRequest) ProtoMessage ¶
func (r *ThanosRequest) ProtoMessage()
ProtoMessage implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosRequest) Reset ¶
func (r *ThanosRequest) Reset()
Reset implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosRequest) String ¶
func (r *ThanosRequest) String() string
String implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosRequest) WithQuery ¶
func (r *ThanosRequest) WithQuery(query string) queryrange.Request
WithQuery clone the current request with a different query.
func (*ThanosRequest) WithStartEnd ¶
func (r *ThanosRequest) WithStartEnd(start int64, end int64) queryrange.Request
WithStartEnd clone the current request with different start and end timestamp.