Versions in this module Expand all Collapse all v2 v2.6.2 Aug 12, 2022 Changes in this version + const DefaultDownstreamConcurrency + const IndexStatsOp + const InstantQueryOp + const LabelNamesOp + const QueryRangeOp + const SeriesOp + var ErrIntOverflowQueryrange = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthQueryrange = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrMaxQueryParalellism = fmt.Errorf("querying is disabled, please contact your Loki operator") + var LokiCodec = &Codec + var StatsHTTPMiddleware middleware.Interface = statsHTTPMiddleware(defaultMetricRecorder) + func NewEmptyResponse(r queryrangebase.Request) (queryrangebase.Response, error) + func NewInstantMetricTripperware(cfg Config, log log.Logger, limits Limits, schema config.SchemaConfig, ...) (queryrangebase.Tripperware, error) + func NewLabelsTripperware(cfg Config, log log.Logger, limits Limits, codec queryrangebase.Codec, ...) (queryrangebase.Tripperware, error) + func NewLimitedRoundTripper(next http.RoundTripper, codec queryrangebase.Codec, limits Limits, ...) http.RoundTripper + func NewLimitsMiddleware(l Limits) queryrangebase.Middleware + func NewLogFilterTripperware(cfg Config, log log.Logger, limits Limits, schema config.SchemaConfig, ...) (queryrangebase.Tripperware, error) + func NewLogResultCache(logger log.Logger, limits Limits, cache cache.Cache, ...) queryrangebase.Middleware + func NewMetricTripperware(cfg Config, log log.Logger, limits Limits, schema config.SchemaConfig, ...) (queryrangebase.Tripperware, error) + func NewQueryShardMiddleware(logger log.Logger, confs ShardingConfigs, ...) queryrangebase.Middleware + func NewSeriesQueryShardMiddleware(logger log.Logger, confs ShardingConfigs, ...) queryrangebase.Middleware + func NewSeriesTripperware(cfg Config, log log.Logger, limits Limits, codec queryrangebase.Codec, ...) (queryrangebase.Tripperware, error) + func NewSplitByRangeMiddleware(logger log.Logger, limits Limits, metrics *logql.MapperMetrics) queryrangebase.Middleware + func ParamsToLokiRequest(params logql.Params, shards logql.Shards) queryrangebase.Request + func ResponseToResult(resp queryrangebase.Response) (logqlmodel.Result, error) + func SplitByIntervalMiddleware(limits Limits, merger queryrangebase.Merger, splitter Splitter, ...) queryrangebase.Middleware + func StatsCollectorMiddleware() queryrangebase.Middleware + type Buffer interface + Bytes func() []byte + type Codec struct + func (Codec) DecodeRequest(_ context.Context, r *http.Request, forwardHeaders []string) (queryrangebase.Request, error) + func (Codec) DecodeResponse(ctx context.Context, r *http.Response, req queryrangebase.Request) (queryrangebase.Response, error) + func (Codec) EncodeRequest(ctx context.Context, r queryrangebase.Request) (*http.Request, error) + func (Codec) EncodeResponse(ctx context.Context, res queryrangebase.Response) (*http.Response, error) + func (Codec) MergeResponse(responses ...queryrangebase.Response) (queryrangebase.Response, error) + type Config struct + func (cfg *Config) RegisterFlags(f *flag.FlagSet) + type DownstreamHandler struct + func (h DownstreamHandler) Downstreamer(ctx context.Context) logql.Downstreamer + type IndexStatsResponse struct + Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader + Response *github_com_grafana_loki_pkg_logproto.IndexStatsResponse + func (*IndexStatsResponse) Descriptor() ([]byte, []int) + func (*IndexStatsResponse) ProtoMessage() + func (m *IndexStatsResponse) GetHeaders() []*queryrangebase.PrometheusResponseHeader + func (m *IndexStatsResponse) Marshal() (dAtA []byte, err error) + func (m *IndexStatsResponse) MarshalTo(dAtA []byte) (int, error) + func (m *IndexStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *IndexStatsResponse) Reset() + func (m *IndexStatsResponse) Size() (n int) + func (m *IndexStatsResponse) Unmarshal(dAtA []byte) error + func (m *IndexStatsResponse) XXX_DiscardUnknown() + func (m *IndexStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *IndexStatsResponse) XXX_Merge(src proto.Message) + func (m *IndexStatsResponse) XXX_Size() int + func (m *IndexStatsResponse) XXX_Unmarshal(b []byte) error + func (this *IndexStatsResponse) Equal(that interface{}) bool + func (this *IndexStatsResponse) GoString() string + func (this *IndexStatsResponse) String() string + type Limits interface + MaxEntriesLimitPerQuery func(string) int + MaxQuerySeries func(string) int + MinShardingLookback func(string) time.Duration + QuerySplitDuration func(string) time.Duration + func WithSplitByLimits(l Limits, splitBy time.Duration) Limits + type LogResultCacheMetrics struct + CacheHit prometheus.Counter + CacheMiss prometheus.Counter + func NewLogResultCacheMetrics(registerer prometheus.Registerer) *LogResultCacheMetrics + type LokiData struct + Result []github_com_grafana_loki_pkg_logproto.Stream + ResultType string + func (*LokiData) Descriptor() ([]byte, []int) + func (*LokiData) ProtoMessage() + func (m *LokiData) GetResultType() string + func (m *LokiData) Marshal() (dAtA []byte, err error) + func (m *LokiData) MarshalTo(dAtA []byte) (int, error) + func (m *LokiData) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *LokiData) Reset() + func (m *LokiData) Size() (n int) + func (m *LokiData) Unmarshal(dAtA []byte) error + func (m *LokiData) XXX_DiscardUnknown() + func (m *LokiData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *LokiData) XXX_Merge(src proto.Message) + func (m *LokiData) XXX_Size() int + func (m *LokiData) XXX_Unmarshal(b []byte) error + func (this *LokiData) Equal(that interface{}) bool + func (this *LokiData) GoString() string + func (this *LokiData) String() string + type LokiInstantRequest struct + Direction logproto.Direction + Limit uint32 + Path string + Query string + Shards []string + TimeTs time.Time + func (*LokiInstantRequest) Descriptor() ([]byte, []int) + func (*LokiInstantRequest) GetCachingOptions() (res queryrangebase.CachingOptions) + func (*LokiInstantRequest) ProtoMessage() + func (m *LokiInstantRequest) GetDirection() logproto.Direction + func (m *LokiInstantRequest) GetLimit() uint32 + func (m *LokiInstantRequest) GetPath() string + func (m *LokiInstantRequest) GetQuery() string + func (m *LokiInstantRequest) GetShards() []string + func (m *LokiInstantRequest) GetTimeTs() time.Time + func (m *LokiInstantRequest) Marshal() (dAtA []byte, err error) + func (m *LokiInstantRequest) MarshalTo(dAtA []byte) (int, error) + func (m *LokiInstantRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *LokiInstantRequest) Reset() + func (m *LokiInstantRequest) Size() (n int) + func (m *LokiInstantRequest) Unmarshal(dAtA []byte) error + func (m *LokiInstantRequest) XXX_DiscardUnknown() + func (m *LokiInstantRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *LokiInstantRequest) XXX_Merge(src proto.Message) + func (m *LokiInstantRequest) XXX_Size() int + func (m *LokiInstantRequest) XXX_Unmarshal(b []byte) error + func (r *LokiInstantRequest) GetEnd() int64 + func (r *LokiInstantRequest) GetStart() int64 + func (r *LokiInstantRequest) GetStep() int64 + func (r *LokiInstantRequest) LogToSpan(sp opentracing.Span) + func (r *LokiInstantRequest) WithQuery(query string) queryrangebase.Request + func (r *LokiInstantRequest) WithShards(shards logql.Shards) *LokiInstantRequest + func (r *LokiInstantRequest) WithStartEnd(s int64, e int64) queryrangebase.Request + func (this *LokiInstantRequest) Equal(that interface{}) bool + func (this *LokiInstantRequest) GoString() string + func (this *LokiInstantRequest) String() string + type LokiLabelNamesRequest struct + EndTs time.Time + Path string + StartTs time.Time + func (*LokiLabelNamesRequest) Descriptor() ([]byte, []int) + func (*LokiLabelNamesRequest) GetCachingOptions() (res queryrangebase.CachingOptions) + func (*LokiLabelNamesRequest) ProtoMessage() + func (m *LokiLabelNamesRequest) GetEndTs() time.Time + func (m *LokiLabelNamesRequest) GetPath() string + func (m *LokiLabelNamesRequest) GetStartTs() time.Time + func (m *LokiLabelNamesRequest) Marshal() (dAtA []byte, err error) + func (m *LokiLabelNamesRequest) MarshalTo(dAtA []byte) (int, error) + func (m *LokiLabelNamesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *LokiLabelNamesRequest) Reset() + func (m *LokiLabelNamesRequest) Size() (n int) + func (m *LokiLabelNamesRequest) Unmarshal(dAtA []byte) error + func (m *LokiLabelNamesRequest) XXX_DiscardUnknown() + func (m *LokiLabelNamesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *LokiLabelNamesRequest) XXX_Merge(src proto.Message) + func (m *LokiLabelNamesRequest) XXX_Size() int + func (m *LokiLabelNamesRequest) XXX_Unmarshal(b []byte) error + func (r *LokiLabelNamesRequest) GetEnd() int64 + func (r *LokiLabelNamesRequest) GetQuery() string + func (r *LokiLabelNamesRequest) GetStart() int64 + func (r *LokiLabelNamesRequest) GetStep() int64 + func (r *LokiLabelNamesRequest) LogToSpan(sp opentracing.Span) + func (r *LokiLabelNamesRequest) WithQuery(query string) queryrangebase.Request + func (r *LokiLabelNamesRequest) WithStartEnd(s int64, e int64) queryrangebase.Request + func (this *LokiLabelNamesRequest) Equal(that interface{}) bool + func (this *LokiLabelNamesRequest) GoString() string + func (this *LokiLabelNamesRequest) String() string + type LokiLabelNamesResponse struct + Data []string + Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader + Statistics stats.Result + Status string + Version uint32 + func (*LokiLabelNamesResponse) Descriptor() ([]byte, []int) + func (*LokiLabelNamesResponse) ProtoMessage() + func (m *LokiLabelNamesResponse) GetData() []string + func (m *LokiLabelNamesResponse) GetHeaders() []*queryrangebase.PrometheusResponseHeader + func (m *LokiLabelNamesResponse) GetStatistics() stats.Result + func (m *LokiLabelNamesResponse) GetStatus() string + func (m *LokiLabelNamesResponse) GetVersion() uint32 + func (m *LokiLabelNamesResponse) Marshal() (dAtA []byte, err error) + func (m *LokiLabelNamesResponse) MarshalTo(dAtA []byte) (int, error) + func (m *LokiLabelNamesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *LokiLabelNamesResponse) Reset() + func (m *LokiLabelNamesResponse) Size() (n int) + func (m *LokiLabelNamesResponse) Unmarshal(dAtA []byte) error + func (m *LokiLabelNamesResponse) XXX_DiscardUnknown() + func (m *LokiLabelNamesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *LokiLabelNamesResponse) XXX_Merge(src proto.Message) + func (m *LokiLabelNamesResponse) XXX_Size() int + func (m *LokiLabelNamesResponse) XXX_Unmarshal(b []byte) error + func (this *LokiLabelNamesResponse) Equal(that interface{}) bool + func (this *LokiLabelNamesResponse) GoString() string + func (this *LokiLabelNamesResponse) String() string + type LokiPromResponse struct + Response *queryrangebase.PrometheusResponse + Statistics stats.Result + func (*LokiPromResponse) Descriptor() ([]byte, []int) + func (*LokiPromResponse) ProtoMessage() + func (m *LokiPromResponse) GetHeaders() []*queryrangebase.PrometheusResponseHeader + func (m *LokiPromResponse) GetResponse() *queryrangebase.PrometheusResponse + func (m *LokiPromResponse) GetStatistics() stats.Result + func (m *LokiPromResponse) Marshal() (dAtA []byte, err error) + func (m *LokiPromResponse) MarshalTo(dAtA []byte) (int, error) + func (m *LokiPromResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *LokiPromResponse) Reset() + func (m *LokiPromResponse) Size() (n int) + func (m *LokiPromResponse) Unmarshal(dAtA []byte) error + func (m *LokiPromResponse) XXX_DiscardUnknown() + func (m *LokiPromResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *LokiPromResponse) XXX_Merge(src proto.Message) + func (m *LokiPromResponse) XXX_Size() int + func (m *LokiPromResponse) XXX_Unmarshal(b []byte) error + func (this *LokiPromResponse) Equal(that interface{}) bool + func (this *LokiPromResponse) GoString() string + func (this *LokiPromResponse) String() string + type LokiRequest struct + Direction logproto.Direction + EndTs time.Time + Interval int64 + Limit uint32 + Path string + Query string + Shards []string + StartTs time.Time + Step int64 + func (*LokiRequest) Descriptor() ([]byte, []int) + func (*LokiRequest) GetCachingOptions() (res queryrangebase.CachingOptions) + func (*LokiRequest) ProtoMessage() + func (m *LokiRequest) GetDirection() logproto.Direction + func (m *LokiRequest) GetEndTs() time.Time + func (m *LokiRequest) GetInterval() int64 + func (m *LokiRequest) GetLimit() uint32 + func (m *LokiRequest) GetPath() string + func (m *LokiRequest) GetQuery() string + func (m *LokiRequest) GetShards() []string + func (m *LokiRequest) GetStartTs() time.Time + func (m *LokiRequest) GetStep() int64 + func (m *LokiRequest) Marshal() (dAtA []byte, err error) + func (m *LokiRequest) MarshalTo(dAtA []byte) (int, error) + func (m *LokiRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *LokiRequest) Reset() + func (m *LokiRequest) Size() (n int) + func (m *LokiRequest) Unmarshal(dAtA []byte) error + func (m *LokiRequest) XXX_DiscardUnknown() + func (m *LokiRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *LokiRequest) XXX_Merge(src proto.Message) + func (m *LokiRequest) XXX_Size() int + func (m *LokiRequest) XXX_Unmarshal(b []byte) error + func (r *LokiRequest) GetEnd() int64 + func (r *LokiRequest) GetStart() int64 + func (r *LokiRequest) LogToSpan(sp opentracing.Span) + func (r *LokiRequest) WithQuery(query string) queryrangebase.Request + func (r *LokiRequest) WithShards(shards logql.Shards) *LokiRequest + func (r *LokiRequest) WithStartEnd(s int64, e int64) queryrangebase.Request + func (r *LokiRequest) WithStartEndTime(s time.Time, e time.Time) *LokiRequest + func (this *LokiRequest) Equal(that interface{}) bool + func (this *LokiRequest) GoString() string + func (this *LokiRequest) String() string + type LokiResponse struct + Data LokiData + Direction logproto.Direction + Error string + ErrorType string + Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader + Limit uint32 + Statistics stats.Result + Status string + Version uint32 + func (*LokiResponse) Descriptor() ([]byte, []int) + func (*LokiResponse) ProtoMessage() + func (m *LokiResponse) GetData() LokiData + func (m *LokiResponse) GetDirection() logproto.Direction + func (m *LokiResponse) GetError() string + func (m *LokiResponse) GetErrorType() string + func (m *LokiResponse) GetHeaders() []*queryrangebase.PrometheusResponseHeader + func (m *LokiResponse) GetLimit() uint32 + func (m *LokiResponse) GetStatistics() stats.Result + func (m *LokiResponse) GetStatus() string + func (m *LokiResponse) GetVersion() uint32 + func (m *LokiResponse) Marshal() (dAtA []byte, err error) + func (m *LokiResponse) MarshalTo(dAtA []byte) (int, error) + func (m *LokiResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *LokiResponse) Reset() + func (m *LokiResponse) Size() (n int) + func (m *LokiResponse) Unmarshal(dAtA []byte) error + func (m *LokiResponse) XXX_DiscardUnknown() + func (m *LokiResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *LokiResponse) XXX_Merge(src proto.Message) + func (m *LokiResponse) XXX_Size() int + func (m *LokiResponse) XXX_Unmarshal(b []byte) error + func (res LokiResponse) Count() int64 + func (this *LokiResponse) Equal(that interface{}) bool + func (this *LokiResponse) GoString() string + func (this *LokiResponse) String() string + type LokiSeriesRequest struct + EndTs time.Time + Match []string + Path string + Shards []string + StartTs time.Time + func (*LokiSeriesRequest) Descriptor() ([]byte, []int) + func (*LokiSeriesRequest) GetCachingOptions() (res queryrangebase.CachingOptions) + func (*LokiSeriesRequest) ProtoMessage() + func (m *LokiSeriesRequest) GetEndTs() time.Time + func (m *LokiSeriesRequest) GetMatch() []string + func (m *LokiSeriesRequest) GetPath() string + func (m *LokiSeriesRequest) GetShards() []string + func (m *LokiSeriesRequest) GetStartTs() time.Time + func (m *LokiSeriesRequest) Marshal() (dAtA []byte, err error) + func (m *LokiSeriesRequest) MarshalTo(dAtA []byte) (int, error) + func (m *LokiSeriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *LokiSeriesRequest) Reset() + func (m *LokiSeriesRequest) Size() (n int) + func (m *LokiSeriesRequest) Unmarshal(dAtA []byte) error + func (m *LokiSeriesRequest) XXX_DiscardUnknown() + func (m *LokiSeriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *LokiSeriesRequest) XXX_Merge(src proto.Message) + func (m *LokiSeriesRequest) XXX_Size() int + func (m *LokiSeriesRequest) XXX_Unmarshal(b []byte) error + func (r *LokiSeriesRequest) GetEnd() int64 + func (r *LokiSeriesRequest) GetQuery() string + func (r *LokiSeriesRequest) GetStart() int64 + func (r *LokiSeriesRequest) GetStep() int64 + func (r *LokiSeriesRequest) LogToSpan(sp opentracing.Span) + func (r *LokiSeriesRequest) WithQuery(query string) queryrangebase.Request + func (r *LokiSeriesRequest) WithStartEnd(s int64, e int64) queryrangebase.Request + func (this *LokiSeriesRequest) Equal(that interface{}) bool + func (this *LokiSeriesRequest) GoString() string + func (this *LokiSeriesRequest) String() string + type LokiSeriesResponse struct + Data []logproto.SeriesIdentifier + Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase_definitions.PrometheusResponseHeader + Statistics stats.Result + Status string + Version uint32 + func (*LokiSeriesResponse) Descriptor() ([]byte, []int) + func (*LokiSeriesResponse) ProtoMessage() + func (m *LokiSeriesResponse) GetData() []logproto.SeriesIdentifier + func (m *LokiSeriesResponse) GetHeaders() []*queryrangebase.PrometheusResponseHeader + func (m *LokiSeriesResponse) GetStatistics() stats.Result + func (m *LokiSeriesResponse) GetStatus() string + func (m *LokiSeriesResponse) GetVersion() uint32 + func (m *LokiSeriesResponse) Marshal() (dAtA []byte, err error) + func (m *LokiSeriesResponse) MarshalTo(dAtA []byte) (int, error) + func (m *LokiSeriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *LokiSeriesResponse) Reset() + func (m *LokiSeriesResponse) Size() (n int) + func (m *LokiSeriesResponse) Unmarshal(dAtA []byte) error + func (m *LokiSeriesResponse) XXX_DiscardUnknown() + func (m *LokiSeriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *LokiSeriesResponse) XXX_Merge(src proto.Message) + func (m *LokiSeriesResponse) XXX_Size() int + func (m *LokiSeriesResponse) XXX_Unmarshal(b []byte) error + func (this *LokiSeriesResponse) Equal(that interface{}) bool + func (this *LokiSeriesResponse) GoString() string + func (this *LokiSeriesResponse) String() string + type Metrics struct + func NewMetrics(registerer prometheus.Registerer) *Metrics + type MiddlewareMapperMetrics struct + func NewMiddlewareMapperMetrics(registerer prometheus.Registerer) *MiddlewareMapperMetrics + type PrometheusExtractor struct + func (PrometheusExtractor) Extract(start, end int64, from queryrangebase.Response) queryrangebase.Response + func (PrometheusExtractor) ResponseWithoutHeaders(resp queryrangebase.Response) queryrangebase.Response + type ShardingConfigs []config.PeriodConfig + func (confs ShardingConfigs) GetConf(r queryrangebase.Request) (config.PeriodConfig, error) + func (confs ShardingConfigs) ValidRange(start, end int64) (config.PeriodConfig, error) + type SplitByMetrics struct + func NewSplitByMetrics(r prometheus.Registerer) *SplitByMetrics + type Splitter func(req queryrangebase.Request, interval time.Duration) ([]queryrangebase.Request, error) + type Stopper interface + Stop func() + func NewTripperware(cfg Config, log log.Logger, limits Limits, schema config.SchemaConfig, ...) (queryrangebase.Tripperware, Stopper, error)