Versions in this module Expand all Collapse all v2 v2.5.2 Apr 27, 2022 Changes in this version + const StatusSuccess + var ErrIntOverflowQueryrange = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthQueryrange = fmt.Errorf("proto: negative length found during unmarshaling") + var PassthroughMiddleware = MiddlewareFunc(func(next Handler) Handler { ... }) + var ResultsCacheGenNumberHeaderName = "Results-Cache-Gen-Number" + var StepAlignMiddleware = MiddlewareFunc(func(next Handler) Handler { ... }) + func NewRoundTripper(next http.RoundTripper, codec Codec, headers []string, ...) http.RoundTripper + func NewSeriesSet(results []SampleStream) storage.SeriesSet + type Buffer interface + Bytes func() []byte + type CacheGenNumberLoader interface + GetResultsCacheGenNumber func(tenantIDs []string) string + type CacheSplitter interface + GenerateCacheKey func(userID string, r Request) string + type CachedResponse struct + Extents []Extent + Key string + func (*CachedResponse) Descriptor() ([]byte, []int) + func (*CachedResponse) ProtoMessage() + func (m *CachedResponse) GetExtents() []Extent + func (m *CachedResponse) GetKey() string + func (m *CachedResponse) Marshal() (dAtA []byte, err error) + func (m *CachedResponse) MarshalTo(dAtA []byte) (int, error) + func (m *CachedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *CachedResponse) Reset() + func (m *CachedResponse) Size() (n int) + func (m *CachedResponse) Unmarshal(dAtA []byte) error + func (m *CachedResponse) XXX_DiscardUnknown() + func (m *CachedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *CachedResponse) XXX_Merge(src proto.Message) + func (m *CachedResponse) XXX_Size() int + func (m *CachedResponse) XXX_Unmarshal(b []byte) error + func (this *CachedResponse) Equal(that interface{}) bool + func (this *CachedResponse) GoString() string + func (this *CachedResponse) String() string + type CachingOptions struct + Disabled bool + func (*CachingOptions) Descriptor() ([]byte, []int) + func (*CachingOptions) ProtoMessage() + func (m *CachingOptions) GetDisabled() bool + func (m *CachingOptions) Marshal() (dAtA []byte, err error) + func (m *CachingOptions) MarshalTo(dAtA []byte) (int, error) + func (m *CachingOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *CachingOptions) Reset() + func (m *CachingOptions) Size() (n int) + func (m *CachingOptions) Unmarshal(dAtA []byte) error + func (m *CachingOptions) XXX_DiscardUnknown() + func (m *CachingOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *CachingOptions) XXX_Merge(src proto.Message) + func (m *CachingOptions) XXX_Size() int + func (m *CachingOptions) XXX_Unmarshal(b []byte) error + func (this *CachingOptions) Equal(that interface{}) bool + func (this *CachingOptions) GoString() string + func (this *CachingOptions) String() string + type Codec interface + DecodeRequest func(_ context.Context, request *http.Request, forwardHeaders []string) (Request, error) + DecodeResponse func(context.Context, *http.Response, Request) (Response, error) + EncodeRequest func(context.Context, Request) (*http.Request, error) + EncodeResponse func(context.Context, Response) (*http.Response, error) + var PrometheusCodec Codec = &prometheusCodec{} + type Config struct + AlignQueriesWithStep bool + CacheResults bool + ForwardHeaders flagext.StringSlice + MaxRetries int + ShardedQueries bool + SplitQueriesByInterval time.Duration + func (cfg *Config) RegisterFlags(f *flag.FlagSet) + func (cfg *Config) Validate() error + type Extent struct + End int64 + Response *types.Any + Start int64 + TraceId string + func (*Extent) Descriptor() ([]byte, []int) + func (*Extent) ProtoMessage() + func (m *Extent) GetEnd() int64 + func (m *Extent) GetResponse() *types.Any + func (m *Extent) GetStart() int64 + func (m *Extent) GetTraceId() string + func (m *Extent) Marshal() (dAtA []byte, err error) + func (m *Extent) MarshalTo(dAtA []byte) (int, error) + func (m *Extent) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *Extent) Reset() + func (m *Extent) Size() (n int) + func (m *Extent) Unmarshal(dAtA []byte) error + func (m *Extent) XXX_DiscardUnknown() + func (m *Extent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Extent) XXX_Merge(src proto.Message) + func (m *Extent) XXX_Size() int + func (m *Extent) XXX_Unmarshal(b []byte) error + func (this *Extent) Equal(that interface{}) bool + func (this *Extent) GoString() string + func (this *Extent) String() string + type Extractor interface + Extract func(start, end int64, from Response) Response + ResponseWithoutHeaders func(resp Response) Response + type Handler interface + Do func(context.Context, Request) (Response, error) + type HandlerFunc func(context.Context, Request) (Response, error) + func (q HandlerFunc) Do(ctx context.Context, req Request) (Response, error) + type InstrumentMiddlewareMetrics struct + func NewInstrumentMiddlewareMetrics(registerer prometheus.Registerer) *InstrumentMiddlewareMetrics + type Limits interface + MaxCacheFreshness func(string) time.Duration + MaxQueryLength func(string) time.Duration + MaxQueryLookback func(userID string) time.Duration + MaxQueryParallelism func(string) int + type Merger interface + MergeResponse func(...Response) (Response, error) + type Middleware interface + Wrap func(Handler) Handler + func InstrumentMiddleware(name string, metrics *InstrumentMiddlewareMetrics) Middleware + func MergeMiddlewares(middleware ...Middleware) Middleware + func NewResultsCacheMiddleware(logger log.Logger, c cache.Cache, splitter CacheSplitter, limits Limits, ...) (Middleware, error) + func NewRetryMiddleware(log log.Logger, maxRetries int, metrics *RetryMiddlewareMetrics) Middleware + type MiddlewareFunc func(Handler) Handler + func (q MiddlewareFunc) Wrap(h Handler) Handler + type MockShardedQueryable struct + func NewMockShardedQueryable(nSamples int, labelSet []string, labelBuckets int, ...) *MockShardedQueryable + func (q *MockShardedQueryable) Close() error + func (q *MockShardedQueryable) LabelNames(matchers ...*labels.Matcher) ([]string, storage.Warnings, error) + func (q *MockShardedQueryable) LabelValues(name string, matchers ...*labels.Matcher) ([]string, storage.Warnings, error) + func (q *MockShardedQueryable) Querier(ctx context.Context, mint, maxt int64) (storage.Querier, error) + func (q *MockShardedQueryable) Select(_ bool, _ *storage.SelectHints, matchers ...*labels.Matcher) storage.SeriesSet + type NoopCollector struct + func (c *NoopCollector) After(ctx context.Context, method, statusCode string, start time.Time) + func (c *NoopCollector) Before(ctx context.Context, method string, start time.Time) + func (c *NoopCollector) Register() + type PrometheusData struct + Result []SampleStream + ResultType string + func (*PrometheusData) Descriptor() ([]byte, []int) + func (*PrometheusData) ProtoMessage() + func (m *PrometheusData) GetResult() []SampleStream + func (m *PrometheusData) GetResultType() string + func (m *PrometheusData) Marshal() (dAtA []byte, err error) + func (m *PrometheusData) MarshalTo(dAtA []byte) (int, error) + func (m *PrometheusData) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *PrometheusData) Reset() + func (m *PrometheusData) Size() (n int) + func (m *PrometheusData) Unmarshal(dAtA []byte) error + func (m *PrometheusData) XXX_DiscardUnknown() + func (m *PrometheusData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *PrometheusData) XXX_Merge(src proto.Message) + func (m *PrometheusData) XXX_Size() int + func (m *PrometheusData) XXX_Unmarshal(b []byte) error + func (this *PrometheusData) Equal(that interface{}) bool + func (this *PrometheusData) GoString() string + func (this *PrometheusData) String() string + type PrometheusRequest struct + CachingOptions CachingOptions + End int64 + Headers []*PrometheusRequestHeader + Path string + Query string + Start int64 + Step int64 + Timeout time.Duration + func (*PrometheusRequest) Descriptor() ([]byte, []int) + func (*PrometheusRequest) ProtoMessage() + func (m *PrometheusRequest) GetCachingOptions() CachingOptions + func (m *PrometheusRequest) GetEnd() int64 + func (m *PrometheusRequest) GetHeaders() []*PrometheusRequestHeader + func (m *PrometheusRequest) GetPath() string + func (m *PrometheusRequest) GetQuery() string + func (m *PrometheusRequest) GetStart() int64 + func (m *PrometheusRequest) GetStep() int64 + func (m *PrometheusRequest) GetTimeout() time.Duration + func (m *PrometheusRequest) Marshal() (dAtA []byte, err error) + func (m *PrometheusRequest) MarshalTo(dAtA []byte) (int, error) + func (m *PrometheusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *PrometheusRequest) Reset() + func (m *PrometheusRequest) Size() (n int) + func (m *PrometheusRequest) Unmarshal(dAtA []byte) error + func (m *PrometheusRequest) XXX_DiscardUnknown() + func (m *PrometheusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *PrometheusRequest) XXX_Merge(src proto.Message) + func (m *PrometheusRequest) XXX_Size() int + func (m *PrometheusRequest) XXX_Unmarshal(b []byte) error + func (q *PrometheusRequest) LogToSpan(sp opentracing.Span) + func (q *PrometheusRequest) WithQuery(query string) Request + func (q *PrometheusRequest) WithStartEnd(start int64, end int64) Request + func (this *PrometheusRequest) Equal(that interface{}) bool + func (this *PrometheusRequest) GoString() string + func (this *PrometheusRequest) String() string + type PrometheusRequestHeader struct + Name string + Values []string + func (*PrometheusRequestHeader) Descriptor() ([]byte, []int) + func (*PrometheusRequestHeader) ProtoMessage() + func (m *PrometheusRequestHeader) GetName() string + func (m *PrometheusRequestHeader) GetValues() []string + func (m *PrometheusRequestHeader) Marshal() (dAtA []byte, err error) + func (m *PrometheusRequestHeader) MarshalTo(dAtA []byte) (int, error) + func (m *PrometheusRequestHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *PrometheusRequestHeader) Reset() + func (m *PrometheusRequestHeader) Size() (n int) + func (m *PrometheusRequestHeader) Unmarshal(dAtA []byte) error + func (m *PrometheusRequestHeader) XXX_DiscardUnknown() + func (m *PrometheusRequestHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *PrometheusRequestHeader) XXX_Merge(src proto.Message) + func (m *PrometheusRequestHeader) XXX_Size() int + func (m *PrometheusRequestHeader) XXX_Unmarshal(b []byte) error + func (this *PrometheusRequestHeader) Equal(that interface{}) bool + func (this *PrometheusRequestHeader) GoString() string + func (this *PrometheusRequestHeader) String() string + type PrometheusResponse struct + Data PrometheusData + Error string + ErrorType string + Headers []*PrometheusResponseHeader + Status string + func NewEmptyPrometheusResponse() *PrometheusResponse + func (*PrometheusResponse) Descriptor() ([]byte, []int) + func (*PrometheusResponse) ProtoMessage() + func (m *PrometheusResponse) GetData() PrometheusData + func (m *PrometheusResponse) GetError() string + func (m *PrometheusResponse) GetErrorType() string + func (m *PrometheusResponse) GetHeaders() []*PrometheusResponseHeader + func (m *PrometheusResponse) GetStatus() string + func (m *PrometheusResponse) Marshal() (dAtA []byte, err error) + func (m *PrometheusResponse) MarshalTo(dAtA []byte) (int, error) + func (m *PrometheusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *PrometheusResponse) Reset() + func (m *PrometheusResponse) Size() (n int) + func (m *PrometheusResponse) Unmarshal(dAtA []byte) error + func (m *PrometheusResponse) XXX_DiscardUnknown() + func (m *PrometheusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *PrometheusResponse) XXX_Merge(src proto.Message) + func (m *PrometheusResponse) XXX_Size() int + func (m *PrometheusResponse) XXX_Unmarshal(b []byte) error + func (this *PrometheusResponse) Equal(that interface{}) bool + func (this *PrometheusResponse) GoString() string + func (this *PrometheusResponse) String() string + type PrometheusResponseExtractor struct + func (PrometheusResponseExtractor) Extract(start, end int64, from Response) Response + func (PrometheusResponseExtractor) ResponseWithoutHeaders(resp Response) Response + type PrometheusResponseHeader struct + Name string + Values []string + func (*PrometheusResponseHeader) Descriptor() ([]byte, []int) + func (*PrometheusResponseHeader) ProtoMessage() + func (m *PrometheusResponseHeader) GetName() string + func (m *PrometheusResponseHeader) GetValues() []string + func (m *PrometheusResponseHeader) Marshal() (dAtA []byte, err error) + func (m *PrometheusResponseHeader) MarshalTo(dAtA []byte) (int, error) + func (m *PrometheusResponseHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *PrometheusResponseHeader) Reset() + func (m *PrometheusResponseHeader) Size() (n int) + func (m *PrometheusResponseHeader) Unmarshal(dAtA []byte) error + func (m *PrometheusResponseHeader) XXX_DiscardUnknown() + func (m *PrometheusResponseHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *PrometheusResponseHeader) XXX_Merge(src proto.Message) + func (m *PrometheusResponseHeader) XXX_Size() int + func (m *PrometheusResponseHeader) XXX_Unmarshal(b []byte) error + func (this *PrometheusResponseHeader) Equal(that interface{}) bool + func (this *PrometheusResponseHeader) GoString() string + func (this *PrometheusResponseHeader) String() string + type Request interface + GetCachingOptions func() CachingOptions + GetEnd func() int64 + GetQuery func() string + GetStart func() int64 + GetStep func() int64 + LogToSpan func(opentracing.Span) + WithQuery func(string) Request + WithStartEnd func(startTime int64, endTime int64) Request + type RequestResponse struct + Request Request + Response Response + func DoRequests(ctx context.Context, downstream Handler, reqs []Request, limits Limits) ([]RequestResponse, error) + type Response interface + GetHeaders func() []*PrometheusResponseHeader + type ResultsCacheConfig struct + CacheConfig cache.Config + Compression string + func (cfg *ResultsCacheConfig) RegisterFlags(f *flag.FlagSet) + func (cfg *ResultsCacheConfig) Validate() error + type RetryMiddlewareMetrics struct + func NewRetryMiddlewareMetrics(registerer prometheus.Registerer) *RetryMiddlewareMetrics + type RoundTripFunc func(*http.Request) (*http.Response, error) + func (f RoundTripFunc) RoundTrip(r *http.Request) (*http.Response, error) + type SampleStream struct + Labels []github_com_grafana_loki_pkg_logproto.LabelAdapter + Samples []logproto.LegacySample + func FromResult(res *promql.Result) ([]SampleStream, error) + func ResponseToSamples(resp Response) ([]SampleStream, error) + func (*SampleStream) Descriptor() ([]byte, []int) + func (*SampleStream) ProtoMessage() + func (m *SampleStream) GetSamples() []logproto.LegacySample + func (m *SampleStream) Marshal() (dAtA []byte, err error) + func (m *SampleStream) MarshalTo(dAtA []byte) (int, error) + func (m *SampleStream) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *SampleStream) Reset() + func (m *SampleStream) Size() (n int) + func (m *SampleStream) Unmarshal(dAtA []byte) error + func (m *SampleStream) XXX_DiscardUnknown() + func (m *SampleStream) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *SampleStream) XXX_Merge(src proto.Message) + func (m *SampleStream) XXX_Size() int + func (m *SampleStream) XXX_Unmarshal(b []byte) error + func (s *SampleStream) MarshalJSON() ([]byte, error) + func (s *SampleStream) UnmarshalJSON(data []byte) error + func (this *SampleStream) Equal(that interface{}) bool + func (this *SampleStream) GoString() string + func (this *SampleStream) String() string + type ShardLabelSeries struct + func (s *ShardLabelSeries) Labels() labels.Labels + type ShouldCacheFn func(r Request) bool + type Tripperware func(http.RoundTripper) http.RoundTripper