Documentation
¶
Index ¶
- Variables
- func DownsampledMiddleware(merger queryrange.Merger, registerer prometheus.Registerer) queryrange.Middleware
- func NewCacheConfig(logger log.Logger, confContentYaml []byte) (*cortexcache.Config, error)
- func NewThanosLabelsCodec(partialResponse bool, defaultMetadataTimeRange time.Duration) *labelsCodec
- func NewThanosQueryInstantCodec(partialResponse bool) *queryInstantCodec
- func NewThanosQueryRangeCodec(partialResponse bool) *queryRangeCodec
- func NewTripperware(config Config, reg prometheus.Registerer, logger log.Logger) (queryrange.Tripperware, error)
- func PromQLShardingMiddleware(queryAnalyzer querysharding.Analyzer, numShards int, limits queryrange.Limits, ...) queryrange.Middleware
- func SplitByIntervalMiddleware(interval queryrange.IntervalFn, limits queryrange.Limits, ...) queryrange.Middleware
- type CacheProviderConfig
- type Config
- type DownstreamTripperConfig
- type InMemoryResponseCacheConfig
- type LabelsConfig
- type MemcachedResponseCacheConfig
- type QueryRangeConfig
- type RedisResponseCacheConfig
- type RequestHeader
- type ResponseCacheProvider
- type ResponseHeader
- func (*ResponseHeader) Descriptor() ([]byte, []int)
- func (m *ResponseHeader) Marshal() (dAtA []byte, err error)
- func (m *ResponseHeader) MarshalTo(dAtA []byte) (int, error)
- func (m *ResponseHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ResponseHeader) ProtoMessage()
- func (m *ResponseHeader) Reset()
- func (m *ResponseHeader) Size() (n int)
- func (m *ResponseHeader) String() string
- func (m *ResponseHeader) Unmarshal(dAtA []byte) error
- func (m *ResponseHeader) XXX_DiscardUnknown()
- func (m *ResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ResponseHeader) XXX_Merge(src proto.Message)
- func (m *ResponseHeader) XXX_Size() int
- func (m *ResponseHeader) XXX_Unmarshal(b []byte) error
- type ShardedRequest
- type SplitRequest
- type ThanosLabelsRequest
- func (r *ThanosLabelsRequest) GetCachingOptions() queryrange.CachingOptions
- func (r *ThanosLabelsRequest) GetEnd() int64
- func (r *ThanosLabelsRequest) GetQuery() string
- func (r *ThanosLabelsRequest) GetSplitInterval() time.Duration
- func (r *ThanosLabelsRequest) GetStart() int64
- func (r *ThanosLabelsRequest) GetStats() string
- func (r *ThanosLabelsRequest) GetStep() int64
- func (r *ThanosLabelsRequest) GetStoreMatchers() [][]*labels.Matcher
- func (r *ThanosLabelsRequest) LogToSpan(sp opentracing.Span)
- func (r *ThanosLabelsRequest) ProtoMessage()
- func (r *ThanosLabelsRequest) Reset()
- func (r *ThanosLabelsRequest) String() string
- func (r *ThanosLabelsRequest) WithQuery(_ string) queryrange.Request
- func (r *ThanosLabelsRequest) WithSplitInterval(interval time.Duration) queryrange.Request
- func (r *ThanosLabelsRequest) WithStartEnd(start, end int64) queryrange.Request
- func (r *ThanosLabelsRequest) WithStats(stats string) queryrange.Request
- type ThanosLabelsResponse
- func (*ThanosLabelsResponse) Descriptor() ([]byte, []int)
- func (m *ThanosLabelsResponse) GetHeaders() []*queryrange.PrometheusResponseHeader
- func (m *ThanosLabelsResponse) GetStats() *queryrange.PrometheusResponseStats
- func (m *ThanosLabelsResponse) Marshal() (dAtA []byte, err error)
- func (m *ThanosLabelsResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *ThanosLabelsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ThanosLabelsResponse) ProtoMessage()
- func (m *ThanosLabelsResponse) Reset()
- func (m *ThanosLabelsResponse) Size() (n int)
- func (m *ThanosLabelsResponse) String() string
- func (m *ThanosLabelsResponse) Unmarshal(dAtA []byte) error
- func (m *ThanosLabelsResponse) XXX_DiscardUnknown()
- func (m *ThanosLabelsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ThanosLabelsResponse) XXX_Merge(src proto.Message)
- func (m *ThanosLabelsResponse) XXX_Size() int
- func (m *ThanosLabelsResponse) XXX_Unmarshal(b []byte) error
- type ThanosQueryInstantRequest
- func (r *ThanosQueryInstantRequest) GetCachingOptions() queryrange.CachingOptions
- func (r *ThanosQueryInstantRequest) GetEnd() int64
- func (r *ThanosQueryInstantRequest) GetQuery() string
- func (r *ThanosQueryInstantRequest) GetStart() int64
- func (r *ThanosQueryInstantRequest) GetStats() string
- func (r *ThanosQueryInstantRequest) GetStep() int64
- func (r *ThanosQueryInstantRequest) GetStoreMatchers() [][]*labels.Matcher
- func (r *ThanosQueryInstantRequest) IsDedupEnabled() bool
- func (r *ThanosQueryInstantRequest) LogToSpan(sp opentracing.Span)
- func (r *ThanosQueryInstantRequest) ProtoMessage()
- func (r *ThanosQueryInstantRequest) Reset()
- func (r *ThanosQueryInstantRequest) String() string
- func (r *ThanosQueryInstantRequest) WithQuery(query string) queryrange.Request
- func (r *ThanosQueryInstantRequest) WithShardInfo(info *storepb.ShardInfo) queryrange.Request
- func (r *ThanosQueryInstantRequest) WithStartEnd(_, _ int64) queryrange.Request
- func (r *ThanosQueryInstantRequest) WithStats(stats string) queryrange.Request
- type ThanosQueryRangeRequest
- func (r *ThanosQueryRangeRequest) GetCachingOptions() queryrange.CachingOptions
- func (r *ThanosQueryRangeRequest) GetEnd() int64
- func (r *ThanosQueryRangeRequest) GetQuery() string
- func (r *ThanosQueryRangeRequest) GetSplitInterval() time.Duration
- func (r *ThanosQueryRangeRequest) GetStart() int64
- func (r *ThanosQueryRangeRequest) GetStats() string
- func (r *ThanosQueryRangeRequest) GetStep() int64
- func (r *ThanosQueryRangeRequest) GetStoreMatchers() [][]*labels.Matcher
- func (r *ThanosQueryRangeRequest) IsDedupEnabled() bool
- func (r *ThanosQueryRangeRequest) LogToSpan(sp opentracing.Span)
- func (r *ThanosQueryRangeRequest) ProtoMessage()
- func (r *ThanosQueryRangeRequest) Reset()
- func (r *ThanosQueryRangeRequest) String() string
- func (r *ThanosQueryRangeRequest) WithQuery(query string) queryrange.Request
- func (r *ThanosQueryRangeRequest) WithShardInfo(info *storepb.ShardInfo) queryrange.Request
- func (r *ThanosQueryRangeRequest) WithSplitInterval(interval time.Duration) queryrange.Request
- func (r *ThanosQueryRangeRequest) WithStartEnd(start, end int64) queryrange.Request
- func (r *ThanosQueryRangeRequest) WithStats(stats string) queryrange.Request
- type ThanosRequestDedup
- type ThanosRequestStoreMatcherGetter
- type ThanosResponseExtractor
- type ThanosSeriesRequest
- func (r *ThanosSeriesRequest) GetCachingOptions() queryrange.CachingOptions
- func (r *ThanosSeriesRequest) GetEnd() int64
- func (r *ThanosSeriesRequest) GetQuery() string
- func (r *ThanosSeriesRequest) GetSplitInterval() time.Duration
- func (r *ThanosSeriesRequest) GetStart() int64
- func (r *ThanosSeriesRequest) GetStats() string
- func (r *ThanosSeriesRequest) GetStep() int64
- func (r *ThanosSeriesRequest) GetStoreMatchers() [][]*labels.Matcher
- func (r *ThanosSeriesRequest) IsDedupEnabled() bool
- func (r *ThanosSeriesRequest) LogToSpan(sp opentracing.Span)
- func (r *ThanosSeriesRequest) ProtoMessage()
- func (r *ThanosSeriesRequest) Reset()
- func (r *ThanosSeriesRequest) String() string
- func (r *ThanosSeriesRequest) WithQuery(_ string) queryrange.Request
- func (r *ThanosSeriesRequest) WithSplitInterval(interval time.Duration) queryrange.Request
- func (r *ThanosSeriesRequest) WithStartEnd(start, end int64) queryrange.Request
- func (r *ThanosSeriesRequest) WithStats(stats string) queryrange.Request
- type ThanosSeriesResponse
- func (*ThanosSeriesResponse) Descriptor() ([]byte, []int)
- func (m *ThanosSeriesResponse) GetHeaders() []*queryrange.PrometheusResponseHeader
- func (m *ThanosSeriesResponse) GetStats() *queryrange.PrometheusResponseStats
- func (m *ThanosSeriesResponse) Marshal() (dAtA []byte, err error)
- func (m *ThanosSeriesResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *ThanosSeriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ThanosSeriesResponse) ProtoMessage()
- func (m *ThanosSeriesResponse) Reset()
- func (m *ThanosSeriesResponse) Size() (n int)
- func (m *ThanosSeriesResponse) String() string
- func (m *ThanosSeriesResponse) Unmarshal(dAtA []byte) error
- func (m *ThanosSeriesResponse) XXX_DiscardUnknown()
- func (m *ThanosSeriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ThanosSeriesResponse) XXX_Merge(src proto.Message)
- func (m *ThanosSeriesResponse) XXX_Size() int
- func (m *ThanosSeriesResponse) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthResponse = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowResponse = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupResponse = fmt.Errorf("proto: unexpected end of group") )
var ( // DefaultRedisConfig is default redis config for queryfrontend. DefaultRedisConfig = RedisResponseCacheConfig{ Redis: cacheutil.DefaultRedisClientConfig, Expiration: 24 * time.Hour, } )
Functions ¶
func DownsampledMiddleware ¶ added in v0.19.0
func DownsampledMiddleware(merger queryrange.Merger, registerer prometheus.Registerer) queryrange.Middleware
DownsampledMiddleware creates a new Middleware that requests downsampled data should response to original request with auto max_source_resolution not contain data points.
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 NewThanosLabelsCodec ¶ added in v0.17.0
func NewThanosLabelsCodec(partialResponse bool, defaultMetadataTimeRange time.Duration) *labelsCodec
NewThanosLabelsCodec initializes a labelsCodec.
func NewThanosQueryInstantCodec ¶ added in v0.28.0
func NewThanosQueryInstantCodec(partialResponse bool) *queryInstantCodec
NewThanosQueryInstantCodec initializes a queryInstantCodec.
func NewThanosQueryRangeCodec ¶ added in v0.17.0
func NewThanosQueryRangeCodec(partialResponse bool) *queryRangeCodec
NewThanosQueryRangeCodec initializes a queryRangeCodec.
func NewTripperware ¶ added in v0.16.0
func NewTripperware(config Config, reg prometheus.Registerer, logger log.Logger) (queryrange.Tripperware, error)
NewTripperware returns a Tripperware which sends requests to different sub tripperwares based on the query type.
func PromQLShardingMiddleware ¶ added in v0.28.0
func PromQLShardingMiddleware(queryAnalyzer querysharding.Analyzer, numShards int, limits queryrange.Limits, merger queryrange.Merger, registerer prometheus.Registerer) queryrange.Middleware
PromQLShardingMiddleware creates a new Middleware that shards PromQL aggregations using grouping labels.
func SplitByIntervalMiddleware ¶ added in v0.17.0
func SplitByIntervalMiddleware(interval queryrange.IntervalFn, limits queryrange.Limits, merger queryrange.Merger, registerer prometheus.Registerer) queryrange.Middleware
SplitByIntervalMiddleware creates a new Middleware that splits requests by a given interval.
Types ¶
type CacheProviderConfig ¶ added in v0.16.0
type CacheProviderConfig struct {
Type ResponseCacheProvider `yaml:"type"`
Config any `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 {
QueryRangeConfig
LabelsConfig
DownstreamTripperConfig
CortexHandlerConfig *transport.HandlerConfig
CompressResponses bool
CacheCompression string
RequestLoggingDecision string
DownstreamURL string
ForwardHeaders []string
NumShards int
TenantHeader string
DefaultTenant string
TenantCertField string
EnableXFunctions bool
EnableFeatures []string
}
Config holds the query frontend configs.
type DownstreamTripperConfig ¶ added in v0.23.0
type DownstreamTripperConfig struct {
IdleConnTimeout prommodel.Duration `yaml:"idle_conn_timeout"`
ResponseHeaderTimeout prommodel.Duration `yaml:"response_header_timeout"`
TLSHandshakeTimeout prommodel.Duration `yaml:"tls_handshake_timeout"`
ExpectContinueTimeout prommodel.Duration `yaml:"expect_continue_timeout"`
MaxIdleConns *int `yaml:"max_idle_conns"`
MaxIdleConnsPerHost *int `yaml:"max_idle_conns_per_host"`
MaxConnsPerHost *int `yaml:"max_conns_per_host"`
TLSConfig *exthttp.TLSConfig `yaml:"tls_config"`
CachePathOrContent extflag.PathOrContent
}
DownstreamTripperConfig stores the http.Transport configuration for query-frontend's HTTP downstream tripper.
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 LabelsConfig ¶ added in v0.17.0
type LabelsConfig struct {
// PartialResponseStrategy is the default strategy used
// when parsing thanos query request.
PartialResponseStrategy bool
DefaultTimeRange time.Duration
ResultsCacheConfig *queryrange.ResultsCacheConfig
CachePathOrContent extflag.PathOrContent
SplitQueriesByInterval time.Duration
MaxRetries int
Limits *cortexvalidation.Limits
}
LabelsConfig holds the config for labels tripperware.
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 QueryRangeConfig ¶ added in v0.17.0
type QueryRangeConfig struct {
// PartialResponseStrategy is the default strategy used
// when parsing thanos query request.
PartialResponseStrategy bool
ResultsCacheConfig *queryrange.ResultsCacheConfig
CachePathOrContent extflag.PathOrContent
AlignRangeWithStep bool
RequestDownsampled bool
SplitQueriesByInterval time.Duration
MinQuerySplitInterval time.Duration
MaxQuerySplitInterval time.Duration
HorizontalShards int64
MaxRetries int
Limits *cortexvalidation.Limits
}
QueryRangeConfig holds the config for query range tripperware.
type RedisResponseCacheConfig ¶ added in v0.25.0
type RedisResponseCacheConfig struct {
Redis cacheutil.RedisClientConfig `yaml:",inline"`
// Expiration sets a global expiration limit for all cached items.
Expiration time.Duration `yaml:"expiration"`
}
RedisResponseCacheConfig holds the configs for the redis cache provider.
type RequestHeader ¶ added in v0.26.0
type ResponseCacheProvider ¶ added in v0.16.0
type ResponseCacheProvider string
const ( INMEMORY ResponseCacheProvider = "IN-MEMORY" MEMCACHED ResponseCacheProvider = "MEMCACHED" REDIS ResponseCacheProvider = "REDIS" )
type ResponseHeader ¶ added in v0.17.0
type ResponseHeader struct {
Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"-"`
Values []string `protobuf:"bytes,2,rep,name=Values,proto3" json:"-"`
}
func (*ResponseHeader) Descriptor ¶ added in v0.17.0
func (*ResponseHeader) Descriptor() ([]byte, []int)
func (*ResponseHeader) Marshal ¶ added in v0.17.0
func (m *ResponseHeader) Marshal() (dAtA []byte, err error)
func (*ResponseHeader) MarshalTo ¶ added in v0.17.0
func (m *ResponseHeader) MarshalTo(dAtA []byte) (int, error)
func (*ResponseHeader) MarshalToSizedBuffer ¶ added in v0.17.0
func (m *ResponseHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ResponseHeader) ProtoMessage ¶ added in v0.17.0
func (*ResponseHeader) ProtoMessage()
func (*ResponseHeader) Reset ¶ added in v0.17.0
func (m *ResponseHeader) Reset()
func (*ResponseHeader) Size ¶ added in v0.17.0
func (m *ResponseHeader) Size() (n int)
func (*ResponseHeader) String ¶ added in v0.17.0
func (m *ResponseHeader) String() string
func (*ResponseHeader) Unmarshal ¶ added in v0.17.0
func (m *ResponseHeader) Unmarshal(dAtA []byte) error
func (*ResponseHeader) XXX_DiscardUnknown ¶ added in v0.17.0
func (m *ResponseHeader) XXX_DiscardUnknown()
func (*ResponseHeader) XXX_Marshal ¶ added in v0.17.0
func (m *ResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ResponseHeader) XXX_Merge ¶ added in v0.17.0
func (m *ResponseHeader) XXX_Merge(src proto.Message)
func (*ResponseHeader) XXX_Size ¶ added in v0.17.0
func (m *ResponseHeader) XXX_Size() int
func (*ResponseHeader) XXX_Unmarshal ¶ added in v0.17.0
func (m *ResponseHeader) XXX_Unmarshal(b []byte) error
type ShardedRequest ¶ added in v0.28.0
type ShardedRequest interface {
WithShardInfo(info *storepb.ShardInfo) queryrange.Request
}
ShardedRequest interface represents a query request that can be sharded vertically.
type SplitRequest ¶ added in v0.37.0
type SplitRequest interface {
GetSplitInterval() time.Duration
WithSplitInterval(interval time.Duration) queryrange.Request
}
SplitRequest interface represents a query request that can be split horizontally.
type ThanosLabelsRequest ¶ added in v0.17.0
type ThanosLabelsRequest struct {
Start int64
End int64
Label string
Path string
Matchers [][]*labels.Matcher
StoreMatchers [][]*labels.Matcher
PartialResponse bool
CachingOptions queryrange.CachingOptions
Headers []*RequestHeader
Stats string
SplitInterval time.Duration
}
func (*ThanosLabelsRequest) GetCachingOptions ¶ added in v0.17.0
func (r *ThanosLabelsRequest) GetCachingOptions() queryrange.CachingOptions
func (*ThanosLabelsRequest) GetEnd ¶ added in v0.17.0
func (r *ThanosLabelsRequest) GetEnd() int64
GetEnd returns the end timestamp of the request in milliseconds.
func (*ThanosLabelsRequest) GetQuery ¶ added in v0.17.0
func (r *ThanosLabelsRequest) GetQuery() string
GetQuery returns the query of the request.
func (*ThanosLabelsRequest) GetSplitInterval ¶ added in v0.37.0
func (r *ThanosLabelsRequest) GetSplitInterval() time.Duration
func (*ThanosLabelsRequest) GetStart ¶ added in v0.17.0
func (r *ThanosLabelsRequest) GetStart() int64
GetStart returns the start timestamp of the request in milliseconds.
func (*ThanosLabelsRequest) GetStats ¶ added in v0.28.0
func (r *ThanosLabelsRequest) GetStats() string
func (*ThanosLabelsRequest) GetStep ¶ added in v0.17.0
func (r *ThanosLabelsRequest) GetStep() int64
GetStep returns the step of the request in milliseconds. Returns 1 is a trick to avoid panic in https://github.com/cortexproject/cortex/blob/master/pkg/querier/queryrange/results_cache.go#L447.
func (*ThanosLabelsRequest) GetStoreMatchers ¶ added in v0.17.0
func (r *ThanosLabelsRequest) GetStoreMatchers() [][]*labels.Matcher
GetStoreMatchers returns store matches.
func (*ThanosLabelsRequest) LogToSpan ¶ added in v0.17.0
func (r *ThanosLabelsRequest) LogToSpan(sp opentracing.Span)
LogToSpan writes information about this request to an OpenTracing span.
func (*ThanosLabelsRequest) ProtoMessage ¶ added in v0.17.0
func (r *ThanosLabelsRequest) ProtoMessage()
ProtoMessage implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosLabelsRequest) Reset ¶ added in v0.17.0
func (r *ThanosLabelsRequest) Reset()
Reset implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosLabelsRequest) String ¶ added in v0.17.0
func (r *ThanosLabelsRequest) String() string
String implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosLabelsRequest) WithQuery ¶ added in v0.17.0
func (r *ThanosLabelsRequest) WithQuery(_ string) queryrange.Request
WithQuery clone the current request with a different query.
func (*ThanosLabelsRequest) WithSplitInterval ¶ added in v0.37.0
func (r *ThanosLabelsRequest) WithSplitInterval(interval time.Duration) queryrange.Request
WithSplitInterval clones the current request with a different split interval.
func (*ThanosLabelsRequest) WithStartEnd ¶ added in v0.17.0
func (r *ThanosLabelsRequest) WithStartEnd(start, end int64) queryrange.Request
WithStartEnd clone the current request with different start and end timestamp.
func (*ThanosLabelsRequest) WithStats ¶ added in v0.28.0
func (r *ThanosLabelsRequest) WithStats(stats string) queryrange.Request
type ThanosLabelsResponse ¶ added in v0.17.0
type ThanosLabelsResponse struct {
Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"`
Data []string `protobuf:"bytes,2,rep,name=Data,proto3" json:"data"`
ErrorType string `protobuf:"bytes,3,opt,name=ErrorType,proto3" json:"errorType,omitempty"`
Error string `protobuf:"bytes,4,opt,name=Error,proto3" json:"error,omitempty"`
Headers []*ResponseHeader `protobuf:"bytes,5,rep,name=Headers,proto3" json:"-"`
}
func (*ThanosLabelsResponse) Descriptor ¶ added in v0.17.0
func (*ThanosLabelsResponse) Descriptor() ([]byte, []int)
func (*ThanosLabelsResponse) GetHeaders ¶ added in v0.17.0
func (m *ThanosLabelsResponse) GetHeaders() []*queryrange.PrometheusResponseHeader
GetHeaders returns the HTTP headers in the response.
func (*ThanosLabelsResponse) GetStats ¶ added in v0.28.0
func (m *ThanosLabelsResponse) GetStats() *queryrange.PrometheusResponseStats
GetStats returns response stats. Unimplemented for ThanosLabelsResponse.
func (*ThanosLabelsResponse) Marshal ¶ added in v0.17.0
func (m *ThanosLabelsResponse) Marshal() (dAtA []byte, err error)
func (*ThanosLabelsResponse) MarshalTo ¶ added in v0.17.0
func (m *ThanosLabelsResponse) MarshalTo(dAtA []byte) (int, error)
func (*ThanosLabelsResponse) MarshalToSizedBuffer ¶ added in v0.17.0
func (m *ThanosLabelsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ThanosLabelsResponse) ProtoMessage ¶ added in v0.17.0
func (*ThanosLabelsResponse) ProtoMessage()
func (*ThanosLabelsResponse) Reset ¶ added in v0.17.0
func (m *ThanosLabelsResponse) Reset()
func (*ThanosLabelsResponse) Size ¶ added in v0.17.0
func (m *ThanosLabelsResponse) Size() (n int)
func (*ThanosLabelsResponse) String ¶ added in v0.17.0
func (m *ThanosLabelsResponse) String() string
func (*ThanosLabelsResponse) Unmarshal ¶ added in v0.17.0
func (m *ThanosLabelsResponse) Unmarshal(dAtA []byte) error
func (*ThanosLabelsResponse) XXX_DiscardUnknown ¶ added in v0.17.0
func (m *ThanosLabelsResponse) XXX_DiscardUnknown()
func (*ThanosLabelsResponse) XXX_Marshal ¶ added in v0.17.0
func (m *ThanosLabelsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ThanosLabelsResponse) XXX_Merge ¶ added in v0.17.0
func (m *ThanosLabelsResponse) XXX_Merge(src proto.Message)
func (*ThanosLabelsResponse) XXX_Size ¶ added in v0.17.0
func (m *ThanosLabelsResponse) XXX_Size() int
func (*ThanosLabelsResponse) XXX_Unmarshal ¶ added in v0.17.0
func (m *ThanosLabelsResponse) XXX_Unmarshal(b []byte) error
type ThanosQueryInstantRequest ¶ added in v0.28.0
type ThanosQueryInstantRequest struct {
Path string
Time int64
Timeout time.Duration
Query string
Dedup bool
PartialResponse bool
AutoDownsampling bool
MaxSourceResolution int64
ReplicaLabels []string
StoreMatchers [][]*labels.Matcher
Headers []*RequestHeader
Stats string
ShardInfo *storepb.ShardInfo
LookbackDelta int64 // in milliseconds.
Analyze bool
Engine string
}
func (*ThanosQueryInstantRequest) GetCachingOptions ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) GetCachingOptions() queryrange.CachingOptions
func (*ThanosQueryInstantRequest) GetEnd ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) GetEnd() int64
GetEnd returns the end timestamp of the request in milliseconds.
func (*ThanosQueryInstantRequest) GetQuery ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) GetQuery() string
GetQuery returns the query of the request.
func (*ThanosQueryInstantRequest) GetStart ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) GetStart() int64
GetStart returns the start timestamp of the request in milliseconds.
func (*ThanosQueryInstantRequest) GetStats ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) GetStats() string
func (*ThanosQueryInstantRequest) GetStep ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) GetStep() int64
GetStep returns the step of the request in milliseconds.
func (*ThanosQueryInstantRequest) GetStoreMatchers ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) GetStoreMatchers() [][]*labels.Matcher
GetStoreMatchers returns store matches.
func (*ThanosQueryInstantRequest) IsDedupEnabled ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) IsDedupEnabled() bool
IsDedupEnabled returns true if deduplication is enabled.
func (*ThanosQueryInstantRequest) LogToSpan ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) LogToSpan(sp opentracing.Span)
LogToSpan writes information about this request to an OpenTracing span.
func (*ThanosQueryInstantRequest) ProtoMessage ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) ProtoMessage()
ProtoMessage implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosQueryInstantRequest) Reset ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) Reset()
Reset implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosQueryInstantRequest) String ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) String() string
String implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosQueryInstantRequest) WithQuery ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) WithQuery(query string) queryrange.Request
WithQuery clone the current request with a different query.
func (*ThanosQueryInstantRequest) WithShardInfo ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) WithShardInfo(info *storepb.ShardInfo) queryrange.Request
WithShardInfo clones the current request with a different shard info.
func (*ThanosQueryInstantRequest) WithStartEnd ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) WithStartEnd(_, _ int64) queryrange.Request
WithStartEnd clone the current request with different start and end timestamp.
func (*ThanosQueryInstantRequest) WithStats ¶ added in v0.28.0
func (r *ThanosQueryInstantRequest) WithStats(stats string) queryrange.Request
type ThanosQueryRangeRequest ¶ added in v0.17.0
type ThanosQueryRangeRequest 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
Headers []*RequestHeader
Stats string
ShardInfo *storepb.ShardInfo
LookbackDelta int64
Analyze bool
Engine string
SplitInterval time.Duration
}
func (*ThanosQueryRangeRequest) GetCachingOptions ¶ added in v0.17.0
func (r *ThanosQueryRangeRequest) GetCachingOptions() queryrange.CachingOptions
func (*ThanosQueryRangeRequest) GetEnd ¶ added in v0.17.0
func (r *ThanosQueryRangeRequest) GetEnd() int64
GetEnd returns the end timestamp of the request in milliseconds.
func (*ThanosQueryRangeRequest) GetQuery ¶ added in v0.17.0
func (r *ThanosQueryRangeRequest) GetQuery() string
GetQuery returns the query of the request.
func (*ThanosQueryRangeRequest) GetSplitInterval ¶ added in v0.37.0
func (r *ThanosQueryRangeRequest) GetSplitInterval() time.Duration
func (*ThanosQueryRangeRequest) GetStart ¶ added in v0.17.0
func (r *ThanosQueryRangeRequest) GetStart() int64
GetStart returns the start timestamp of the request in milliseconds.
func (*ThanosQueryRangeRequest) GetStats ¶ added in v0.28.0
func (r *ThanosQueryRangeRequest) GetStats() string
func (*ThanosQueryRangeRequest) GetStep ¶ added in v0.17.0
func (r *ThanosQueryRangeRequest) GetStep() int64
GetStep returns the step of the request in milliseconds.
func (*ThanosQueryRangeRequest) GetStoreMatchers ¶ added in v0.17.0
func (r *ThanosQueryRangeRequest) GetStoreMatchers() [][]*labels.Matcher
GetStoreMatchers returns store matches.
func (*ThanosQueryRangeRequest) IsDedupEnabled ¶ added in v0.26.0
func (r *ThanosQueryRangeRequest) IsDedupEnabled() bool
IsDedupEnabled returns true if deduplication is enabled.
func (*ThanosQueryRangeRequest) LogToSpan ¶ added in v0.17.0
func (r *ThanosQueryRangeRequest) LogToSpan(sp opentracing.Span)
LogToSpan writes information about this request to an OpenTracing span.
func (*ThanosQueryRangeRequest) ProtoMessage ¶ added in v0.17.0
func (r *ThanosQueryRangeRequest) ProtoMessage()
ProtoMessage implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosQueryRangeRequest) Reset ¶ added in v0.17.0
func (r *ThanosQueryRangeRequest) Reset()
Reset implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosQueryRangeRequest) String ¶ added in v0.17.0
func (r *ThanosQueryRangeRequest) String() string
String implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosQueryRangeRequest) WithQuery ¶ added in v0.17.0
func (r *ThanosQueryRangeRequest) WithQuery(query string) queryrange.Request
WithQuery clone the current request with a different query.
func (*ThanosQueryRangeRequest) WithShardInfo ¶ added in v0.28.0
func (r *ThanosQueryRangeRequest) WithShardInfo(info *storepb.ShardInfo) queryrange.Request
WithShardInfo clones the current request with a different shard info.
func (*ThanosQueryRangeRequest) WithSplitInterval ¶ added in v0.37.0
func (r *ThanosQueryRangeRequest) WithSplitInterval(interval time.Duration) queryrange.Request
WithSplitInterval clones the current request with a different split interval.
func (*ThanosQueryRangeRequest) WithStartEnd ¶ added in v0.17.0
func (r *ThanosQueryRangeRequest) WithStartEnd(start, end int64) queryrange.Request
WithStartEnd clone the current request with different start and end timestamp.
func (*ThanosQueryRangeRequest) WithStats ¶ added in v0.28.0
func (r *ThanosQueryRangeRequest) WithStats(stats string) queryrange.Request
type ThanosRequestDedup ¶ added in v0.26.0
type ThanosRequestDedup interface {
IsDedupEnabled() bool
}
ThanosRequestDedup is a an interface for all requests that share setting deduplication.
type ThanosRequestStoreMatcherGetter ¶ added in v0.26.0
ThanosRequestStoreMatcherGetter is a an interface for store matching that all request share. TODO(yeya24): Add partial result when needed.
type ThanosResponseExtractor ¶ added in v0.17.0
type ThanosResponseExtractor struct{}
ThanosResponseExtractor helps to extract specific info from Query Response.
func (ThanosResponseExtractor) Extract ¶ added in v0.17.0
func (ThanosResponseExtractor) Extract(_, _ int64, resp queryrange.Response) queryrange.Response
Extract extracts response for specific a range from a response. This interface is not used for labels and series responses.
func (ThanosResponseExtractor) ResponseWithoutHeaders ¶ added in v0.17.0
func (ThanosResponseExtractor) ResponseWithoutHeaders(resp queryrange.Response) queryrange.Response
ResponseWithoutHeaders returns the response without HTTP headers.
func (ThanosResponseExtractor) ResponseWithoutStats ¶ added in v0.28.0
func (ThanosResponseExtractor) ResponseWithoutStats(resp queryrange.Response) queryrange.Response
type ThanosSeriesRequest ¶ added in v0.17.0
type ThanosSeriesRequest struct {
Path string
Start int64
End int64
Dedup bool
PartialResponse bool
ReplicaLabels []string
Matchers [][]*labels.Matcher
StoreMatchers [][]*labels.Matcher
CachingOptions queryrange.CachingOptions
Headers []*RequestHeader
Stats string
SplitInterval time.Duration
}
func (*ThanosSeriesRequest) GetCachingOptions ¶ added in v0.17.0
func (r *ThanosSeriesRequest) GetCachingOptions() queryrange.CachingOptions
func (*ThanosSeriesRequest) GetEnd ¶ added in v0.17.0
func (r *ThanosSeriesRequest) GetEnd() int64
GetEnd returns the end timestamp of the request in milliseconds.
func (*ThanosSeriesRequest) GetQuery ¶ added in v0.17.0
func (r *ThanosSeriesRequest) GetQuery() string
GetQuery returns the query of the request.
func (*ThanosSeriesRequest) GetSplitInterval ¶ added in v0.37.0
func (r *ThanosSeriesRequest) GetSplitInterval() time.Duration
func (*ThanosSeriesRequest) GetStart ¶ added in v0.17.0
func (r *ThanosSeriesRequest) GetStart() int64
GetStart returns the start timestamp of the request in milliseconds.
func (*ThanosSeriesRequest) GetStats ¶ added in v0.28.0
func (r *ThanosSeriesRequest) GetStats() string
func (*ThanosSeriesRequest) GetStep ¶ added in v0.17.0
func (r *ThanosSeriesRequest) GetStep() int64
GetStep returns the step of the request in milliseconds. Returns 1 is a trick to avoid panic in https://github.com/cortexproject/cortex/blob/master/pkg/querier/queryrange/results_cache.go#L447.
func (*ThanosSeriesRequest) GetStoreMatchers ¶ added in v0.17.0
func (r *ThanosSeriesRequest) GetStoreMatchers() [][]*labels.Matcher
GetStoreMatchers returns store matches.
func (*ThanosSeriesRequest) IsDedupEnabled ¶ added in v0.26.0
func (r *ThanosSeriesRequest) IsDedupEnabled() bool
IsDedupEnabled returns true if deduplication is enabled.
func (*ThanosSeriesRequest) LogToSpan ¶ added in v0.17.0
func (r *ThanosSeriesRequest) LogToSpan(sp opentracing.Span)
LogToSpan writes information about this request to an OpenTracing span.
func (*ThanosSeriesRequest) ProtoMessage ¶ added in v0.17.0
func (r *ThanosSeriesRequest) ProtoMessage()
ProtoMessage implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosSeriesRequest) Reset ¶ added in v0.17.0
func (r *ThanosSeriesRequest) Reset()
Reset implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosSeriesRequest) String ¶ added in v0.17.0
func (r *ThanosSeriesRequest) String() string
String implements proto.Message interface required by queryrange.Request, which is not used in thanos.
func (*ThanosSeriesRequest) WithQuery ¶ added in v0.17.0
func (r *ThanosSeriesRequest) WithQuery(_ string) queryrange.Request
WithQuery clone the current request with a different query.
func (*ThanosSeriesRequest) WithSplitInterval ¶ added in v0.37.0
func (r *ThanosSeriesRequest) WithSplitInterval(interval time.Duration) queryrange.Request
WithSplitInterval clones the current request with a different split interval.
func (*ThanosSeriesRequest) WithStartEnd ¶ added in v0.17.0
func (r *ThanosSeriesRequest) WithStartEnd(start, end int64) queryrange.Request
WithStartEnd clone the current request with different start and end timestamp.
func (*ThanosSeriesRequest) WithStats ¶ added in v0.28.0
func (r *ThanosSeriesRequest) WithStats(stats string) queryrange.Request
type ThanosSeriesResponse ¶ added in v0.17.0
type ThanosSeriesResponse struct {
Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"`
Data []labelpb.ZLabelSet `protobuf:"bytes,2,rep,name=Data,proto3" json:"data"`
ErrorType string `protobuf:"bytes,3,opt,name=ErrorType,proto3" json:"errorType,omitempty"`
Error string `protobuf:"bytes,4,opt,name=Error,proto3" json:"error,omitempty"`
Headers []*ResponseHeader `protobuf:"bytes,5,rep,name=Headers,proto3" json:"-"`
}
func (*ThanosSeriesResponse) Descriptor ¶ added in v0.17.0
func (*ThanosSeriesResponse) Descriptor() ([]byte, []int)
func (*ThanosSeriesResponse) GetHeaders ¶ added in v0.17.0
func (m *ThanosSeriesResponse) GetHeaders() []*queryrange.PrometheusResponseHeader
GetHeaders returns the HTTP headers in the response.
func (*ThanosSeriesResponse) GetStats ¶ added in v0.28.0
func (m *ThanosSeriesResponse) GetStats() *queryrange.PrometheusResponseStats
GetStats returns response stats. Unimplemented for ThanosSeriesResponse.
func (*ThanosSeriesResponse) Marshal ¶ added in v0.17.0
func (m *ThanosSeriesResponse) Marshal() (dAtA []byte, err error)
func (*ThanosSeriesResponse) MarshalTo ¶ added in v0.17.0
func (m *ThanosSeriesResponse) MarshalTo(dAtA []byte) (int, error)
func (*ThanosSeriesResponse) MarshalToSizedBuffer ¶ added in v0.17.0
func (m *ThanosSeriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ThanosSeriesResponse) ProtoMessage ¶ added in v0.17.0
func (*ThanosSeriesResponse) ProtoMessage()
func (*ThanosSeriesResponse) Reset ¶ added in v0.17.0
func (m *ThanosSeriesResponse) Reset()
func (*ThanosSeriesResponse) Size ¶ added in v0.17.0
func (m *ThanosSeriesResponse) Size() (n int)
func (*ThanosSeriesResponse) String ¶ added in v0.17.0
func (m *ThanosSeriesResponse) String() string
func (*ThanosSeriesResponse) Unmarshal ¶ added in v0.17.0
func (m *ThanosSeriesResponse) Unmarshal(dAtA []byte) error
func (*ThanosSeriesResponse) XXX_DiscardUnknown ¶ added in v0.17.0
func (m *ThanosSeriesResponse) XXX_DiscardUnknown()
func (*ThanosSeriesResponse) XXX_Marshal ¶ added in v0.17.0
func (m *ThanosSeriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ThanosSeriesResponse) XXX_Merge ¶ added in v0.17.0
func (m *ThanosSeriesResponse) XXX_Merge(src proto.Message)
func (*ThanosSeriesResponse) XXX_Size ¶ added in v0.17.0
func (m *ThanosSeriesResponse) XXX_Size() int
func (*ThanosSeriesResponse) XXX_Unmarshal ¶ added in v0.17.0
func (m *ThanosSeriesResponse) XXX_Unmarshal(b []byte) error