queryrange

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const StatusSuccess = "success"

StatusSuccess Prometheus success result.

Variables

View Source
var (
	ErrInvalidLengthQueryrange        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQueryrange          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQueryrange = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// PassthroughMiddleware is a noop middleware
	PassthroughMiddleware = MiddlewareFunc(func(next Handler) Handler {
		return next
	})
)
View Source
var (

	// ResultsCacheGenNumberHeaderName holds name of the header we want to set in http response
	ResultsCacheGenNumberHeaderName = "Results-Cache-Gen-Number"
)
View Source
var StepAlignMiddleware = MiddlewareFunc(func(next Handler) Handler {
	return stepAlign{
		next: next,
	}
})

StepAlignMiddleware aligns the start and end of request to the step to improved the cacheability of the query results.

Functions

func BodyBuffer

func BodyBuffer(res *http.Response) ([]byte, error)

func EvaluateAtModifierFunction added in v0.30.0

func EvaluateAtModifierFunction(query string, start, end int64) (string, error)

EvaluateAtModifierFunction parse the query and evaluates the `start()` and `end()` at modifier functions into actual constant timestamps. For example given the start of the query is 10.00, `http_requests_total[1h] @ start()` query will be replaced with `http_requests_total[1h] @ 10.00` If the modifier is already a constant, it will be returned as is.

func NewRoundTripper

func NewRoundTripper(next http.RoundTripper, codec Codec, headers []string, middlewares ...Middleware) http.RoundTripper

NewRoundTripper merges a set of middlewares into an handler, then inject it into the `next` roundtripper using the codec to translate requests and responses.

func PrometheusResponseQueryableSamplesStatsPerStepJsoniterDecode

func PrometheusResponseQueryableSamplesStatsPerStepJsoniterDecode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func PrometheusResponseQueryableSamplesStatsPerStepJsoniterEncode

func PrometheusResponseQueryableSamplesStatsPerStepJsoniterEncode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func SliceSamples added in v0.30.0

func SliceSamples(samples []cortexpb.Sample, minTs int64) []cortexpb.Sample

SliceSamples assumes given samples are sorted by timestamp in ascending order and return a sub slice whose first element's is the smallest timestamp that is strictly bigger than the given minTs. Empty slice is returned if minTs is bigger than all the timestamps in samples.

Types

type Buffer

type Buffer interface {
	Bytes() []byte
}

Buffer can be used to read a response body. This allows to avoid reading the body multiple times from the `http.Response.Body`.

type CacheGenNumberLoader

type CacheGenNumberLoader interface {
	GetResultsCacheGenNumber(tenantIDs []string) string
}

type CacheSplitter

type CacheSplitter interface {
	GenerateCacheKey(userID string, r Request) string
}

CacheSplitter generates cache keys. This is a useful interface for downstream consumers who wish to implement their own strategies.

type CachedResponse

type CachedResponse struct {
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key"`
	// List of cached responses; non-overlapping and in order.
	Extents              []Extent `protobuf:"bytes,2,rep,name=extents,proto3" json:"extents"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CachedResponse) Descriptor

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

func (*CachedResponse) GetExtents

func (m *CachedResponse) GetExtents() []Extent

func (*CachedResponse) GetKey

func (m *CachedResponse) GetKey() string

func (*CachedResponse) Marshal

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

func (*CachedResponse) MarshalTo

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

func (*CachedResponse) MarshalToSizedBuffer

func (m *CachedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CachedResponse) ProtoMessage

func (*CachedResponse) ProtoMessage()

func (*CachedResponse) Reset

func (m *CachedResponse) Reset()

func (*CachedResponse) Size

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

func (*CachedResponse) String

func (m *CachedResponse) String() string

func (*CachedResponse) Unmarshal

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

func (*CachedResponse) XXX_DiscardUnknown

func (m *CachedResponse) XXX_DiscardUnknown()

func (*CachedResponse) XXX_Marshal

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

func (*CachedResponse) XXX_Merge

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

func (*CachedResponse) XXX_Size

func (m *CachedResponse) XXX_Size() int

func (*CachedResponse) XXX_Unmarshal

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

type CachingOptions

type CachingOptions struct {
	Disabled             bool     `protobuf:"varint,1,opt,name=disabled,proto3" json:"disabled,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CachingOptions) Descriptor

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

func (*CachingOptions) GetDisabled

func (m *CachingOptions) GetDisabled() bool

func (*CachingOptions) Marshal

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

func (*CachingOptions) MarshalTo

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

func (*CachingOptions) MarshalToSizedBuffer

func (m *CachingOptions) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CachingOptions) ProtoMessage

func (*CachingOptions) ProtoMessage()

func (*CachingOptions) Reset

func (m *CachingOptions) Reset()

func (*CachingOptions) Size

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

func (*CachingOptions) String

func (m *CachingOptions) String() string

func (*CachingOptions) Unmarshal

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

func (*CachingOptions) XXX_DiscardUnknown

func (m *CachingOptions) XXX_DiscardUnknown()

func (*CachingOptions) XXX_Marshal

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

func (*CachingOptions) XXX_Merge

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

func (*CachingOptions) XXX_Size

func (m *CachingOptions) XXX_Size() int

func (*CachingOptions) XXX_Unmarshal

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

type Codec

type Codec interface {
	Merger
	// DecodeRequest decodes a Request from an http request.
	DecodeRequest(_ context.Context, request *http.Request, forwardHeaders []string) (Request, error)
	// DecodeResponse decodes a Response from an http response.
	// The original request is also passed as a parameter this is useful for implementation that needs the request
	// to merge result or build the result correctly.
	DecodeResponse(context.Context, *http.Response, Request) (Response, error)
	// EncodeRequest encodes a Request into an http request.
	EncodeRequest(context.Context, Request) (*http.Request, error)
	// EncodeResponse encodes a Response into an http response.
	EncodeResponse(context.Context, Response) (*http.Response, error)
}

Codec is used to encode/decode query range requests and responses so they can be passed down to middlewares.

var (

	// PrometheusCodec is a codec to encode and decode Prometheus query range requests and responses.
	PrometheusCodec Codec = &prometheusCodec{}
)

type Config

type Config struct {
	SplitQueriesByInterval time.Duration `yaml:"split_queries_by_interval"`
	AlignQueriesWithStep   bool          `yaml:"align_queries_with_step"`
	ResultsCacheConfig     `yaml:"results_cache"`
	CacheResults           bool `yaml:"cache_results"`
	MaxRetries             int  `yaml:"max_retries"`
	ShardedQueries         bool `yaml:"parallelise_shardable_queries"`
	// List of headers which query_range middleware chain would forward to downstream querier.
	ForwardHeaders flagext.StringSlice `yaml:"forward_headers_list"`
}

Config for query_range middleware chain.

func (*Config) Validate

func (cfg *Config) Validate(qCfg querier.Config) error

Validate validates the config.

type Explanation added in v0.32.0

type Explanation struct {
	Name                 string         `protobuf:"bytes,1,opt,name=name,proto3" json:"name"`
	Children             []*Explanation `protobuf:"bytes,2,rep,name=children,proto3" json:"children"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*Explanation) Descriptor added in v0.32.0

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

func (*Explanation) GetChildren added in v0.32.0

func (m *Explanation) GetChildren() []*Explanation

func (*Explanation) GetName added in v0.32.0

func (m *Explanation) GetName() string

func (*Explanation) Marshal added in v0.32.0

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

func (*Explanation) MarshalTo added in v0.32.0

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

func (*Explanation) MarshalToSizedBuffer added in v0.32.0

func (m *Explanation) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Explanation) ProtoMessage added in v0.32.0

func (*Explanation) ProtoMessage()

func (*Explanation) Reset added in v0.32.0

func (m *Explanation) Reset()

func (*Explanation) Size added in v0.32.0

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

func (*Explanation) String added in v0.32.0

func (m *Explanation) String() string

func (*Explanation) Unmarshal added in v0.32.0

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

func (*Explanation) XXX_DiscardUnknown added in v0.32.0

func (m *Explanation) XXX_DiscardUnknown()

func (*Explanation) XXX_Marshal added in v0.32.0

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

func (*Explanation) XXX_Merge added in v0.32.0

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

func (*Explanation) XXX_Size added in v0.32.0

func (m *Explanation) XXX_Size() int

func (*Explanation) XXX_Unmarshal added in v0.32.0

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

type Extent

type Extent struct {
	Start                int64      `protobuf:"varint,1,opt,name=start,proto3" json:"start"`
	End                  int64      `protobuf:"varint,2,opt,name=end,proto3" json:"end"`
	TraceId              string     `protobuf:"bytes,4,opt,name=trace_id,json=traceId,proto3" json:"-"`
	Response             *types.Any `protobuf:"bytes,5,opt,name=response,proto3" json:"response"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*Extent) Descriptor

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

func (*Extent) GetEnd

func (m *Extent) GetEnd() int64

func (*Extent) GetResponse

func (m *Extent) GetResponse() *types.Any

func (*Extent) GetStart

func (m *Extent) GetStart() int64

func (*Extent) GetTraceId

func (m *Extent) GetTraceId() string

func (*Extent) Marshal

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

func (*Extent) MarshalTo

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

func (*Extent) MarshalToSizedBuffer

func (m *Extent) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Extent) ProtoMessage

func (*Extent) ProtoMessage()

func (*Extent) Reset

func (m *Extent) Reset()

func (*Extent) Size

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

func (*Extent) String

func (m *Extent) String() string

func (*Extent) Unmarshal

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

func (*Extent) XXX_DiscardUnknown

func (m *Extent) XXX_DiscardUnknown()

func (*Extent) XXX_Marshal

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

func (*Extent) XXX_Merge

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

func (*Extent) XXX_Size

func (m *Extent) XXX_Size() int

func (*Extent) XXX_Unmarshal

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

type Extractor

type Extractor interface {
	// Extract extracts a subset of a response from the `start` and `end` timestamps in milliseconds in the `from` response.
	Extract(start, end int64, from Response) Response
	ResponseWithoutHeaders(resp Response) Response
	ResponseWithoutStats(resp Response) Response
}

Extractor is used by the cache to extract a subset of a response from a cache entry.

type Handler

type Handler interface {
	Do(context.Context, Request) (Response, error)
}

Handler is like http.Handle, but specifically for Prometheus query_range calls.

type HandlerFunc

type HandlerFunc func(context.Context, Request) (Response, error)

HandlerFunc is like http.HandlerFunc, but for Handler.

func (HandlerFunc) Do

func (q HandlerFunc) Do(ctx context.Context, req Request) (Response, error)

Do implements Handler.

type HistogramBucket added in v0.32.0

type HistogramBucket struct {
	Boundaries           int32    `protobuf:"varint,1,opt,name=boundaries,proto3" json:"boundaries,omitempty"`
	Lower                float64  `protobuf:"fixed64,2,opt,name=lower,proto3" json:"lower,omitempty"`
	Upper                float64  `protobuf:"fixed64,3,opt,name=upper,proto3" json:"upper,omitempty"`
	Count                float64  `protobuf:"fixed64,4,opt,name=count,proto3" json:"count,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HistogramBucket) Descriptor added in v0.32.0

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

func (*HistogramBucket) GetBoundaries added in v0.32.0

func (m *HistogramBucket) GetBoundaries() int32

func (*HistogramBucket) GetCount added in v0.32.0

func (m *HistogramBucket) GetCount() float64

func (*HistogramBucket) GetLower added in v0.32.0

func (m *HistogramBucket) GetLower() float64

func (*HistogramBucket) GetUpper added in v0.32.0

func (m *HistogramBucket) GetUpper() float64

func (*HistogramBucket) Marshal added in v0.32.0

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

func (*HistogramBucket) MarshalTo added in v0.32.0

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

func (*HistogramBucket) MarshalToSizedBuffer added in v0.32.0

func (m *HistogramBucket) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*HistogramBucket) ProtoMessage added in v0.32.0

func (*HistogramBucket) ProtoMessage()

func (*HistogramBucket) Reset added in v0.32.0

func (m *HistogramBucket) Reset()

func (*HistogramBucket) Size added in v0.32.0

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

func (*HistogramBucket) String added in v0.32.0

func (m *HistogramBucket) String() string

func (*HistogramBucket) Unmarshal added in v0.32.0

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

func (*HistogramBucket) XXX_DiscardUnknown added in v0.32.0

func (m *HistogramBucket) XXX_DiscardUnknown()

func (*HistogramBucket) XXX_Marshal added in v0.32.0

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

func (*HistogramBucket) XXX_Merge added in v0.32.0

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

func (*HistogramBucket) XXX_Size added in v0.32.0

func (m *HistogramBucket) XXX_Size() int

func (*HistogramBucket) XXX_Unmarshal added in v0.32.0

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

type InstrumentMiddlewareMetrics

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

InstrumentMiddlewareMetrics holds the metrics tracked by InstrumentMiddleware.

func NewInstrumentMiddlewareMetrics

func NewInstrumentMiddlewareMetrics(registerer prometheus.Registerer) *InstrumentMiddlewareMetrics

NewInstrumentMiddlewareMetrics makes a new InstrumentMiddlewareMetrics.

type IntervalFn

type IntervalFn func(r Request) time.Duration

type Limits

type Limits interface {
	// MaxQueryLookback returns the max lookback period of queries.
	MaxQueryLookback(userID string) time.Duration

	// MaxQueryLength returns the limit of the length (in time) of a query.
	MaxQueryLength(string) time.Duration

	// MaxQueryParallelism returns the limit to the number of split queries the
	// frontend will process in parallel.
	MaxQueryParallelism(string) int

	// MaxCacheFreshness returns the period after which results are cacheable,
	// to prevent caching of very recent results.
	MaxCacheFreshness(string) time.Duration
}

Limits allows us to specify per-tenant runtime limits on the behavior of the query handling code.

type Matrix

type Matrix struct {
	SampleStreams        []*SampleStream `protobuf:"bytes,1,rep,name=sampleStreams,proto3" json:"sampleStreams,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*Matrix) Descriptor

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

func (*Matrix) GetSampleStreams

func (m *Matrix) GetSampleStreams() []*SampleStream

func (*Matrix) Marshal

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

func (*Matrix) MarshalTo

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

func (*Matrix) MarshalToSizedBuffer

func (m *Matrix) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Matrix) ProtoMessage

func (*Matrix) ProtoMessage()

func (*Matrix) Reset

func (m *Matrix) Reset()

func (*Matrix) Size

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

func (*Matrix) String

func (m *Matrix) String() string

func (*Matrix) Unmarshal

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

func (*Matrix) XXX_DiscardUnknown

func (m *Matrix) XXX_DiscardUnknown()

func (*Matrix) XXX_Marshal

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

func (*Matrix) XXX_Merge

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

func (*Matrix) XXX_Size

func (m *Matrix) XXX_Size() int

func (*Matrix) XXX_Unmarshal

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

type Merger

type Merger interface {
	// MergeResponse merges responses from multiple requests into a single Response
	MergeResponse(Request, ...Response) (Response, error)
}

Merger is used by middlewares making multiple requests to merge back all responses into a single one.

type Middleware

type Middleware interface {
	Wrap(Handler) Handler
}

Middleware is a higher order Handler.

func InstrumentMiddleware

func InstrumentMiddleware(name string, metrics *InstrumentMiddlewareMetrics) Middleware

InstrumentMiddleware can be inserted into the middleware chain to expose timing information.

func MergeMiddlewares

func MergeMiddlewares(middleware ...Middleware) Middleware

MergeMiddlewares produces a middleware that applies multiple middleware in turn; ie Merge(f,g,h).Wrap(handler) == f.Wrap(g.Wrap(h.Wrap(handler)))

func NewLimitsMiddleware

func NewLimitsMiddleware(l Limits) Middleware

NewLimitsMiddleware creates a new Middleware that enforces query limits.

func NewResultsCacheMiddleware

func NewResultsCacheMiddleware(
	logger log.Logger,
	cfg ResultsCacheConfig,
	splitter CacheSplitter,
	limits Limits,
	merger Merger,
	extractor Extractor,
	cacheGenNumberLoader CacheGenNumberLoader,
	shouldCache ShouldCacheFn,
	reg prometheus.Registerer,
) (Middleware, cache.Cache, error)

NewResultsCacheMiddleware creates results cache middleware from config. The middleware cache result using a unique cache key for a given request (step,query,user) and interval. The cache assumes that each request length (end-start) is below or equal the interval. Each request starting from within the same interval will hit the same cache entry. If the cache doesn't have the entire duration of the request cached, it will query the uncached parts and append them to the cache entries. see `generateKey`.

func NewRetryMiddleware

func NewRetryMiddleware(log log.Logger, maxRetries int, metrics *RetryMiddlewareMetrics) Middleware

NewRetryMiddleware returns a middleware that retries requests if they fail with 500 or a non-HTTP error.

func SplitByIntervalMiddleware

func SplitByIntervalMiddleware(interval IntervalFn, limits Limits, merger Merger, registerer prometheus.Registerer) Middleware

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

type MiddlewareFunc

type MiddlewareFunc func(Handler) Handler

MiddlewareFunc is like http.HandlerFunc, but for Middleware.

func (MiddlewareFunc) Wrap

func (q MiddlewareFunc) Wrap(h Handler) Handler

Wrap implements Middleware.

type NoopCollector

type NoopCollector struct{}

NoopCollector is a noop collector that can be used as placeholder when no metric should tracked by the instrumentation.

func (*NoopCollector) After

func (c *NoopCollector) After(ctx context.Context, method, statusCode string, start time.Time)

After implements instrument.Collector.

func (*NoopCollector) Before

func (c *NoopCollector) Before(ctx context.Context, method string, start time.Time)

Before implements instrument.Collector.

func (*NoopCollector) Register

func (c *NoopCollector) Register()

Register implements instrument.Collector.

type PrometheusData

type PrometheusData struct {
	ResultType           string                   `protobuf:"bytes,1,opt,name=ResultType,proto3" json:"resultType"`
	Result               []SampleStream           `protobuf:"bytes,2,rep,name=Result,proto3" json:"result"`
	Stats                *PrometheusResponseStats `protobuf:"bytes,3,opt,name=stats,proto3" json:"stats,omitempty"`
	Explanation          *Explanation             `protobuf:"bytes,4,opt,name=Explanation,proto3" json:"explanation"`
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

func (*PrometheusData) Descriptor

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

func (*PrometheusData) GetExplanation added in v0.32.0

func (m *PrometheusData) GetExplanation() *Explanation

func (*PrometheusData) GetResult

func (m *PrometheusData) GetResult() []SampleStream

func (*PrometheusData) GetResultType

func (m *PrometheusData) GetResultType() string

func (*PrometheusData) GetStats

func (m *PrometheusData) GetStats() *PrometheusResponseStats

func (*PrometheusData) Marshal

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

func (*PrometheusData) MarshalTo

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

func (*PrometheusData) MarshalToSizedBuffer

func (m *PrometheusData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusData) ProtoMessage

func (*PrometheusData) ProtoMessage()

func (*PrometheusData) Reset

func (m *PrometheusData) Reset()

func (*PrometheusData) Size

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

func (*PrometheusData) String

func (m *PrometheusData) String() string

func (*PrometheusData) Unmarshal

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

func (*PrometheusData) XXX_DiscardUnknown

func (m *PrometheusData) XXX_DiscardUnknown()

func (*PrometheusData) XXX_Marshal

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

func (*PrometheusData) XXX_Merge

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

func (*PrometheusData) XXX_Size

func (m *PrometheusData) XXX_Size() int

func (*PrometheusData) XXX_Unmarshal

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

type PrometheusInstantQueryData

type PrometheusInstantQueryData struct {
	ResultType           string                       `protobuf:"bytes,1,opt,name=ResultType,proto3" json:"resultType"`
	Result               PrometheusInstantQueryResult `protobuf:"bytes,2,opt,name=Result,proto3" json:"result"`
	Stats                *PrometheusResponseStats     `protobuf:"bytes,3,opt,name=stats,proto3" json:"stats,omitempty"`
	Explanation          *Explanation                 `protobuf:"bytes,4,opt,name=Explanation,proto3" json:"explanation"`
	XXX_NoUnkeyedLiteral struct{}                     `json:"-"`
	XXX_unrecognized     []byte                       `json:"-"`
	XXX_sizecache        int32                        `json:"-"`
}

func (*PrometheusInstantQueryData) Descriptor

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

func (*PrometheusInstantQueryData) GetExplanation added in v0.32.0

func (m *PrometheusInstantQueryData) GetExplanation() *Explanation

func (*PrometheusInstantQueryData) GetResult

func (*PrometheusInstantQueryData) GetResultType

func (m *PrometheusInstantQueryData) GetResultType() string

func (*PrometheusInstantQueryData) GetStats

func (*PrometheusInstantQueryData) Marshal

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

func (*PrometheusInstantQueryData) MarshalJSON

func (s *PrometheusInstantQueryData) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*PrometheusInstantQueryData) MarshalTo

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

func (*PrometheusInstantQueryData) MarshalToSizedBuffer

func (m *PrometheusInstantQueryData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusInstantQueryData) ProtoMessage

func (*PrometheusInstantQueryData) ProtoMessage()

func (*PrometheusInstantQueryData) Reset

func (m *PrometheusInstantQueryData) Reset()

func (*PrometheusInstantQueryData) Size

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

func (*PrometheusInstantQueryData) String

func (m *PrometheusInstantQueryData) String() string

func (*PrometheusInstantQueryData) Unmarshal

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

func (*PrometheusInstantQueryData) UnmarshalJSON

func (s *PrometheusInstantQueryData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*PrometheusInstantQueryData) XXX_DiscardUnknown

func (m *PrometheusInstantQueryData) XXX_DiscardUnknown()

func (*PrometheusInstantQueryData) XXX_Marshal

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

func (*PrometheusInstantQueryData) XXX_Merge

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

func (*PrometheusInstantQueryData) XXX_Size

func (m *PrometheusInstantQueryData) XXX_Size() int

func (*PrometheusInstantQueryData) XXX_Unmarshal

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

type PrometheusInstantQueryResponse

type PrometheusInstantQueryResponse struct {
	Status               string                      `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"`
	Data                 PrometheusInstantQueryData  `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"`
	Headers              []*PrometheusResponseHeader `protobuf:"bytes,5,rep,name=Headers,proto3" json:"-"`
	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
	XXX_unrecognized     []byte                      `json:"-"`
	XXX_sizecache        int32                       `json:"-"`
}

func NewEmptyPrometheusInstantQueryResponse

func NewEmptyPrometheusInstantQueryResponse() *PrometheusInstantQueryResponse

NewEmptyPrometheusInstantQueryResponse returns an empty successful Prometheus query range response.

func (*PrometheusInstantQueryResponse) Descriptor

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

func (*PrometheusInstantQueryResponse) GetData

func (*PrometheusInstantQueryResponse) GetError

func (m *PrometheusInstantQueryResponse) GetError() string

func (*PrometheusInstantQueryResponse) GetErrorType

func (m *PrometheusInstantQueryResponse) GetErrorType() string

func (*PrometheusInstantQueryResponse) GetHeaders

func (*PrometheusInstantQueryResponse) GetStats

func (*PrometheusInstantQueryResponse) GetStatus

func (m *PrometheusInstantQueryResponse) GetStatus() string

func (*PrometheusInstantQueryResponse) Marshal

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

func (*PrometheusInstantQueryResponse) MarshalTo

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

func (*PrometheusInstantQueryResponse) MarshalToSizedBuffer

func (m *PrometheusInstantQueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusInstantQueryResponse) ProtoMessage

func (*PrometheusInstantQueryResponse) ProtoMessage()

func (*PrometheusInstantQueryResponse) Reset

func (m *PrometheusInstantQueryResponse) Reset()

func (*PrometheusInstantQueryResponse) Size

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

func (*PrometheusInstantQueryResponse) String

func (*PrometheusInstantQueryResponse) Unmarshal

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

func (*PrometheusInstantQueryResponse) XXX_DiscardUnknown

func (m *PrometheusInstantQueryResponse) XXX_DiscardUnknown()

func (*PrometheusInstantQueryResponse) XXX_Marshal

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

func (*PrometheusInstantQueryResponse) XXX_Merge

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

func (*PrometheusInstantQueryResponse) XXX_Size

func (m *PrometheusInstantQueryResponse) XXX_Size() int

func (*PrometheusInstantQueryResponse) XXX_Unmarshal

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

type PrometheusInstantQueryResult

type PrometheusInstantQueryResult struct {
	// Types that are valid to be assigned to Result:
	//
	//	*PrometheusInstantQueryResult_Scalar
	//	*PrometheusInstantQueryResult_StringSample
	//	*PrometheusInstantQueryResult_Vector
	//	*PrometheusInstantQueryResult_Matrix
	Result               isPrometheusInstantQueryResult_Result `protobuf_oneof:"result"`
	XXX_NoUnkeyedLiteral struct{}                              `json:"-"`
	XXX_unrecognized     []byte                                `json:"-"`
	XXX_sizecache        int32                                 `json:"-"`
}

func (*PrometheusInstantQueryResult) Descriptor

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

func (*PrometheusInstantQueryResult) GetMatrix

func (m *PrometheusInstantQueryResult) GetMatrix() *Matrix

func (*PrometheusInstantQueryResult) GetResult

func (m *PrometheusInstantQueryResult) GetResult() isPrometheusInstantQueryResult_Result

func (*PrometheusInstantQueryResult) GetScalar

func (*PrometheusInstantQueryResult) GetStringSample

func (m *PrometheusInstantQueryResult) GetStringSample() *StringSample

func (*PrometheusInstantQueryResult) GetVector

func (m *PrometheusInstantQueryResult) GetVector() *Vector

func (*PrometheusInstantQueryResult) Marshal

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

func (*PrometheusInstantQueryResult) MarshalTo

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

func (*PrometheusInstantQueryResult) MarshalToSizedBuffer

func (m *PrometheusInstantQueryResult) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusInstantQueryResult) ProtoMessage

func (*PrometheusInstantQueryResult) ProtoMessage()

func (*PrometheusInstantQueryResult) Reset

func (m *PrometheusInstantQueryResult) Reset()

func (*PrometheusInstantQueryResult) Size

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

func (*PrometheusInstantQueryResult) String

func (*PrometheusInstantQueryResult) Unmarshal

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

func (*PrometheusInstantQueryResult) XXX_DiscardUnknown

func (m *PrometheusInstantQueryResult) XXX_DiscardUnknown()

func (*PrometheusInstantQueryResult) XXX_Marshal

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

func (*PrometheusInstantQueryResult) XXX_Merge

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

func (*PrometheusInstantQueryResult) XXX_OneofWrappers

func (*PrometheusInstantQueryResult) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*PrometheusInstantQueryResult) XXX_Size

func (m *PrometheusInstantQueryResult) XXX_Size() int

func (*PrometheusInstantQueryResult) XXX_Unmarshal

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

type PrometheusInstantQueryResult_Matrix

type PrometheusInstantQueryResult_Matrix struct {
	Matrix *Matrix `protobuf:"bytes,4,opt,name=matrix,proto3,oneof" json:"matrix,omitempty"`
}

func (*PrometheusInstantQueryResult_Matrix) MarshalTo

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

func (*PrometheusInstantQueryResult_Matrix) MarshalToSizedBuffer

func (m *PrometheusInstantQueryResult_Matrix) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusInstantQueryResult_Matrix) Size

type PrometheusInstantQueryResult_Scalar

type PrometheusInstantQueryResult_Scalar struct {
	Scalar *cortexpb.Sample `protobuf:"bytes,1,opt,name=scalar,proto3,oneof" json:"scalar,omitempty"`
}

func (*PrometheusInstantQueryResult_Scalar) MarshalTo

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

func (*PrometheusInstantQueryResult_Scalar) MarshalToSizedBuffer

func (m *PrometheusInstantQueryResult_Scalar) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusInstantQueryResult_Scalar) Size

type PrometheusInstantQueryResult_StringSample

type PrometheusInstantQueryResult_StringSample struct {
	StringSample *StringSample `protobuf:"bytes,2,opt,name=stringSample,proto3,oneof" json:"stringSample,omitempty"`
}

func (*PrometheusInstantQueryResult_StringSample) MarshalTo

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

func (*PrometheusInstantQueryResult_StringSample) MarshalToSizedBuffer

func (m *PrometheusInstantQueryResult_StringSample) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusInstantQueryResult_StringSample) Size

type PrometheusInstantQueryResult_Vector

type PrometheusInstantQueryResult_Vector struct {
	Vector *Vector `protobuf:"bytes,3,opt,name=vector,proto3,oneof" json:"vector,omitempty"`
}

func (*PrometheusInstantQueryResult_Vector) MarshalTo

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

func (*PrometheusInstantQueryResult_Vector) MarshalToSizedBuffer

func (m *PrometheusInstantQueryResult_Vector) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusInstantQueryResult_Vector) Size

type PrometheusRequest

type PrometheusRequest struct {
	Path                 string                     `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	Start                int64                      `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"`
	End                  int64                      `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"`
	Step                 int64                      `protobuf:"varint,4,opt,name=step,proto3" json:"step,omitempty"`
	Timeout              time.Duration              `protobuf:"bytes,5,opt,name=timeout,proto3,stdduration" json:"timeout"`
	Query                string                     `protobuf:"bytes,6,opt,name=query,proto3" json:"query,omitempty"`
	CachingOptions       CachingOptions             `protobuf:"bytes,7,opt,name=cachingOptions,proto3" json:"cachingOptions"`
	Headers              []*PrometheusRequestHeader `protobuf:"bytes,8,rep,name=Headers,proto3" json:"-"`
	Stats                string                     `protobuf:"bytes,9,opt,name=stats,proto3" json:"stats,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                   `json:"-"`
	XXX_unrecognized     []byte                     `json:"-"`
	XXX_sizecache        int32                      `json:"-"`
}

func (*PrometheusRequest) Descriptor

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

func (*PrometheusRequest) GetCachingOptions

func (m *PrometheusRequest) GetCachingOptions() CachingOptions

func (*PrometheusRequest) GetEnd

func (m *PrometheusRequest) GetEnd() int64

func (*PrometheusRequest) GetHeaders

func (m *PrometheusRequest) GetHeaders() []*PrometheusRequestHeader

func (*PrometheusRequest) GetPath

func (m *PrometheusRequest) GetPath() string

func (*PrometheusRequest) GetQuery

func (m *PrometheusRequest) GetQuery() string

func (*PrometheusRequest) GetStart

func (m *PrometheusRequest) GetStart() int64

func (*PrometheusRequest) GetStats

func (m *PrometheusRequest) GetStats() string

func (*PrometheusRequest) GetStep

func (m *PrometheusRequest) GetStep() int64

func (*PrometheusRequest) GetTimeout

func (m *PrometheusRequest) GetTimeout() time.Duration

func (*PrometheusRequest) LogToSpan

func (q *PrometheusRequest) LogToSpan(sp opentracing.Span)

LogToSpan logs the current `PrometheusRequest` parameters to the specified span.

func (*PrometheusRequest) Marshal

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

func (*PrometheusRequest) MarshalTo

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

func (*PrometheusRequest) MarshalToSizedBuffer

func (m *PrometheusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusRequest) ProtoMessage

func (*PrometheusRequest) ProtoMessage()

func (*PrometheusRequest) Reset

func (m *PrometheusRequest) Reset()

func (*PrometheusRequest) Size

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

func (*PrometheusRequest) String

func (m *PrometheusRequest) String() string

func (*PrometheusRequest) Unmarshal

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

func (*PrometheusRequest) WithQuery

func (q *PrometheusRequest) WithQuery(query string) Request

WithQuery clones the current `PrometheusRequest` with a new query.

func (*PrometheusRequest) WithStartEnd

func (q *PrometheusRequest) WithStartEnd(start int64, end int64) Request

WithStartEnd clones the current `PrometheusRequest` with a new `start` and `end` timestamp.

func (*PrometheusRequest) WithStats

func (q *PrometheusRequest) WithStats(stats string) Request

WithStats clones the current `PrometheusRequest` with a new stats.

func (*PrometheusRequest) XXX_DiscardUnknown

func (m *PrometheusRequest) XXX_DiscardUnknown()

func (*PrometheusRequest) XXX_Marshal

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

func (*PrometheusRequest) XXX_Merge

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

func (*PrometheusRequest) XXX_Size

func (m *PrometheusRequest) XXX_Size() int

func (*PrometheusRequest) XXX_Unmarshal

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

type PrometheusRequestHeader

type PrometheusRequestHeader struct {
	Name                 string   `protobuf:"bytes,1,opt,name=Name,proto3" json:"-"`
	Values               []string `protobuf:"bytes,2,rep,name=Values,proto3" json:"-"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PrometheusRequestHeader) Descriptor

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

func (*PrometheusRequestHeader) GetName

func (m *PrometheusRequestHeader) GetName() string

func (*PrometheusRequestHeader) GetValues

func (m *PrometheusRequestHeader) GetValues() []string

func (*PrometheusRequestHeader) Marshal

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

func (*PrometheusRequestHeader) MarshalTo

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

func (*PrometheusRequestHeader) MarshalToSizedBuffer

func (m *PrometheusRequestHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusRequestHeader) ProtoMessage

func (*PrometheusRequestHeader) ProtoMessage()

func (*PrometheusRequestHeader) Reset

func (m *PrometheusRequestHeader) Reset()

func (*PrometheusRequestHeader) Size

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

func (*PrometheusRequestHeader) String

func (m *PrometheusRequestHeader) String() string

func (*PrometheusRequestHeader) Unmarshal

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

func (*PrometheusRequestHeader) XXX_DiscardUnknown

func (m *PrometheusRequestHeader) XXX_DiscardUnknown()

func (*PrometheusRequestHeader) XXX_Marshal

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

func (*PrometheusRequestHeader) XXX_Merge

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

func (*PrometheusRequestHeader) XXX_Size

func (m *PrometheusRequestHeader) XXX_Size() int

func (*PrometheusRequestHeader) XXX_Unmarshal

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

type PrometheusResponse

type PrometheusResponse struct {
	Status               string                      `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"`
	Data                 PrometheusData              `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"`
	Headers              []*PrometheusResponseHeader `protobuf:"bytes,5,rep,name=Headers,proto3" json:"-"`
	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
	XXX_unrecognized     []byte                      `json:"-"`
	XXX_sizecache        int32                       `json:"-"`
}

func NewEmptyPrometheusResponse

func NewEmptyPrometheusResponse() *PrometheusResponse

NewEmptyPrometheusResponse returns an empty successful Prometheus query range response.

func (*PrometheusResponse) Descriptor

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

func (*PrometheusResponse) GetData

func (m *PrometheusResponse) GetData() PrometheusData

func (*PrometheusResponse) GetError

func (m *PrometheusResponse) GetError() string

func (*PrometheusResponse) GetErrorType

func (m *PrometheusResponse) GetErrorType() string

func (*PrometheusResponse) GetHeaders

func (m *PrometheusResponse) GetHeaders() []*PrometheusResponseHeader

func (*PrometheusResponse) GetStats

func (resp *PrometheusResponse) GetStats() *PrometheusResponseStats

func (*PrometheusResponse) GetStatus

func (m *PrometheusResponse) GetStatus() string

func (*PrometheusResponse) Marshal

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

func (*PrometheusResponse) MarshalTo

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

func (*PrometheusResponse) MarshalToSizedBuffer

func (m *PrometheusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusResponse) ProtoMessage

func (*PrometheusResponse) ProtoMessage()

func (*PrometheusResponse) Reset

func (m *PrometheusResponse) Reset()

func (*PrometheusResponse) Size

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

func (*PrometheusResponse) String

func (m *PrometheusResponse) String() string

func (*PrometheusResponse) Unmarshal

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

func (*PrometheusResponse) XXX_DiscardUnknown

func (m *PrometheusResponse) XXX_DiscardUnknown()

func (*PrometheusResponse) XXX_Marshal

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

func (*PrometheusResponse) XXX_Merge

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

func (*PrometheusResponse) XXX_Size

func (m *PrometheusResponse) XXX_Size() int

func (*PrometheusResponse) XXX_Unmarshal

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

type PrometheusResponseExtractor

type PrometheusResponseExtractor struct{}

PrometheusResponseExtractor helps extracting specific info from Query Response.

func (PrometheusResponseExtractor) Extract

func (PrometheusResponseExtractor) Extract(start, end int64, from Response) Response

Extract extracts response for specific a range from a response.

func (PrometheusResponseExtractor) ResponseWithoutHeaders

func (PrometheusResponseExtractor) ResponseWithoutHeaders(resp Response) Response

ResponseWithoutHeaders is useful in caching data without headers since we anyways do not need headers for sending back the response so this saves some space by reducing size of the objects.

func (PrometheusResponseExtractor) ResponseWithoutStats

func (PrometheusResponseExtractor) ResponseWithoutStats(resp Response) Response

ResponseWithoutStats is returns the response without the stats information

type PrometheusResponseHeader

type PrometheusResponseHeader struct {
	Name                 string   `protobuf:"bytes,1,opt,name=Name,proto3" json:"-"`
	Values               []string `protobuf:"bytes,2,rep,name=Values,proto3" json:"-"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PrometheusResponseHeader) Descriptor

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

func (*PrometheusResponseHeader) GetName

func (m *PrometheusResponseHeader) GetName() string

func (*PrometheusResponseHeader) GetValues

func (m *PrometheusResponseHeader) GetValues() []string

func (*PrometheusResponseHeader) Marshal

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

func (*PrometheusResponseHeader) MarshalTo

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

func (*PrometheusResponseHeader) MarshalToSizedBuffer

func (m *PrometheusResponseHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusResponseHeader) ProtoMessage

func (*PrometheusResponseHeader) ProtoMessage()

func (*PrometheusResponseHeader) Reset

func (m *PrometheusResponseHeader) Reset()

func (*PrometheusResponseHeader) Size

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

func (*PrometheusResponseHeader) String

func (m *PrometheusResponseHeader) String() string

func (*PrometheusResponseHeader) Unmarshal

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

func (*PrometheusResponseHeader) XXX_DiscardUnknown

func (m *PrometheusResponseHeader) XXX_DiscardUnknown()

func (*PrometheusResponseHeader) XXX_Marshal

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

func (*PrometheusResponseHeader) XXX_Merge

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

func (*PrometheusResponseHeader) XXX_Size

func (m *PrometheusResponseHeader) XXX_Size() int

func (*PrometheusResponseHeader) XXX_Unmarshal

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

type PrometheusResponseQueryableSamplesStatsPerStep

type PrometheusResponseQueryableSamplesStatsPerStep struct {
	Value                int64    `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
	TimestampMs          int64    `protobuf:"varint,2,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PrometheusResponseQueryableSamplesStatsPerStep) Descriptor

func (*PrometheusResponseQueryableSamplesStatsPerStep) GetTimestampMs

func (*PrometheusResponseQueryableSamplesStatsPerStep) GetValue

func (*PrometheusResponseQueryableSamplesStatsPerStep) Marshal

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

func (*PrometheusResponseQueryableSamplesStatsPerStep) MarshalTo

func (*PrometheusResponseQueryableSamplesStatsPerStep) MarshalToSizedBuffer

func (m *PrometheusResponseQueryableSamplesStatsPerStep) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusResponseQueryableSamplesStatsPerStep) ProtoMessage

func (*PrometheusResponseQueryableSamplesStatsPerStep) Reset

func (*PrometheusResponseQueryableSamplesStatsPerStep) Size

func (*PrometheusResponseQueryableSamplesStatsPerStep) String

func (*PrometheusResponseQueryableSamplesStatsPerStep) Unmarshal

func (*PrometheusResponseQueryableSamplesStatsPerStep) XXX_DiscardUnknown

func (m *PrometheusResponseQueryableSamplesStatsPerStep) XXX_DiscardUnknown()

func (*PrometheusResponseQueryableSamplesStatsPerStep) XXX_Marshal

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

func (*PrometheusResponseQueryableSamplesStatsPerStep) XXX_Merge

func (*PrometheusResponseQueryableSamplesStatsPerStep) XXX_Size

func (*PrometheusResponseQueryableSamplesStatsPerStep) XXX_Unmarshal

type PrometheusResponseSamplesStats

type PrometheusResponseSamplesStats struct {
	TotalQueryableSamples        int64                                             `protobuf:"varint,1,opt,name=totalQueryableSamples,proto3" json:"totalQueryableSamples"`
	TotalQueryableSamplesPerStep []*PrometheusResponseQueryableSamplesStatsPerStep `protobuf:"bytes,2,rep,name=totalQueryableSamplesPerStep,proto3" json:"totalQueryableSamplesPerStep"`
	XXX_NoUnkeyedLiteral         struct{}                                          `json:"-"`
	XXX_unrecognized             []byte                                            `json:"-"`
	XXX_sizecache                int32                                             `json:"-"`
}

func (*PrometheusResponseSamplesStats) Descriptor

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

func (*PrometheusResponseSamplesStats) GetTotalQueryableSamples

func (m *PrometheusResponseSamplesStats) GetTotalQueryableSamples() int64

func (*PrometheusResponseSamplesStats) GetTotalQueryableSamplesPerStep

func (*PrometheusResponseSamplesStats) Marshal

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

func (*PrometheusResponseSamplesStats) MarshalTo

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

func (*PrometheusResponseSamplesStats) MarshalToSizedBuffer

func (m *PrometheusResponseSamplesStats) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusResponseSamplesStats) ProtoMessage

func (*PrometheusResponseSamplesStats) ProtoMessage()

func (*PrometheusResponseSamplesStats) Reset

func (m *PrometheusResponseSamplesStats) Reset()

func (*PrometheusResponseSamplesStats) Size

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

func (*PrometheusResponseSamplesStats) String

func (*PrometheusResponseSamplesStats) Unmarshal

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

func (*PrometheusResponseSamplesStats) XXX_DiscardUnknown

func (m *PrometheusResponseSamplesStats) XXX_DiscardUnknown()

func (*PrometheusResponseSamplesStats) XXX_Marshal

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

func (*PrometheusResponseSamplesStats) XXX_Merge

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

func (*PrometheusResponseSamplesStats) XXX_Size

func (m *PrometheusResponseSamplesStats) XXX_Size() int

func (*PrometheusResponseSamplesStats) XXX_Unmarshal

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

type PrometheusResponseStats

type PrometheusResponseStats struct {
	Samples              *PrometheusResponseSamplesStats `protobuf:"bytes,1,opt,name=samples,proto3" json:"samples"`
	XXX_NoUnkeyedLiteral struct{}                        `json:"-"`
	XXX_unrecognized     []byte                          `json:"-"`
	XXX_sizecache        int32                           `json:"-"`
}

func StatsMerge

func StatsMerge(resps []Response) *PrometheusResponseStats

StatsMerge merge the stats from 2 responses this function is similar to matrixMerge

func (*PrometheusResponseStats) Descriptor

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

func (*PrometheusResponseStats) GetSamples

func (*PrometheusResponseStats) Marshal

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

func (*PrometheusResponseStats) MarshalTo

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

func (*PrometheusResponseStats) MarshalToSizedBuffer

func (m *PrometheusResponseStats) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrometheusResponseStats) ProtoMessage

func (*PrometheusResponseStats) ProtoMessage()

func (*PrometheusResponseStats) Reset

func (m *PrometheusResponseStats) Reset()

func (*PrometheusResponseStats) Size

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

func (*PrometheusResponseStats) String

func (m *PrometheusResponseStats) String() string

func (*PrometheusResponseStats) Unmarshal

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

func (*PrometheusResponseStats) XXX_DiscardUnknown

func (m *PrometheusResponseStats) XXX_DiscardUnknown()

func (*PrometheusResponseStats) XXX_Marshal

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

func (*PrometheusResponseStats) XXX_Merge

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

func (*PrometheusResponseStats) XXX_Size

func (m *PrometheusResponseStats) XXX_Size() int

func (*PrometheusResponseStats) XXX_Unmarshal

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

type Request

type Request interface {
	// GetStart returns the start timestamp of the request in milliseconds.
	GetStart() int64
	// GetEnd returns the end timestamp of the request in milliseconds.
	GetEnd() int64
	// GetStep returns the step of the request in milliseconds.
	GetStep() int64
	// GetQuery returns the query of the request.
	GetQuery() string
	// GetCachingOptions returns the caching options.
	GetCachingOptions() CachingOptions
	// WithStartEnd clone the current request with different start and end timestamp.
	WithStartEnd(startTime int64, endTime int64) Request
	// WithQuery clone the current request with a different query.
	WithQuery(string) Request
	proto.Message
	// LogToSpan writes information about this request to an OpenTracing span
	LogToSpan(opentracing.Span)
	// GetStats returns the stats of the request.
	GetStats() string
	// WithStats clones the current `PrometheusRequest` with a new stats.
	WithStats(stats string) Request
}

Request represents a query range request that can be process by middlewares.

type RequestResponse

type RequestResponse struct {
	Request  Request
	Response Response
}

RequestResponse contains a request response and the respective request that was used.

func DoRequests

func DoRequests(ctx context.Context, downstream Handler, reqs []Request, limits Limits) ([]RequestResponse, error)

DoRequests executes a list of requests in parallel. The limits parameters is used to limit parallelism per single request.

type Response

type Response interface {
	proto.Message
	// GetHeaders returns the HTTP headers in the response.
	GetHeaders() []*PrometheusResponseHeader
	// GetStats returns the Prometheus query stats in the response.
	GetStats() *PrometheusResponseStats
}

Response represents a query range response.

type ResultsCacheConfig

type ResultsCacheConfig struct {
	CacheConfig                cache.Config `yaml:"cache"`
	Compression                string       `yaml:"compression"`
	CacheQueryableSamplesStats bool         `yaml:"cache_queryable_samples_stats"`
}

ResultsCacheConfig is the config for the results cache.

func (*ResultsCacheConfig) RegisterFlags

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

RegisterFlags registers flags.

func (*ResultsCacheConfig) Validate

func (cfg *ResultsCacheConfig) Validate(qCfg querier.Config) error

type RetryMiddlewareMetrics

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

func NewRetryMiddlewareMetrics

func NewRetryMiddlewareMetrics(registerer prometheus.Registerer) *RetryMiddlewareMetrics

type RoundTripFunc

type RoundTripFunc func(*http.Request) (*http.Response, error)

RoundTripFunc is to http.RoundTripper what http.HandlerFunc is to http.Handler.

func (RoundTripFunc) RoundTrip

func (f RoundTripFunc) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper.

type Sample

type Sample struct {
	Labels               []github_com_thanos_io_thanos_internal_cortex_cortexpb.LabelAdapter `` /* 132-byte string literal not displayed */
	SampleValue          float64                                                             `protobuf:"fixed64,2,opt,name=sampleValue,proto3" json:"value"`
	Timestamp            int64                                                               `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Histogram            *SampleHistogram                                                    `protobuf:"bytes,4,opt,name=histogram,proto3" json:"histogram"`
	XXX_NoUnkeyedLiteral struct{}                                                            `json:"-"`
	XXX_unrecognized     []byte                                                              `json:"-"`
	XXX_sizecache        int32                                                               `json:"-"`
}

func (*Sample) Descriptor

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

func (*Sample) GetHistogram added in v0.32.0

func (m *Sample) GetHistogram() *SampleHistogram

func (*Sample) GetSampleValue added in v0.32.0

func (m *Sample) GetSampleValue() float64

func (*Sample) GetTimestamp added in v0.32.0

func (m *Sample) GetTimestamp() int64

func (*Sample) Marshal

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

func (*Sample) MarshalJSON

func (s *Sample) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Sample) MarshalTo

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

func (*Sample) MarshalToSizedBuffer

func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Sample) ProtoMessage

func (*Sample) ProtoMessage()

func (*Sample) Reset

func (m *Sample) Reset()

func (*Sample) Size

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

func (*Sample) String

func (m *Sample) String() string

func (*Sample) Unmarshal

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

func (*Sample) UnmarshalJSON

func (s *Sample) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler and is used for unmarshalling a Prometheus instant query response (vector).

func (*Sample) XXX_DiscardUnknown

func (m *Sample) XXX_DiscardUnknown()

func (*Sample) XXX_Marshal

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

func (*Sample) XXX_Merge

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

func (*Sample) XXX_Size

func (m *Sample) XXX_Size() int

func (*Sample) XXX_Unmarshal

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

type SampleHistogram added in v0.32.0

type SampleHistogram struct {
	Count                float64            `protobuf:"fixed64,1,opt,name=count,proto3" json:"count,omitempty"`
	Sum                  float64            `protobuf:"fixed64,2,opt,name=sum,proto3" json:"sum,omitempty"`
	Buckets              []*HistogramBucket `protobuf:"bytes,3,rep,name=buckets,proto3" json:"buckets,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*SampleHistogram) Descriptor added in v0.32.0

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

func (*SampleHistogram) GetBuckets added in v0.32.0

func (m *SampleHistogram) GetBuckets() []*HistogramBucket

func (*SampleHistogram) GetCount added in v0.32.0

func (m *SampleHistogram) GetCount() float64

func (*SampleHistogram) GetSum added in v0.32.0

func (m *SampleHistogram) GetSum() float64

func (*SampleHistogram) Marshal added in v0.32.0

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

func (*SampleHistogram) MarshalTo added in v0.32.0

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

func (*SampleHistogram) MarshalToSizedBuffer added in v0.32.0

func (m *SampleHistogram) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SampleHistogram) ProtoMessage added in v0.32.0

func (*SampleHistogram) ProtoMessage()

func (*SampleHistogram) Reset added in v0.32.0

func (m *SampleHistogram) Reset()

func (*SampleHistogram) Size added in v0.32.0

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

func (*SampleHistogram) String added in v0.32.0

func (m *SampleHistogram) String() string

func (*SampleHistogram) Unmarshal added in v0.32.0

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

func (*SampleHistogram) XXX_DiscardUnknown added in v0.32.0

func (m *SampleHistogram) XXX_DiscardUnknown()

func (*SampleHistogram) XXX_Marshal added in v0.32.0

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

func (*SampleHistogram) XXX_Merge added in v0.32.0

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

func (*SampleHistogram) XXX_Size added in v0.32.0

func (m *SampleHistogram) XXX_Size() int

func (*SampleHistogram) XXX_Unmarshal added in v0.32.0

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

type SampleHistogramPair added in v0.32.0

type SampleHistogramPair struct {
	Timestamp            int64           `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Histogram            SampleHistogram `protobuf:"bytes,2,opt,name=histogram,proto3" json:"histogram"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func SliceHistogram added in v0.32.0

func SliceHistogram(histograms []SampleHistogramPair, minTs int64) []SampleHistogramPair

SliceHistogram assumes given histogram are sorted by timestamp in ascending order and return a sub slice whose first element's is the smallest timestamp that is strictly bigger than the given minTs. Empty slice is returned if minTs is bigger than all the timestamps in histogram.

func (*SampleHistogramPair) Descriptor added in v0.32.0

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

func (*SampleHistogramPair) GetHistogram added in v0.32.0

func (m *SampleHistogramPair) GetHistogram() SampleHistogram

func (*SampleHistogramPair) GetTimestamp added in v0.32.0

func (m *SampleHistogramPair) GetTimestamp() int64

func (*SampleHistogramPair) Marshal added in v0.32.0

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

func (*SampleHistogramPair) MarshalTo added in v0.32.0

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

func (*SampleHistogramPair) MarshalToSizedBuffer added in v0.32.0

func (m *SampleHistogramPair) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SampleHistogramPair) ProtoMessage added in v0.32.0

func (*SampleHistogramPair) ProtoMessage()

func (*SampleHistogramPair) Reset added in v0.32.0

func (m *SampleHistogramPair) Reset()

func (*SampleHistogramPair) Size added in v0.32.0

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

func (*SampleHistogramPair) String added in v0.32.0

func (m *SampleHistogramPair) String() string

func (*SampleHistogramPair) Unmarshal added in v0.32.0

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

func (*SampleHistogramPair) XXX_DiscardUnknown added in v0.32.0

func (m *SampleHistogramPair) XXX_DiscardUnknown()

func (*SampleHistogramPair) XXX_Marshal added in v0.32.0

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

func (*SampleHistogramPair) XXX_Merge added in v0.32.0

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

func (*SampleHistogramPair) XXX_Size added in v0.32.0

func (m *SampleHistogramPair) XXX_Size() int

func (*SampleHistogramPair) XXX_Unmarshal added in v0.32.0

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

type SampleStream

type SampleStream struct {
	Labels               []github_com_thanos_io_thanos_internal_cortex_cortexpb.LabelAdapter `` /* 132-byte string literal not displayed */
	Samples              []cortexpb.Sample                                                   `protobuf:"bytes,2,rep,name=samples,proto3" json:"values"`
	Histograms           []SampleHistogramPair                                               `protobuf:"bytes,3,rep,name=histograms,proto3" json:"histogram"`
	XXX_NoUnkeyedLiteral struct{}                                                            `json:"-"`
	XXX_unrecognized     []byte                                                              `json:"-"`
	XXX_sizecache        int32                                                               `json:"-"`
}

func (*SampleStream) Descriptor

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

func (*SampleStream) GetHistograms added in v0.32.0

func (m *SampleStream) GetHistograms() []SampleHistogramPair

func (*SampleStream) GetSamples

func (m *SampleStream) GetSamples() []cortexpb.Sample

func (*SampleStream) Marshal

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

func (*SampleStream) MarshalJSON

func (s *SampleStream) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*SampleStream) MarshalTo

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

func (*SampleStream) MarshalToSizedBuffer

func (m *SampleStream) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SampleStream) ProtoMessage

func (*SampleStream) ProtoMessage()

func (*SampleStream) Reset

func (m *SampleStream) Reset()

func (*SampleStream) Size

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

func (*SampleStream) String

func (m *SampleStream) String() string

func (*SampleStream) Unmarshal

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

func (*SampleStream) UnmarshalJSON

func (s *SampleStream) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler and is used for unmarshalling a Prometheus range query response (matrix).

func (*SampleStream) XXX_DiscardUnknown

func (m *SampleStream) XXX_DiscardUnknown()

func (*SampleStream) XXX_Marshal

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

func (*SampleStream) XXX_Merge

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

func (*SampleStream) XXX_Size

func (m *SampleStream) XXX_Size() int

func (*SampleStream) XXX_Unmarshal

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

type ShouldCacheFn

type ShouldCacheFn func(r Request) bool

ShouldCacheFn checks whether the current request should go to cache or not. If not, just send the request to next handler.

type StringSample

type StringSample struct {
	Value                string   `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	TimestampMs          int64    `protobuf:"varint,2,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*StringSample) Descriptor

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

func (*StringSample) GetTimestampMs

func (m *StringSample) GetTimestampMs() int64

func (*StringSample) GetValue

func (m *StringSample) GetValue() string

func (*StringSample) Marshal

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

func (StringSample) MarshalJSON

func (s StringSample) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*StringSample) MarshalTo

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

func (*StringSample) MarshalToSizedBuffer

func (m *StringSample) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StringSample) ProtoMessage

func (*StringSample) ProtoMessage()

func (*StringSample) Reset

func (m *StringSample) Reset()

func (*StringSample) Size

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

func (*StringSample) String

func (m *StringSample) String() string

func (*StringSample) Unmarshal

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

func (*StringSample) UnmarshalJSON

func (s *StringSample) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*StringSample) XXX_DiscardUnknown

func (m *StringSample) XXX_DiscardUnknown()

func (*StringSample) XXX_Marshal

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

func (*StringSample) XXX_Merge

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

func (*StringSample) XXX_Size

func (m *StringSample) XXX_Size() int

func (*StringSample) XXX_Unmarshal

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

type Tripperware

type Tripperware func(http.RoundTripper) http.RoundTripper

Tripperware is a signature for all http client-side middleware.

func NewTripperware

func NewTripperware(
	cfg Config,
	log log.Logger,
	limits Limits,
	codec Codec,
	cacheExtractor Extractor,
	engineOpts promql.EngineOpts,
	minShardingLookback time.Duration,
	registerer prometheus.Registerer,
	cacheGenNumberLoader CacheGenNumberLoader,
) (Tripperware, cache.Cache, error)

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

type Vector

type Vector struct {
	Samples              []*Sample `protobuf:"bytes,1,rep,name=samples,proto3" json:"samples,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*Vector) Descriptor

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

func (*Vector) GetSamples

func (m *Vector) GetSamples() []*Sample

func (*Vector) Marshal

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

func (*Vector) MarshalTo

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

func (*Vector) MarshalToSizedBuffer

func (m *Vector) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Vector) ProtoMessage

func (*Vector) ProtoMessage()

func (*Vector) Reset

func (m *Vector) Reset()

func (*Vector) Size

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

func (*Vector) String

func (m *Vector) String() string

func (*Vector) Unmarshal

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

func (*Vector) XXX_DiscardUnknown

func (m *Vector) XXX_DiscardUnknown()

func (*Vector) XXX_Marshal

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

func (*Vector) XXX_Merge

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

func (*Vector) XXX_Size

func (m *Vector) XXX_Size() int

func (*Vector) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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