queryrange

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 48 Imported by: 7

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 added in v1.6.0

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

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

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,
) (frontend.Tripperware, error)

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

func NewQueryShardMiddleware added in v1.6.0

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

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

func NewSeriesTripperware added in v1.6.0

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

NewSeriesripperware creates a new frontend tripperware responsible for handling series requests

func ResponseToResult added in v1.6.0

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

func SplitByIntervalMiddleware

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

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

func StatsCollectorMiddleware added in v1.4.0

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 added in v1.6.0

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

func (DownstreamHandler) Downstreamer added in v1.6.0

func (h DownstreamHandler) Downstreamer() logql.Downstreamer

type Limits added in v1.4.0

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

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

func WithDefaultLimits added in v1.4.0

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 added in v1.6.0

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,json=resultType,proto3" json:"resultType"`
	Result     []github_com_grafana_loki_pkg_logproto.Stream `protobuf:"bytes,2,rep,name=Result,json=result,proto3,customtype=github.com/grafana/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 added in v1.6.0

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 added in v1.6.0

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

func (*LokiLabelNamesRequest) Equal added in v1.6.0

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

func (*LokiLabelNamesRequest) GetEnd added in v1.6.0

func (r *LokiLabelNamesRequest) GetEnd() int64

func (*LokiLabelNamesRequest) GetEndTs added in v1.6.0

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

func (*LokiLabelNamesRequest) GetPath added in v1.6.0

func (m *LokiLabelNamesRequest) GetPath() string

func (*LokiLabelNamesRequest) GetQuery added in v1.6.0

func (r *LokiLabelNamesRequest) GetQuery() string

func (*LokiLabelNamesRequest) GetStart added in v1.6.0

func (r *LokiLabelNamesRequest) GetStart() int64

func (*LokiLabelNamesRequest) GetStartTs added in v1.6.0

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

func (*LokiLabelNamesRequest) GetStep added in v1.6.0

func (r *LokiLabelNamesRequest) GetStep() int64

func (*LokiLabelNamesRequest) GoString added in v1.6.0

func (this *LokiLabelNamesRequest) GoString() string

func (*LokiLabelNamesRequest) LogToSpan added in v1.6.0

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

func (*LokiLabelNamesRequest) Marshal added in v1.6.0

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

func (*LokiLabelNamesRequest) MarshalTo added in v1.6.0

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

func (*LokiLabelNamesRequest) ProtoMessage added in v1.6.0

func (*LokiLabelNamesRequest) ProtoMessage()

func (*LokiLabelNamesRequest) Reset added in v1.6.0

func (m *LokiLabelNamesRequest) Reset()

func (*LokiLabelNamesRequest) Size added in v1.6.0

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

func (*LokiLabelNamesRequest) String added in v1.6.0

func (this *LokiLabelNamesRequest) String() string

func (*LokiLabelNamesRequest) Unmarshal added in v1.6.0

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

func (*LokiLabelNamesRequest) WithQuery added in v1.6.0

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

func (*LokiLabelNamesRequest) WithStartEnd added in v1.6.0

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

func (*LokiLabelNamesRequest) XXX_DiscardUnknown added in v1.6.0

func (m *LokiLabelNamesRequest) XXX_DiscardUnknown()

func (*LokiLabelNamesRequest) XXX_Marshal added in v1.6.0

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

func (*LokiLabelNamesRequest) XXX_Merge added in v1.6.0

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

func (*LokiLabelNamesRequest) XXX_Size added in v1.6.0

func (m *LokiLabelNamesRequest) XXX_Size() int

func (*LokiLabelNamesRequest) XXX_Unmarshal added in v1.6.0

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

type LokiLabelNamesResponse added in v1.6.0

type LokiLabelNamesResponse struct {
	Status  string   `protobuf:"bytes,1,opt,name=Status,json=status,proto3" json:"status"`
	Data    []string `protobuf:"bytes,2,rep,name=Data,json=data,proto3" json:"data,omitempty"`
	Version uint32   `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"`
}

func (*LokiLabelNamesResponse) Descriptor added in v1.6.0

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

func (*LokiLabelNamesResponse) Equal added in v1.6.0

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

func (*LokiLabelNamesResponse) GetData added in v1.6.0

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

func (*LokiLabelNamesResponse) GetStatus added in v1.6.0

func (m *LokiLabelNamesResponse) GetStatus() string

func (*LokiLabelNamesResponse) GetVersion added in v1.6.0

func (m *LokiLabelNamesResponse) GetVersion() uint32

func (*LokiLabelNamesResponse) GoString added in v1.6.0

func (this *LokiLabelNamesResponse) GoString() string

func (*LokiLabelNamesResponse) Marshal added in v1.6.0

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

func (*LokiLabelNamesResponse) MarshalTo added in v1.6.0

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

func (*LokiLabelNamesResponse) ProtoMessage added in v1.6.0

func (*LokiLabelNamesResponse) ProtoMessage()

func (*LokiLabelNamesResponse) Reset added in v1.6.0

func (m *LokiLabelNamesResponse) Reset()

func (*LokiLabelNamesResponse) Size added in v1.6.0

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

func (*LokiLabelNamesResponse) String added in v1.6.0

func (this *LokiLabelNamesResponse) String() string

func (*LokiLabelNamesResponse) Unmarshal added in v1.6.0

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

func (*LokiLabelNamesResponse) XXX_DiscardUnknown added in v1.6.0

func (m *LokiLabelNamesResponse) XXX_DiscardUnknown()

func (*LokiLabelNamesResponse) XXX_Marshal added in v1.6.0

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

func (*LokiLabelNamesResponse) XXX_Merge added in v1.6.0

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

func (*LokiLabelNamesResponse) XXX_Size added in v1.6.0

func (m *LokiLabelNamesResponse) XXX_Size() int

func (*LokiLabelNamesResponse) XXX_Unmarshal added in v1.6.0

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

type LokiPromResponse added in v1.4.0

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 added in v1.4.0

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

func (*LokiPromResponse) Equal added in v1.4.0

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

func (*LokiPromResponse) GetResponse added in v1.4.0

func (*LokiPromResponse) GetStatistics added in v1.4.0

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

func (*LokiPromResponse) GoString added in v1.4.0

func (this *LokiPromResponse) GoString() string

func (*LokiPromResponse) Marshal added in v1.4.0

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

func (*LokiPromResponse) MarshalTo added in v1.4.0

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

func (*LokiPromResponse) ProtoMessage added in v1.4.0

func (*LokiPromResponse) ProtoMessage()

func (*LokiPromResponse) Reset added in v1.4.0

func (m *LokiPromResponse) Reset()

func (*LokiPromResponse) Size added in v1.4.0

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

func (*LokiPromResponse) String added in v1.4.0

func (this *LokiPromResponse) String() string

func (*LokiPromResponse) Unmarshal added in v1.4.0

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

func (*LokiPromResponse) XXX_DiscardUnknown added in v1.4.0

func (m *LokiPromResponse) XXX_DiscardUnknown()

func (*LokiPromResponse) XXX_Marshal added in v1.4.0

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

func (*LokiPromResponse) XXX_Merge added in v1.4.0

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

func (*LokiPromResponse) XXX_Size added in v1.4.0

func (m *LokiPromResponse) XXX_Size() int

func (*LokiPromResponse) XXX_Unmarshal added in v1.4.0

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 added in v1.6.0

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) 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 added in v1.6.0

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 added in v1.6.0

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 added in v1.4.0

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

func (*LokiRequest) WithShards added in v1.6.0

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,json=status,proto3" json:"status"`
	Data       LokiData           `protobuf:"bytes,2,opt,name=Data,json=data,proto3" json:"data,omitempty"`
	ErrorType  string             `protobuf:"bytes,3,opt,name=ErrorType,json=errorType,proto3" json:"errorType,omitempty"`
	Error      string             `protobuf:"bytes,4,opt,name=Error,json=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"`
}

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) GetLimit

func (m *LokiResponse) GetLimit() uint32

func (*LokiResponse) GetStatistics added in v1.4.0

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 added in v1.6.0

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 added in v1.6.0

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

func (*LokiSeriesRequest) Equal added in v1.6.0

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

func (*LokiSeriesRequest) GetEnd added in v1.6.0

func (r *LokiSeriesRequest) GetEnd() int64

func (*LokiSeriesRequest) GetEndTs added in v1.6.0

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

func (*LokiSeriesRequest) GetMatch added in v1.6.0

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

func (*LokiSeriesRequest) GetPath added in v1.6.0

func (m *LokiSeriesRequest) GetPath() string

func (*LokiSeriesRequest) GetQuery added in v1.6.0

func (r *LokiSeriesRequest) GetQuery() string

func (*LokiSeriesRequest) GetStart added in v1.6.0

func (r *LokiSeriesRequest) GetStart() int64

func (*LokiSeriesRequest) GetStartTs added in v1.6.0

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

func (*LokiSeriesRequest) GetStep added in v1.6.0

func (r *LokiSeriesRequest) GetStep() int64

func (*LokiSeriesRequest) GoString added in v1.6.0

func (this *LokiSeriesRequest) GoString() string

func (*LokiSeriesRequest) LogToSpan added in v1.6.0

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

func (*LokiSeriesRequest) Marshal added in v1.6.0

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

func (*LokiSeriesRequest) MarshalTo added in v1.6.0

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

func (*LokiSeriesRequest) ProtoMessage added in v1.6.0

func (*LokiSeriesRequest) ProtoMessage()

func (*LokiSeriesRequest) Reset added in v1.6.0

func (m *LokiSeriesRequest) Reset()

func (*LokiSeriesRequest) Size added in v1.6.0

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

func (*LokiSeriesRequest) String added in v1.6.0

func (this *LokiSeriesRequest) String() string

func (*LokiSeriesRequest) Unmarshal added in v1.6.0

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

func (*LokiSeriesRequest) WithQuery added in v1.6.0

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

func (*LokiSeriesRequest) WithStartEnd added in v1.6.0

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

func (*LokiSeriesRequest) XXX_DiscardUnknown added in v1.6.0

func (m *LokiSeriesRequest) XXX_DiscardUnknown()

func (*LokiSeriesRequest) XXX_Marshal added in v1.6.0

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

func (*LokiSeriesRequest) XXX_Merge added in v1.6.0

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

func (*LokiSeriesRequest) XXX_Size added in v1.6.0

func (m *LokiSeriesRequest) XXX_Size() int

func (*LokiSeriesRequest) XXX_Unmarshal added in v1.6.0

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

type LokiSeriesResponse added in v1.6.0

type LokiSeriesResponse struct {
	Status  string                      `protobuf:"bytes,1,opt,name=Status,json=status,proto3" json:"status"`
	Data    []logproto.SeriesIdentifier `protobuf:"bytes,2,rep,name=Data,json=data,proto3" json:"data,omitempty"`
	Version uint32                      `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"`
}

func (*LokiSeriesResponse) Descriptor added in v1.6.0

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

func (*LokiSeriesResponse) Equal added in v1.6.0

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

func (*LokiSeriesResponse) GetData added in v1.6.0

func (*LokiSeriesResponse) GetStatus added in v1.6.0

func (m *LokiSeriesResponse) GetStatus() string

func (*LokiSeriesResponse) GetVersion added in v1.6.0

func (m *LokiSeriesResponse) GetVersion() uint32

func (*LokiSeriesResponse) GoString added in v1.6.0

func (this *LokiSeriesResponse) GoString() string

func (*LokiSeriesResponse) Marshal added in v1.6.0

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

func (*LokiSeriesResponse) MarshalTo added in v1.6.0

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

func (*LokiSeriesResponse) ProtoMessage added in v1.6.0

func (*LokiSeriesResponse) ProtoMessage()

func (*LokiSeriesResponse) Reset added in v1.6.0

func (m *LokiSeriesResponse) Reset()

func (*LokiSeriesResponse) Size added in v1.6.0

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

func (*LokiSeriesResponse) String added in v1.6.0

func (this *LokiSeriesResponse) String() string

func (*LokiSeriesResponse) Unmarshal added in v1.6.0

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

func (*LokiSeriesResponse) XXX_DiscardUnknown added in v1.6.0

func (m *LokiSeriesResponse) XXX_DiscardUnknown()

func (*LokiSeriesResponse) XXX_Marshal added in v1.6.0

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

func (*LokiSeriesResponse) XXX_Merge added in v1.6.0

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

func (*LokiSeriesResponse) XXX_Size added in v1.6.0

func (m *LokiSeriesResponse) XXX_Size() int

func (*LokiSeriesResponse) XXX_Unmarshal added in v1.6.0

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

type PrometheusExtractor added in v1.5.0

type PrometheusExtractor struct{}

PrometheusExtractor implements Extractor interface

func (PrometheusExtractor) Extract added in v1.5.0

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

Extract wraps the original prometheus cache extractor

func (PrometheusExtractor) ResponseWithoutHeaders added in v1.5.0

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

ResponseWithoutHeaders wraps the original prometheus caching without headers

type SplitByMetrics added in v1.6.0

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

func NewSplitByMetrics added in v1.6.0

func NewSplitByMetrics(r prometheus.Registerer) *SplitByMetrics

type Stopper

type Stopper interface {
	Stop()
}

Stopper gracefully shutdown resources created

func NewMetricTripperware added in v1.4.0

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,
) (frontend.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,
) (frontend.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