queryrange

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryRangeOp = "query_range"
	SeriesOp     = "series"
	LabelNamesOp = "labels"
)
View Source
const (
	DefaultDownstreamConcurrency = 32
)

Variables

View Source
var (
	ErrInvalidLengthQueryrange = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQueryrange   = fmt.Errorf("proto: integer overflow")
)
View Source
var (

	// StatsHTTPMiddleware is an http middleware to record stats for query_range filter.
	StatsHTTPMiddleware middleware.Interface = statsHTTPMiddleware(defaultMetricRecorder)
)

Functions

func NewLabelsTripperware

func NewLabelsTripperware(
	cfg Config,
	log log.Logger,
	limits Limits,
	codec queryrange.Codec,
	instrumentMetrics *queryrange.InstrumentMiddlewareMetrics,
	retryMiddlewareMetrics *queryrange.RetryMiddlewareMetrics,
	splitByMetrics *SplitByMetrics,
) (queryrange.Tripperware, error)

NewLabelsTripperware creates a new frontend tripperware responsible for handling labels requests.

func NewLimitedRoundTripper

func NewLimitedRoundTripper(next http.RoundTripper, codec queryrange.Codec, limits Limits, middlewares ...queryrange.Middleware) http.RoundTripper

NewLimitedRoundTripper creates a new roundtripper that enforces MaxQueryParallelism to the `next` roundtripper across `middlewares`.

func NewLogFilterTripperware

func NewLogFilterTripperware(
	cfg Config,
	log log.Logger,
	limits Limits,
	schema chunk.SchemaConfig,
	minShardingLookback time.Duration,
	codec queryrange.Codec,
	instrumentMetrics *queryrange.InstrumentMiddlewareMetrics,
	retryMiddlewareMetrics *queryrange.RetryMiddlewareMetrics,
	shardingMetrics *logql.ShardingMetrics,
	splitByMetrics *SplitByMetrics,
) (queryrange.Tripperware, error)

NewLogFilterTripperware creates a new frontend tripperware responsible for handling log requests with regex.

func NewQueryShardMiddleware

func NewQueryShardMiddleware(
	logger log.Logger,
	confs queryrange.ShardingConfigs,
	minShardingLookback time.Duration,
	middlewareMetrics *queryrange.InstrumentMiddlewareMetrics,
	shardingMetrics *logql.ShardingMetrics,
	limits logql.Limits,
) queryrange.Middleware

NewQueryShardMiddleware creates a middleware which downstreams queries after AST mapping and query encoding.

func NewSeriesTripperware

func NewSeriesTripperware(
	cfg Config,
	log log.Logger,
	limits Limits,
	codec queryrange.Codec,
	instrumentMetrics *queryrange.InstrumentMiddlewareMetrics,
	retryMiddlewareMetrics *queryrange.RetryMiddlewareMetrics,
	splitByMetrics *SplitByMetrics,
) (queryrange.Tripperware, error)

NewSeriesripperware creates a new frontend tripperware responsible for handling series requests

func ResponseToResult

func ResponseToResult(resp queryrange.Response) (logqlmodel.Result, error)

func SplitByIntervalMiddleware

func SplitByIntervalMiddleware(limits Limits, merger queryrange.Merger, splitter Splitter, metrics *SplitByMetrics) queryrange.Middleware

SplitByIntervalMiddleware creates a new Middleware that splits log requests by a given interval.

func StatsCollectorMiddleware

func StatsCollectorMiddleware() queryrange.Middleware

StatsCollectorMiddleware compute the stats summary based on the actual duration of the request and inject it in the request context.

Types

type Config

type Config struct {
	queryrange.Config `yaml:",inline"`
}

Config is the configuration for the queryrange tripperware

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to configure this flag set.

type DownstreamHandler

type DownstreamHandler struct {
	// contains filtered or unexported fields
}

func (DownstreamHandler) Downstreamer

func (h DownstreamHandler) Downstreamer() logql.Downstreamer

type Limits

type Limits interface {
	queryrange.Limits
	QuerySplitDuration(string) time.Duration
	MaxQuerySeries(string) int
	MaxEntriesLimitPerQuery(string) int
}

Limits extends the cortex limits interface with support for per tenant splitby parameters

func WithDefaultLimits

func WithDefaultLimits(l Limits, conf queryrange.Config) Limits

WithDefaults will construct a Limits with a default value for QuerySplitDuration when no overrides are present.

func WithSplitByLimits

func WithSplitByLimits(l Limits, splitBy time.Duration) Limits

WithSplitByLimits will construct a Limits with a static split by duration.

type LokiData

type LokiData struct {
	ResultType string                                        `protobuf:"bytes,1,opt,name=ResultType,proto3" json:"resultType"`
	Result     []github_com_grafarg_loki_pkg_logproto.Stream `protobuf:"bytes,2,rep,name=Result,proto3,customtype=github.com/famarker/loki/pkg/logproto.Stream" json:"result"`
}

func (*LokiData) Descriptor

func (*LokiData) Descriptor() ([]byte, []int)

func (*LokiData) Equal

func (this *LokiData) Equal(that interface{}) bool

func (*LokiData) GetResultType

func (m *LokiData) GetResultType() string

func (*LokiData) GoString

func (this *LokiData) GoString() string

func (*LokiData) Marshal

func (m *LokiData) Marshal() (dAtA []byte, err error)

func (*LokiData) MarshalTo

func (m *LokiData) MarshalTo(dAtA []byte) (int, error)

func (*LokiData) ProtoMessage

func (*LokiData) ProtoMessage()

func (*LokiData) Reset

func (m *LokiData) Reset()

func (*LokiData) Size

func (m *LokiData) Size() (n int)

func (*LokiData) String

func (this *LokiData) String() string

func (*LokiData) Unmarshal

func (m *LokiData) Unmarshal(dAtA []byte) error

func (*LokiData) XXX_DiscardUnknown

func (m *LokiData) XXX_DiscardUnknown()

func (*LokiData) XXX_Marshal

func (m *LokiData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LokiData) XXX_Merge

func (m *LokiData) XXX_Merge(src proto.Message)

func (*LokiData) XXX_Size

func (m *LokiData) XXX_Size() int

func (*LokiData) XXX_Unmarshal

func (m *LokiData) XXX_Unmarshal(b []byte) error

type LokiLabelNamesRequest

type LokiLabelNamesRequest struct {
	StartTs time.Time `protobuf:"bytes,1,opt,name=startTs,proto3,stdtime" json:"startTs"`
	EndTs   time.Time `protobuf:"bytes,2,opt,name=endTs,proto3,stdtime" json:"endTs"`
	Path    string    `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
}

func (*LokiLabelNamesRequest) Descriptor

func (*LokiLabelNamesRequest) Descriptor() ([]byte, []int)

func (*LokiLabelNamesRequest) Equal

func (this *LokiLabelNamesRequest) Equal(that interface{}) bool

func (*LokiLabelNamesRequest) GetCachingOptions

func (*LokiLabelNamesRequest) GetCachingOptions() (res queryrange.CachingOptions)

func (*LokiLabelNamesRequest) GetEnd

func (r *LokiLabelNamesRequest) GetEnd() int64

func (*LokiLabelNamesRequest) GetEndTs

func (m *LokiLabelNamesRequest) GetEndTs() time.Time

func (*LokiLabelNamesRequest) GetPath

func (m *LokiLabelNamesRequest) GetPath() string

func (*LokiLabelNamesRequest) GetQuery

func (r *LokiLabelNamesRequest) GetQuery() string

func (*LokiLabelNamesRequest) GetStart

func (r *LokiLabelNamesRequest) GetStart() int64

func (*LokiLabelNamesRequest) GetStartTs

func (m *LokiLabelNamesRequest) GetStartTs() time.Time

func (*LokiLabelNamesRequest) GetStep

func (r *LokiLabelNamesRequest) GetStep() int64

func (*LokiLabelNamesRequest) GoString

func (this *LokiLabelNamesRequest) GoString() string

func (*LokiLabelNamesRequest) LogToSpan

func (r *LokiLabelNamesRequest) LogToSpan(sp opentracing.Span)

func (*LokiLabelNamesRequest) Marshal

func (m *LokiLabelNamesRequest) Marshal() (dAtA []byte, err error)

func (*LokiLabelNamesRequest) MarshalTo

func (m *LokiLabelNamesRequest) MarshalTo(dAtA []byte) (int, error)

func (*LokiLabelNamesRequest) ProtoMessage

func (*LokiLabelNamesRequest) ProtoMessage()

func (*LokiLabelNamesRequest) Reset

func (m *LokiLabelNamesRequest) Reset()

func (*LokiLabelNamesRequest) Size

func (m *LokiLabelNamesRequest) Size() (n int)

func (*LokiLabelNamesRequest) String

func (this *LokiLabelNamesRequest) String() string

func (*LokiLabelNamesRequest) Unmarshal

func (m *LokiLabelNamesRequest) Unmarshal(dAtA []byte) error

func (*LokiLabelNamesRequest) WithQuery

func (r *LokiLabelNamesRequest) WithQuery(query string) queryrange.Request

func (*LokiLabelNamesRequest) WithStartEnd

func (r *LokiLabelNamesRequest) WithStartEnd(s int64, e int64) queryrange.Request

func (*LokiLabelNamesRequest) XXX_DiscardUnknown

func (m *LokiLabelNamesRequest) XXX_DiscardUnknown()

func (*LokiLabelNamesRequest) XXX_Marshal

func (m *LokiLabelNamesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LokiLabelNamesRequest) XXX_Merge

func (m *LokiLabelNamesRequest) XXX_Merge(src proto.Message)

func (*LokiLabelNamesRequest) XXX_Size

func (m *LokiLabelNamesRequest) XXX_Size() int

func (*LokiLabelNamesRequest) XXX_Unmarshal

func (m *LokiLabelNamesRequest) XXX_Unmarshal(b []byte) error

type LokiLabelNamesResponse

type LokiLabelNamesResponse struct {
	Status  string                                                                            `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"`
	Data    []string                                                                          `protobuf:"bytes,2,rep,name=Data,proto3" json:"data,omitempty"`
	Version uint32                                                                            `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"`
	Headers []github_com_cortexproject_cortex_pkg_querier_queryrange.PrometheusResponseHeader `` /* 142-byte string literal not displayed */
}

func (*LokiLabelNamesResponse) Descriptor

func (*LokiLabelNamesResponse) Descriptor() ([]byte, []int)

func (*LokiLabelNamesResponse) Equal

func (this *LokiLabelNamesResponse) Equal(that interface{}) bool

func (*LokiLabelNamesResponse) GetData

func (m *LokiLabelNamesResponse) GetData() []string

func (*LokiLabelNamesResponse) GetHeaders

func (*LokiLabelNamesResponse) GetStatus

func (m *LokiLabelNamesResponse) GetStatus() string

func (*LokiLabelNamesResponse) GetVersion

func (m *LokiLabelNamesResponse) GetVersion() uint32

func (*LokiLabelNamesResponse) GoString

func (this *LokiLabelNamesResponse) GoString() string

func (*LokiLabelNamesResponse) Marshal

func (m *LokiLabelNamesResponse) Marshal() (dAtA []byte, err error)

func (*LokiLabelNamesResponse) MarshalTo

func (m *LokiLabelNamesResponse) MarshalTo(dAtA []byte) (int, error)

func (*LokiLabelNamesResponse) ProtoMessage

func (*LokiLabelNamesResponse) ProtoMessage()

func (*LokiLabelNamesResponse) Reset

func (m *LokiLabelNamesResponse) Reset()

func (*LokiLabelNamesResponse) Size

func (m *LokiLabelNamesResponse) Size() (n int)

func (*LokiLabelNamesResponse) String

func (this *LokiLabelNamesResponse) String() string

func (*LokiLabelNamesResponse) Unmarshal

func (m *LokiLabelNamesResponse) Unmarshal(dAtA []byte) error

func (*LokiLabelNamesResponse) XXX_DiscardUnknown

func (m *LokiLabelNamesResponse) XXX_DiscardUnknown()

func (*LokiLabelNamesResponse) XXX_Marshal

func (m *LokiLabelNamesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LokiLabelNamesResponse) XXX_Merge

func (m *LokiLabelNamesResponse) XXX_Merge(src proto.Message)

func (*LokiLabelNamesResponse) XXX_Size

func (m *LokiLabelNamesResponse) XXX_Size() int

func (*LokiLabelNamesResponse) XXX_Unmarshal

func (m *LokiLabelNamesResponse) XXX_Unmarshal(b []byte) error

type LokiPromResponse

type LokiPromResponse struct {
	Response   *queryrange.PrometheusResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	Statistics stats.Result                   `protobuf:"bytes,2,opt,name=statistics,proto3" json:"statistics"`
}

LokiPromResponse wraps a Prometheus response with statistics.

func (*LokiPromResponse) Descriptor

func (*LokiPromResponse) Descriptor() ([]byte, []int)

func (*LokiPromResponse) Equal

func (this *LokiPromResponse) Equal(that interface{}) bool

func (*LokiPromResponse) GetHeaders

func (*LokiPromResponse) GetResponse

func (*LokiPromResponse) GetStatistics

func (m *LokiPromResponse) GetStatistics() stats.Result

func (*LokiPromResponse) GoString

func (this *LokiPromResponse) GoString() string

func (*LokiPromResponse) Marshal

func (m *LokiPromResponse) Marshal() (dAtA []byte, err error)

func (*LokiPromResponse) MarshalTo

func (m *LokiPromResponse) MarshalTo(dAtA []byte) (int, error)

func (*LokiPromResponse) ProtoMessage

func (*LokiPromResponse) ProtoMessage()

func (*LokiPromResponse) Reset

func (m *LokiPromResponse) Reset()

func (*LokiPromResponse) Size

func (m *LokiPromResponse) Size() (n int)

func (*LokiPromResponse) String

func (this *LokiPromResponse) String() string

func (*LokiPromResponse) Unmarshal

func (m *LokiPromResponse) Unmarshal(dAtA []byte) error

func (*LokiPromResponse) XXX_DiscardUnknown

func (m *LokiPromResponse) XXX_DiscardUnknown()

func (*LokiPromResponse) XXX_Marshal

func (m *LokiPromResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LokiPromResponse) XXX_Merge

func (m *LokiPromResponse) XXX_Merge(src proto.Message)

func (*LokiPromResponse) XXX_Size

func (m *LokiPromResponse) XXX_Size() int

func (*LokiPromResponse) XXX_Unmarshal

func (m *LokiPromResponse) XXX_Unmarshal(b []byte) error

type LokiRequest

type LokiRequest struct {
	Query     string             `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
	Limit     uint32             `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	Step      int64              `protobuf:"varint,3,opt,name=step,proto3" json:"step,omitempty"`
	StartTs   time.Time          `protobuf:"bytes,4,opt,name=startTs,proto3,stdtime" json:"startTs"`
	EndTs     time.Time          `protobuf:"bytes,5,opt,name=endTs,proto3,stdtime" json:"endTs"`
	Direction logproto.Direction `protobuf:"varint,6,opt,name=direction,proto3,enum=logproto.Direction" json:"direction,omitempty"`
	Path      string             `protobuf:"bytes,7,opt,name=path,proto3" json:"path,omitempty"`
	Shards    []string           `protobuf:"bytes,8,rep,name=shards,proto3" json:"shards"`
}

func ParamsToLokiRequest

func ParamsToLokiRequest(params logql.Params) *LokiRequest

func (*LokiRequest) Descriptor

func (*LokiRequest) Descriptor() ([]byte, []int)

func (*LokiRequest) Equal

func (this *LokiRequest) Equal(that interface{}) bool

func (*LokiRequest) GetCachingOptions

func (*LokiRequest) GetCachingOptions() (res queryrange.CachingOptions)

func (*LokiRequest) GetDirection

func (m *LokiRequest) GetDirection() logproto.Direction

func (*LokiRequest) GetEnd

func (r *LokiRequest) GetEnd() int64

func (*LokiRequest) GetEndTs

func (m *LokiRequest) GetEndTs() time.Time

func (*LokiRequest) GetLimit

func (m *LokiRequest) GetLimit() uint32

func (*LokiRequest) GetPath

func (m *LokiRequest) GetPath() string

func (*LokiRequest) GetQuery

func (m *LokiRequest) GetQuery() string

func (*LokiRequest) GetShards

func (m *LokiRequest) GetShards() []string

func (*LokiRequest) GetStart

func (r *LokiRequest) GetStart() int64

func (*LokiRequest) GetStartTs

func (m *LokiRequest) GetStartTs() time.Time

func (*LokiRequest) GetStep

func (m *LokiRequest) GetStep() int64

func (*LokiRequest) GoString

func (this *LokiRequest) GoString() string

func (*LokiRequest) LogToSpan

func (r *LokiRequest) LogToSpan(sp opentracing.Span)

func (*LokiRequest) Marshal

func (m *LokiRequest) Marshal() (dAtA []byte, err error)

func (*LokiRequest) MarshalTo

func (m *LokiRequest) MarshalTo(dAtA []byte) (int, error)

func (*LokiRequest) ProtoMessage

func (*LokiRequest) ProtoMessage()

func (*LokiRequest) Reset

func (m *LokiRequest) Reset()

func (*LokiRequest) Size

func (m *LokiRequest) Size() (n int)

func (*LokiRequest) String

func (this *LokiRequest) String() string

func (*LokiRequest) Unmarshal

func (m *LokiRequest) Unmarshal(dAtA []byte) error

func (*LokiRequest) WithQuery

func (r *LokiRequest) WithQuery(query string) queryrange.Request

func (*LokiRequest) WithShards

func (r *LokiRequest) WithShards(shards logql.Shards) *LokiRequest

func (*LokiRequest) WithStartEnd

func (r *LokiRequest) WithStartEnd(s int64, e int64) queryrange.Request

func (*LokiRequest) XXX_DiscardUnknown

func (m *LokiRequest) XXX_DiscardUnknown()

func (*LokiRequest) XXX_Marshal

func (m *LokiRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LokiRequest) XXX_Merge

func (m *LokiRequest) XXX_Merge(src proto.Message)

func (*LokiRequest) XXX_Size

func (m *LokiRequest) XXX_Size() int

func (*LokiRequest) XXX_Unmarshal

func (m *LokiRequest) XXX_Unmarshal(b []byte) error

type LokiResponse

type LokiResponse struct {
	Status     string                                                                            `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"`
	Data       LokiData                                                                          `protobuf:"bytes,2,opt,name=Data,proto3" json:"data,omitempty"`
	ErrorType  string                                                                            `protobuf:"bytes,3,opt,name=ErrorType,proto3" json:"errorType,omitempty"`
	Error      string                                                                            `protobuf:"bytes,4,opt,name=Error,proto3" json:"error,omitempty"`
	Direction  logproto.Direction                                                                `protobuf:"varint,5,opt,name=direction,proto3,enum=logproto.Direction" json:"direction,omitempty"`
	Limit      uint32                                                                            `protobuf:"varint,6,opt,name=limit,proto3" json:"limit,omitempty"`
	Version    uint32                                                                            `protobuf:"varint,7,opt,name=version,proto3" json:"version,omitempty"`
	Statistics stats.Result                                                                      `protobuf:"bytes,8,opt,name=statistics,proto3" json:"statistics"`
	Headers    []github_com_cortexproject_cortex_pkg_querier_queryrange.PrometheusResponseHeader `` /* 142-byte string literal not displayed */
}

func (LokiResponse) Count

func (res LokiResponse) Count() int64

func (*LokiResponse) Descriptor

func (*LokiResponse) Descriptor() ([]byte, []int)

func (*LokiResponse) Equal

func (this *LokiResponse) Equal(that interface{}) bool

func (*LokiResponse) GetData

func (m *LokiResponse) GetData() LokiData

func (*LokiResponse) GetDirection

func (m *LokiResponse) GetDirection() logproto.Direction

func (*LokiResponse) GetError

func (m *LokiResponse) GetError() string

func (*LokiResponse) GetErrorType

func (m *LokiResponse) GetErrorType() string

func (*LokiResponse) GetHeaders

func (*LokiResponse) GetLimit

func (m *LokiResponse) GetLimit() uint32

func (*LokiResponse) GetStatistics

func (m *LokiResponse) GetStatistics() stats.Result

func (*LokiResponse) GetStatus

func (m *LokiResponse) GetStatus() string

func (*LokiResponse) GetVersion

func (m *LokiResponse) GetVersion() uint32

func (*LokiResponse) GoString

func (this *LokiResponse) GoString() string

func (*LokiResponse) Marshal

func (m *LokiResponse) Marshal() (dAtA []byte, err error)

func (*LokiResponse) MarshalTo

func (m *LokiResponse) MarshalTo(dAtA []byte) (int, error)

func (*LokiResponse) ProtoMessage

func (*LokiResponse) ProtoMessage()

func (*LokiResponse) Reset

func (m *LokiResponse) Reset()

func (*LokiResponse) Size

func (m *LokiResponse) Size() (n int)

func (*LokiResponse) String

func (this *LokiResponse) String() string

func (*LokiResponse) Unmarshal

func (m *LokiResponse) Unmarshal(dAtA []byte) error

func (*LokiResponse) XXX_DiscardUnknown

func (m *LokiResponse) XXX_DiscardUnknown()

func (*LokiResponse) XXX_Marshal

func (m *LokiResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LokiResponse) XXX_Merge

func (m *LokiResponse) XXX_Merge(src proto.Message)

func (*LokiResponse) XXX_Size

func (m *LokiResponse) XXX_Size() int

func (*LokiResponse) XXX_Unmarshal

func (m *LokiResponse) XXX_Unmarshal(b []byte) error

type LokiSeriesRequest

type LokiSeriesRequest struct {
	Match   []string  `protobuf:"bytes,1,rep,name=match,proto3" json:"match,omitempty"`
	StartTs time.Time `protobuf:"bytes,2,opt,name=startTs,proto3,stdtime" json:"startTs"`
	EndTs   time.Time `protobuf:"bytes,3,opt,name=endTs,proto3,stdtime" json:"endTs"`
	Path    string    `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
}

func (*LokiSeriesRequest) Descriptor

func (*LokiSeriesRequest) Descriptor() ([]byte, []int)

func (*LokiSeriesRequest) Equal

func (this *LokiSeriesRequest) Equal(that interface{}) bool

func (*LokiSeriesRequest) GetCachingOptions

func (*LokiSeriesRequest) GetCachingOptions() (res queryrange.CachingOptions)

func (*LokiSeriesRequest) GetEnd

func (r *LokiSeriesRequest) GetEnd() int64

func (*LokiSeriesRequest) GetEndTs

func (m *LokiSeriesRequest) GetEndTs() time.Time

func (*LokiSeriesRequest) GetMatch

func (m *LokiSeriesRequest) GetMatch() []string

func (*LokiSeriesRequest) GetPath

func (m *LokiSeriesRequest) GetPath() string

func (*LokiSeriesRequest) GetQuery

func (r *LokiSeriesRequest) GetQuery() string

func (*LokiSeriesRequest) GetStart

func (r *LokiSeriesRequest) GetStart() int64

func (*LokiSeriesRequest) GetStartTs

func (m *LokiSeriesRequest) GetStartTs() time.Time

func (*LokiSeriesRequest) GetStep

func (r *LokiSeriesRequest) GetStep() int64

func (*LokiSeriesRequest) GoString

func (this *LokiSeriesRequest) GoString() string

func (*LokiSeriesRequest) LogToSpan

func (r *LokiSeriesRequest) LogToSpan(sp opentracing.Span)

func (*LokiSeriesRequest) Marshal

func (m *LokiSeriesRequest) Marshal() (dAtA []byte, err error)

func (*LokiSeriesRequest) MarshalTo

func (m *LokiSeriesRequest) MarshalTo(dAtA []byte) (int, error)

func (*LokiSeriesRequest) ProtoMessage

func (*LokiSeriesRequest) ProtoMessage()

func (*LokiSeriesRequest) Reset

func (m *LokiSeriesRequest) Reset()

func (*LokiSeriesRequest) Size

func (m *LokiSeriesRequest) Size() (n int)

func (*LokiSeriesRequest) String

func (this *LokiSeriesRequest) String() string

func (*LokiSeriesRequest) Unmarshal

func (m *LokiSeriesRequest) Unmarshal(dAtA []byte) error

func (*LokiSeriesRequest) WithQuery

func (r *LokiSeriesRequest) WithQuery(query string) queryrange.Request

func (*LokiSeriesRequest) WithStartEnd

func (r *LokiSeriesRequest) WithStartEnd(s int64, e int64) queryrange.Request

func (*LokiSeriesRequest) XXX_DiscardUnknown

func (m *LokiSeriesRequest) XXX_DiscardUnknown()

func (*LokiSeriesRequest) XXX_Marshal

func (m *LokiSeriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LokiSeriesRequest) XXX_Merge

func (m *LokiSeriesRequest) XXX_Merge(src proto.Message)

func (*LokiSeriesRequest) XXX_Size

func (m *LokiSeriesRequest) XXX_Size() int

func (*LokiSeriesRequest) XXX_Unmarshal

func (m *LokiSeriesRequest) XXX_Unmarshal(b []byte) error

type LokiSeriesResponse

type LokiSeriesResponse struct {
	Status  string                                                                            `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"`
	Data    []logproto.SeriesIdentifier                                                       `protobuf:"bytes,2,rep,name=Data,proto3" json:"data,omitempty"`
	Version uint32                                                                            `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"`
	Headers []github_com_cortexproject_cortex_pkg_querier_queryrange.PrometheusResponseHeader `` /* 142-byte string literal not displayed */
}

func (*LokiSeriesResponse) Descriptor

func (*LokiSeriesResponse) Descriptor() ([]byte, []int)

func (*LokiSeriesResponse) Equal

func (this *LokiSeriesResponse) Equal(that interface{}) bool

func (*LokiSeriesResponse) GetData

func (*LokiSeriesResponse) GetHeaders

func (*LokiSeriesResponse) GetStatus

func (m *LokiSeriesResponse) GetStatus() string

func (*LokiSeriesResponse) GetVersion

func (m *LokiSeriesResponse) GetVersion() uint32

func (*LokiSeriesResponse) GoString

func (this *LokiSeriesResponse) GoString() string

func (*LokiSeriesResponse) Marshal

func (m *LokiSeriesResponse) Marshal() (dAtA []byte, err error)

func (*LokiSeriesResponse) MarshalTo

func (m *LokiSeriesResponse) MarshalTo(dAtA []byte) (int, error)

func (*LokiSeriesResponse) ProtoMessage

func (*LokiSeriesResponse) ProtoMessage()

func (*LokiSeriesResponse) Reset

func (m *LokiSeriesResponse) Reset()

func (*LokiSeriesResponse) Size

func (m *LokiSeriesResponse) Size() (n int)

func (*LokiSeriesResponse) String

func (this *LokiSeriesResponse) String() string

func (*LokiSeriesResponse) Unmarshal

func (m *LokiSeriesResponse) Unmarshal(dAtA []byte) error

func (*LokiSeriesResponse) XXX_DiscardUnknown

func (m *LokiSeriesResponse) XXX_DiscardUnknown()

func (*LokiSeriesResponse) XXX_Marshal

func (m *LokiSeriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LokiSeriesResponse) XXX_Merge

func (m *LokiSeriesResponse) XXX_Merge(src proto.Message)

func (*LokiSeriesResponse) XXX_Size

func (m *LokiSeriesResponse) XXX_Size() int

func (*LokiSeriesResponse) XXX_Unmarshal

func (m *LokiSeriesResponse) XXX_Unmarshal(b []byte) error

type PrometheusExtractor

type PrometheusExtractor struct{}

PrometheusExtractor implements Extractor interface

func (PrometheusExtractor) Extract

func (PrometheusExtractor) Extract(start, end int64, from queryrange.Response) queryrange.Response

Extract wraps the original prometheus cache extractor

func (PrometheusExtractor) ResponseWithoutHeaders

func (PrometheusExtractor) ResponseWithoutHeaders(resp queryrange.Response) queryrange.Response

ResponseWithoutHeaders wraps the original prometheus caching without headers

type SplitByMetrics

type SplitByMetrics struct {
	// contains filtered or unexported fields
}

func NewSplitByMetrics

func NewSplitByMetrics(r prometheus.Registerer) *SplitByMetrics

type Splitter

type Splitter func(req queryrange.Request, interval time.Duration) []queryrange.Request

type Stopper

type Stopper interface {
	Stop()
}

Stopper gracefully shutdown resources created

func NewMetricTripperware

func NewMetricTripperware(
	cfg Config,
	log log.Logger,
	limits Limits,
	schema chunk.SchemaConfig,
	minShardingLookback time.Duration,
	codec queryrange.Codec,
	extractor queryrange.Extractor,
	instrumentMetrics *queryrange.InstrumentMiddlewareMetrics,
	retryMiddlewareMetrics *queryrange.RetryMiddlewareMetrics,
	shardingMetrics *logql.ShardingMetrics,
	splitByMetrics *SplitByMetrics,
	registerer prometheus.Registerer,
) (queryrange.Tripperware, Stopper, error)

NewMetricTripperware creates a new frontend tripperware responsible for handling metric queries

func NewTripperware

func NewTripperware(
	cfg Config,
	log log.Logger,
	limits Limits,
	schema chunk.SchemaConfig,
	minShardingLookback time.Duration,
	registerer prometheus.Registerer,
) (queryrange.Tripperware, Stopper, error)

NewTripperware returns a Tripperware configured with middlewares to align, split and cache requests.

Jump to

Keyboard shortcuts

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