Documentation
¶
Index ¶
- Constants
- Variables
- func BodyBuffer(res *http.Response) ([]byte, error)
- func EvaluateAtModifierFunction(query string, start, end int64) (string, error)
- func NewRoundTripper(next http.RoundTripper, codec Codec, headers []string, ...) http.RoundTripper
- func PrometheusResponseQueryableSamplesStatsPerStepJsoniterDecode(ptr unsafe.Pointer, iter *jsoniter.Iterator)
- func PrometheusResponseQueryableSamplesStatsPerStepJsoniterEncode(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func SliceSamples(samples []cortexpb.Sample, minTs int64) []cortexpb.Sample
- type Analysis
- func (*Analysis) Descriptor() ([]byte, []int)
- func (m *Analysis) GetChildren() []*Analysis
- func (m *Analysis) GetName() string
- func (m *Analysis) Marshal() (dAtA []byte, err error)
- func (m *Analysis) MarshalTo(dAtA []byte) (int, error)
- func (m *Analysis) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Analysis) ProtoMessage()
- func (m *Analysis) Reset()
- func (m *Analysis) Size() (n int)
- func (m *Analysis) String() string
- func (m *Analysis) Unmarshal(dAtA []byte) error
- func (m *Analysis) XXX_DiscardUnknown()
- func (m *Analysis) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Analysis) XXX_Merge(src proto.Message)
- func (m *Analysis) XXX_Size() int
- func (m *Analysis) XXX_Unmarshal(b []byte) error
- type Buffer
- type CacheGenNumberLoader
- type CacheSplitter
- type CachedResponse
- func (*CachedResponse) Descriptor() ([]byte, []int)
- 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 (*CachedResponse) ProtoMessage()
- func (m *CachedResponse) Reset()
- func (m *CachedResponse) Size() (n int)
- func (m *CachedResponse) String() string
- 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
- type CachingOptions
- func (*CachingOptions) Descriptor() ([]byte, []int)
- 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 (*CachingOptions) ProtoMessage()
- func (m *CachingOptions) Reset()
- func (m *CachingOptions) Size() (n int)
- func (m *CachingOptions) String() string
- 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
- type Codec
- type Config
- type Duration
- type Explanation
- func (*Explanation) Descriptor() ([]byte, []int)
- func (m *Explanation) GetChildren() []*Explanation
- func (m *Explanation) GetName() string
- func (m *Explanation) Marshal() (dAtA []byte, err error)
- func (m *Explanation) MarshalTo(dAtA []byte) (int, error)
- func (m *Explanation) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Explanation) ProtoMessage()
- func (m *Explanation) Reset()
- func (m *Explanation) Size() (n int)
- func (m *Explanation) String() string
- func (m *Explanation) Unmarshal(dAtA []byte) error
- func (m *Explanation) XXX_DiscardUnknown()
- func (m *Explanation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Explanation) XXX_Merge(src proto.Message)
- func (m *Explanation) XXX_Size() int
- func (m *Explanation) XXX_Unmarshal(b []byte) error
- type Extent
- func (*Extent) Descriptor() ([]byte, []int)
- 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 (*Extent) ProtoMessage()
- func (m *Extent) Reset()
- func (m *Extent) Size() (n int)
- func (m *Extent) String() string
- 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
- type Extractor
- type Handler
- type HandlerFunc
- type HistogramBucket
- func (*HistogramBucket) Descriptor() ([]byte, []int)
- func (m *HistogramBucket) GetBoundaries() int32
- func (m *HistogramBucket) GetCount() float64
- func (m *HistogramBucket) GetLower() float64
- func (m *HistogramBucket) GetUpper() float64
- func (m *HistogramBucket) Marshal() (dAtA []byte, err error)
- func (m *HistogramBucket) MarshalTo(dAtA []byte) (int, error)
- func (m *HistogramBucket) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*HistogramBucket) ProtoMessage()
- func (m *HistogramBucket) Reset()
- func (m *HistogramBucket) Size() (n int)
- func (m *HistogramBucket) String() string
- func (m *HistogramBucket) Unmarshal(dAtA []byte) error
- func (m *HistogramBucket) XXX_DiscardUnknown()
- func (m *HistogramBucket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HistogramBucket) XXX_Merge(src proto.Message)
- func (m *HistogramBucket) XXX_Size() int
- func (m *HistogramBucket) XXX_Unmarshal(b []byte) error
- type InstrumentMiddlewareMetrics
- type IntervalFn
- type Limits
- type Matrix
- func (*Matrix) Descriptor() ([]byte, []int)
- func (m *Matrix) GetSampleStreams() []*SampleStream
- func (m *Matrix) Marshal() (dAtA []byte, err error)
- func (m *Matrix) MarshalTo(dAtA []byte) (int, error)
- func (m *Matrix) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Matrix) ProtoMessage()
- func (m *Matrix) Reset()
- func (m *Matrix) Size() (n int)
- func (m *Matrix) String() string
- func (m *Matrix) Unmarshal(dAtA []byte) error
- func (m *Matrix) XXX_DiscardUnknown()
- func (m *Matrix) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Matrix) XXX_Merge(src proto.Message)
- func (m *Matrix) XXX_Size() int
- func (m *Matrix) XXX_Unmarshal(b []byte) error
- type Merger
- type Middleware
- func InstrumentMiddleware(name string, metrics *InstrumentMiddlewareMetrics) Middleware
- func MergeMiddlewares(middleware ...Middleware) Middleware
- func NewLimitsMiddleware(l Limits) Middleware
- func NewResultsCacheMiddleware(logger log.Logger, cfg ResultsCacheConfig, splitter CacheSplitter, ...) (Middleware, cache.Cache, error)
- func NewRetryMiddleware(log log.Logger, maxRetries int, metrics *RetryMiddlewareMetrics) Middleware
- func SplitByIntervalMiddleware(interval IntervalFn, limits Limits, merger Merger, ...) Middleware
- type MiddlewareFunc
- type NoopCollector
- type PrometheusData
- func (*PrometheusData) Descriptor() ([]byte, []int)
- func (m *PrometheusData) GetAnalysis() *Analysis
- func (m *PrometheusData) GetResult() []SampleStream
- func (m *PrometheusData) GetResultType() string
- func (m *PrometheusData) GetStats() *PrometheusResponseStats
- 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 (*PrometheusData) ProtoMessage()
- func (m *PrometheusData) Reset()
- func (m *PrometheusData) Size() (n int)
- func (m *PrometheusData) String() string
- 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
- type PrometheusInstantQueryData
- func (*PrometheusInstantQueryData) Descriptor() ([]byte, []int)
- func (m *PrometheusInstantQueryData) GetAnalysis() *Analysis
- func (m *PrometheusInstantQueryData) GetResult() PrometheusInstantQueryResult
- func (m *PrometheusInstantQueryData) GetResultType() string
- func (m *PrometheusInstantQueryData) GetStats() *PrometheusResponseStats
- func (m *PrometheusInstantQueryData) Marshal() (dAtA []byte, err error)
- func (s *PrometheusInstantQueryData) MarshalJSON() ([]byte, error)
- func (m *PrometheusInstantQueryData) MarshalTo(dAtA []byte) (int, error)
- func (m *PrometheusInstantQueryData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PrometheusInstantQueryData) ProtoMessage()
- func (m *PrometheusInstantQueryData) Reset()
- func (m *PrometheusInstantQueryData) Size() (n int)
- func (m *PrometheusInstantQueryData) String() string
- func (m *PrometheusInstantQueryData) Unmarshal(dAtA []byte) error
- func (s *PrometheusInstantQueryData) UnmarshalJSON(data []byte) error
- func (m *PrometheusInstantQueryData) XXX_DiscardUnknown()
- func (m *PrometheusInstantQueryData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PrometheusInstantQueryData) XXX_Merge(src proto.Message)
- func (m *PrometheusInstantQueryData) XXX_Size() int
- func (m *PrometheusInstantQueryData) XXX_Unmarshal(b []byte) error
- type PrometheusInstantQueryResponse
- func (*PrometheusInstantQueryResponse) Descriptor() ([]byte, []int)
- func (m *PrometheusInstantQueryResponse) GetData() PrometheusInstantQueryData
- func (m *PrometheusInstantQueryResponse) GetError() string
- func (m *PrometheusInstantQueryResponse) GetErrorType() string
- func (m *PrometheusInstantQueryResponse) GetHeaders() []*PrometheusResponseHeader
- func (resp *PrometheusInstantQueryResponse) GetStats() *PrometheusResponseStats
- func (m *PrometheusInstantQueryResponse) GetStatus() string
- func (m *PrometheusInstantQueryResponse) GetWarnings() []string
- func (m *PrometheusInstantQueryResponse) Marshal() (dAtA []byte, err error)
- func (m *PrometheusInstantQueryResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *PrometheusInstantQueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PrometheusInstantQueryResponse) ProtoMessage()
- func (m *PrometheusInstantQueryResponse) Reset()
- func (m *PrometheusInstantQueryResponse) Size() (n int)
- func (m *PrometheusInstantQueryResponse) String() string
- func (m *PrometheusInstantQueryResponse) Unmarshal(dAtA []byte) error
- func (m *PrometheusInstantQueryResponse) XXX_DiscardUnknown()
- func (m *PrometheusInstantQueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PrometheusInstantQueryResponse) XXX_Merge(src proto.Message)
- func (m *PrometheusInstantQueryResponse) XXX_Size() int
- func (m *PrometheusInstantQueryResponse) XXX_Unmarshal(b []byte) error
- type PrometheusInstantQueryResult
- func (*PrometheusInstantQueryResult) Descriptor() ([]byte, []int)
- func (m *PrometheusInstantQueryResult) GetMatrix() *Matrix
- func (m *PrometheusInstantQueryResult) GetResult() isPrometheusInstantQueryResult_Result
- func (m *PrometheusInstantQueryResult) GetScalar() *cortexpb.Sample
- func (m *PrometheusInstantQueryResult) GetStringSample() *StringSample
- func (m *PrometheusInstantQueryResult) GetVector() *Vector
- func (m *PrometheusInstantQueryResult) Marshal() (dAtA []byte, err error)
- func (m *PrometheusInstantQueryResult) MarshalTo(dAtA []byte) (int, error)
- func (m *PrometheusInstantQueryResult) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PrometheusInstantQueryResult) ProtoMessage()
- func (m *PrometheusInstantQueryResult) Reset()
- func (m *PrometheusInstantQueryResult) Size() (n int)
- func (m *PrometheusInstantQueryResult) String() string
- func (m *PrometheusInstantQueryResult) Unmarshal(dAtA []byte) error
- func (m *PrometheusInstantQueryResult) XXX_DiscardUnknown()
- func (m *PrometheusInstantQueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PrometheusInstantQueryResult) XXX_Merge(src proto.Message)
- func (*PrometheusInstantQueryResult) XXX_OneofWrappers() []interface{}
- func (m *PrometheusInstantQueryResult) XXX_Size() int
- func (m *PrometheusInstantQueryResult) XXX_Unmarshal(b []byte) error
- type PrometheusInstantQueryResult_Matrix
- type PrometheusInstantQueryResult_Scalar
- type PrometheusInstantQueryResult_StringSample
- type PrometheusInstantQueryResult_Vector
- type PrometheusRequest
- func (*PrometheusRequest) Descriptor() ([]byte, []int)
- 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) GetStats() string
- func (m *PrometheusRequest) GetStep() int64
- func (m *PrometheusRequest) GetTimeout() time.Duration
- func (q *PrometheusRequest) LogToSpan(sp opentracing.Span)
- 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 (*PrometheusRequest) ProtoMessage()
- func (m *PrometheusRequest) Reset()
- func (m *PrometheusRequest) Size() (n int)
- func (m *PrometheusRequest) String() string
- func (m *PrometheusRequest) Unmarshal(dAtA []byte) error
- func (q *PrometheusRequest) WithQuery(query string) Request
- func (q *PrometheusRequest) WithStartEnd(start int64, end int64) Request
- func (q *PrometheusRequest) WithStats(stats string) Request
- 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
- type PrometheusRequestHeader
- func (*PrometheusRequestHeader) Descriptor() ([]byte, []int)
- 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 (*PrometheusRequestHeader) ProtoMessage()
- func (m *PrometheusRequestHeader) Reset()
- func (m *PrometheusRequestHeader) Size() (n int)
- func (m *PrometheusRequestHeader) String() string
- 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
- type PrometheusResponse
- func (*PrometheusResponse) Descriptor() ([]byte, []int)
- func (m *PrometheusResponse) GetData() PrometheusData
- func (m *PrometheusResponse) GetError() string
- func (m *PrometheusResponse) GetErrorType() string
- func (m *PrometheusResponse) GetHeaders() []*PrometheusResponseHeader
- func (resp *PrometheusResponse) GetStats() *PrometheusResponseStats
- func (m *PrometheusResponse) GetStatus() string
- func (m *PrometheusResponse) GetWarnings() []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 (*PrometheusResponse) ProtoMessage()
- func (m *PrometheusResponse) Reset()
- func (m *PrometheusResponse) Size() (n int)
- func (m *PrometheusResponse) String() string
- 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
- type PrometheusResponseExtractor
- type PrometheusResponseHeader
- func (*PrometheusResponseHeader) Descriptor() ([]byte, []int)
- 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 (*PrometheusResponseHeader) ProtoMessage()
- func (m *PrometheusResponseHeader) Reset()
- func (m *PrometheusResponseHeader) Size() (n int)
- func (m *PrometheusResponseHeader) String() string
- 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
- type PrometheusResponseQueryableSamplesStatsPerStep
- func (*PrometheusResponseQueryableSamplesStatsPerStep) Descriptor() ([]byte, []int)
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) GetTimestampMs() int64
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) GetValue() int64
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) Marshal() (dAtA []byte, err error)
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) MarshalTo(dAtA []byte) (int, error)
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PrometheusResponseQueryableSamplesStatsPerStep) ProtoMessage()
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) Reset()
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) Size() (n int)
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) String() string
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) Unmarshal(dAtA []byte) error
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) XXX_DiscardUnknown()
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) XXX_Merge(src proto.Message)
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) XXX_Size() int
- func (m *PrometheusResponseQueryableSamplesStatsPerStep) XXX_Unmarshal(b []byte) error
- type PrometheusResponseSamplesStats
- func (*PrometheusResponseSamplesStats) Descriptor() ([]byte, []int)
- func (m *PrometheusResponseSamplesStats) GetTotalQueryableSamples() int64
- func (m *PrometheusResponseSamplesStats) GetTotalQueryableSamplesPerStep() []*PrometheusResponseQueryableSamplesStatsPerStep
- func (m *PrometheusResponseSamplesStats) Marshal() (dAtA []byte, err error)
- func (m *PrometheusResponseSamplesStats) MarshalTo(dAtA []byte) (int, error)
- func (m *PrometheusResponseSamplesStats) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PrometheusResponseSamplesStats) ProtoMessage()
- func (m *PrometheusResponseSamplesStats) Reset()
- func (m *PrometheusResponseSamplesStats) Size() (n int)
- func (m *PrometheusResponseSamplesStats) String() string
- func (m *PrometheusResponseSamplesStats) Unmarshal(dAtA []byte) error
- func (m *PrometheusResponseSamplesStats) XXX_DiscardUnknown()
- func (m *PrometheusResponseSamplesStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PrometheusResponseSamplesStats) XXX_Merge(src proto.Message)
- func (m *PrometheusResponseSamplesStats) XXX_Size() int
- func (m *PrometheusResponseSamplesStats) XXX_Unmarshal(b []byte) error
- type PrometheusResponseStats
- func (*PrometheusResponseStats) Descriptor() ([]byte, []int)
- func (m *PrometheusResponseStats) GetSamples() *PrometheusResponseSamplesStats
- func (m *PrometheusResponseStats) Marshal() (dAtA []byte, err error)
- func (m *PrometheusResponseStats) MarshalTo(dAtA []byte) (int, error)
- func (m *PrometheusResponseStats) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PrometheusResponseStats) ProtoMessage()
- func (m *PrometheusResponseStats) Reset()
- func (m *PrometheusResponseStats) Size() (n int)
- func (m *PrometheusResponseStats) String() string
- func (m *PrometheusResponseStats) Unmarshal(dAtA []byte) error
- func (m *PrometheusResponseStats) XXX_DiscardUnknown()
- func (m *PrometheusResponseStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PrometheusResponseStats) XXX_Merge(src proto.Message)
- func (m *PrometheusResponseStats) XXX_Size() int
- func (m *PrometheusResponseStats) XXX_Unmarshal(b []byte) error
- type Request
- type RequestResponse
- type Response
- type ResultsCacheConfig
- type RetryMiddlewareMetrics
- type RoundTripFunc
- type Sample
- func (*Sample) Descriptor() ([]byte, []int)
- func (m *Sample) GetHistogram() *SampleHistogram
- func (m *Sample) GetSampleValue() float64
- func (m *Sample) GetTimestamp() int64
- func (m *Sample) Marshal() (dAtA []byte, err error)
- func (s *Sample) MarshalJSON() ([]byte, error)
- func (m *Sample) MarshalTo(dAtA []byte) (int, error)
- func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Sample) ProtoMessage()
- func (m *Sample) Reset()
- func (m *Sample) Size() (n int)
- func (m *Sample) String() string
- func (m *Sample) Unmarshal(dAtA []byte) error
- func (s *Sample) UnmarshalJSON(data []byte) error
- func (m *Sample) XXX_DiscardUnknown()
- func (m *Sample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Sample) XXX_Merge(src proto.Message)
- func (m *Sample) XXX_Size() int
- func (m *Sample) XXX_Unmarshal(b []byte) error
- type SampleHistogram
- func (*SampleHistogram) Descriptor() ([]byte, []int)
- func (m *SampleHistogram) GetBuckets() []*HistogramBucket
- func (m *SampleHistogram) GetCount() float64
- func (m *SampleHistogram) GetSum() float64
- func (m *SampleHistogram) Marshal() (dAtA []byte, err error)
- func (m *SampleHistogram) MarshalTo(dAtA []byte) (int, error)
- func (m *SampleHistogram) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SampleHistogram) ProtoMessage()
- func (m *SampleHistogram) Reset()
- func (m *SampleHistogram) Size() (n int)
- func (m *SampleHistogram) String() string
- func (m *SampleHistogram) Unmarshal(dAtA []byte) error
- func (m *SampleHistogram) XXX_DiscardUnknown()
- func (m *SampleHistogram) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SampleHistogram) XXX_Merge(src proto.Message)
- func (m *SampleHistogram) XXX_Size() int
- func (m *SampleHistogram) XXX_Unmarshal(b []byte) error
- type SampleHistogramPair
- func (*SampleHistogramPair) Descriptor() ([]byte, []int)
- func (m *SampleHistogramPair) GetHistogram() SampleHistogram
- func (m *SampleHistogramPair) GetTimestamp() int64
- func (m *SampleHistogramPair) Marshal() (dAtA []byte, err error)
- func (m *SampleHistogramPair) MarshalTo(dAtA []byte) (int, error)
- func (m *SampleHistogramPair) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SampleHistogramPair) ProtoMessage()
- func (m *SampleHistogramPair) Reset()
- func (m *SampleHistogramPair) Size() (n int)
- func (m *SampleHistogramPair) String() string
- func (m *SampleHistogramPair) Unmarshal(dAtA []byte) error
- func (m *SampleHistogramPair) XXX_DiscardUnknown()
- func (m *SampleHistogramPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SampleHistogramPair) XXX_Merge(src proto.Message)
- func (m *SampleHistogramPair) XXX_Size() int
- func (m *SampleHistogramPair) XXX_Unmarshal(b []byte) error
- type SampleStream
- func (*SampleStream) Descriptor() ([]byte, []int)
- func (m *SampleStream) GetHistograms() []SampleHistogramPair
- func (m *SampleStream) GetSamples() []cortexpb.Sample
- func (m *SampleStream) Marshal() (dAtA []byte, err error)
- func (s *SampleStream) MarshalJSON() ([]byte, error)
- func (m *SampleStream) MarshalTo(dAtA []byte) (int, error)
- func (m *SampleStream) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SampleStream) ProtoMessage()
- func (m *SampleStream) Reset()
- func (m *SampleStream) Size() (n int)
- func (m *SampleStream) String() string
- func (m *SampleStream) Unmarshal(dAtA []byte) error
- func (s *SampleStream) UnmarshalJSON(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
- type ShouldCacheFn
- type StringSample
- func (*StringSample) Descriptor() ([]byte, []int)
- func (m *StringSample) GetTimestampMs() int64
- func (m *StringSample) GetValue() string
- func (m *StringSample) Marshal() (dAtA []byte, err error)
- func (s StringSample) MarshalJSON() ([]byte, error)
- func (m *StringSample) MarshalTo(dAtA []byte) (int, error)
- func (m *StringSample) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*StringSample) ProtoMessage()
- func (m *StringSample) Reset()
- func (m *StringSample) Size() (n int)
- func (m *StringSample) String() string
- func (m *StringSample) Unmarshal(dAtA []byte) error
- func (s *StringSample) UnmarshalJSON(b []byte) error
- func (m *StringSample) XXX_DiscardUnknown()
- func (m *StringSample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StringSample) XXX_Merge(src proto.Message)
- func (m *StringSample) XXX_Size() int
- func (m *StringSample) XXX_Unmarshal(b []byte) error
- type Tripperware
- type Vector
- func (*Vector) Descriptor() ([]byte, []int)
- func (m *Vector) GetSamples() []*Sample
- func (m *Vector) Marshal() (dAtA []byte, err error)
- func (m *Vector) MarshalTo(dAtA []byte) (int, error)
- func (m *Vector) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Vector) ProtoMessage()
- func (m *Vector) Reset()
- func (m *Vector) Size() (n int)
- func (m *Vector) String() string
- func (m *Vector) Unmarshal(dAtA []byte) error
- func (m *Vector) XXX_DiscardUnknown()
- func (m *Vector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Vector) XXX_Merge(src proto.Message)
- func (m *Vector) XXX_Size() int
- func (m *Vector) XXX_Unmarshal(b []byte) error
Constants ¶
const StatusSuccess = "success"
StatusSuccess Prometheus success result.
Variables ¶
var ( ErrInvalidLengthQueryrange = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQueryrange = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQueryrange = fmt.Errorf("proto: unexpected end of group") )
var ( // PassthroughMiddleware is a noop middleware PassthroughMiddleware = MiddlewareFunc(func(next Handler) Handler { return next }) )
var (
// ResultsCacheGenNumberHeaderName holds name of the header we want to set in http response
ResultsCacheGenNumberHeaderName = "Results-Cache-Gen-Number"
)
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 EvaluateAtModifierFunction ¶ added in v0.30.0
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 SliceSamples ¶ added in v0.30.0
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 Analysis ¶ added in v0.35.0
type Analysis struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` ExecutionTime Duration `protobuf:"bytes,2,opt,name=executionTime,proto3,customtype=Duration" json:"executionTime"` Children []*Analysis `protobuf:"bytes,3,rep,name=children,proto3" json:"children"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func AnalyzesMerge ¶ added in v0.35.0
func (*Analysis) Descriptor ¶ added in v0.35.0
func (*Analysis) GetChildren ¶ added in v0.35.0
func (*Analysis) MarshalToSizedBuffer ¶ added in v0.35.0
func (*Analysis) ProtoMessage ¶ added in v0.35.0
func (*Analysis) ProtoMessage()
func (*Analysis) XXX_DiscardUnknown ¶ added in v0.35.0
func (m *Analysis) XXX_DiscardUnknown()
func (*Analysis) XXX_Marshal ¶ added in v0.35.0
func (*Analysis) XXX_Unmarshal ¶ added in v0.35.0
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 CacheSplitter ¶
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) 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) 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.
type Duration ¶ added in v0.35.0
func (Duration) MarshalJSON ¶ added in v0.35.0
func (*Duration) UnmarshalJSON ¶ added in v0.35.0
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) GetResponse ¶
func (*Extent) GetTraceId ¶
func (*Extent) MarshalToSizedBuffer ¶
func (*Extent) ProtoMessage ¶
func (*Extent) ProtoMessage()
func (*Extent) XXX_DiscardUnknown ¶
func (m *Extent) XXX_DiscardUnknown()
func (*Extent) XXX_Marshal ¶
func (*Extent) XXX_Unmarshal ¶
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 HandlerFunc ¶
HandlerFunc is like http.HandlerFunc, but for 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 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) GetSampleStreams ¶
func (m *Matrix) GetSampleStreams() []*SampleStream
func (*Matrix) MarshalToSizedBuffer ¶
func (*Matrix) ProtoMessage ¶
func (*Matrix) ProtoMessage()
func (*Matrix) XXX_DiscardUnknown ¶
func (m *Matrix) XXX_DiscardUnknown()
func (*Matrix) XXX_Marshal ¶
func (*Matrix) XXX_Unmarshal ¶
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 ¶
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 ¶
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) 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"` Analysis *Analysis `protobuf:"bytes,4,opt,name=analysis,proto3" json:"analysis"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PrometheusData) Descriptor ¶
func (*PrometheusData) Descriptor() ([]byte, []int)
func (*PrometheusData) GetAnalysis ¶ added in v0.35.0
func (m *PrometheusData) GetAnalysis() *Analysis
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) 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"` Analysis *Analysis `protobuf:"bytes,4,opt,name=analysis,proto3" json:"analysis"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PrometheusInstantQueryData) Descriptor ¶
func (*PrometheusInstantQueryData) Descriptor() ([]byte, []int)
func (*PrometheusInstantQueryData) GetAnalysis ¶ added in v0.35.0
func (m *PrometheusInstantQueryData) GetAnalysis() *Analysis
func (*PrometheusInstantQueryData) GetResult ¶
func (m *PrometheusInstantQueryData) GetResult() PrometheusInstantQueryResult
func (*PrometheusInstantQueryData) GetResultType ¶
func (m *PrometheusInstantQueryData) GetResultType() string
func (*PrometheusInstantQueryData) GetStats ¶
func (m *PrometheusInstantQueryData) GetStats() *PrometheusResponseStats
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:"-"` Warnings []string `protobuf:"bytes,6,rep,name=Warnings,proto3" json:"warnings,omitempty"` 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 (m *PrometheusInstantQueryResponse) GetData() PrometheusInstantQueryData
func (*PrometheusInstantQueryResponse) GetError ¶
func (m *PrometheusInstantQueryResponse) GetError() string
func (*PrometheusInstantQueryResponse) GetErrorType ¶
func (m *PrometheusInstantQueryResponse) GetErrorType() string
func (*PrometheusInstantQueryResponse) GetHeaders ¶
func (m *PrometheusInstantQueryResponse) GetHeaders() []*PrometheusResponseHeader
func (*PrometheusInstantQueryResponse) GetStats ¶
func (resp *PrometheusInstantQueryResponse) GetStats() *PrometheusResponseStats
func (*PrometheusInstantQueryResponse) GetStatus ¶
func (m *PrometheusInstantQueryResponse) GetStatus() string
func (*PrometheusInstantQueryResponse) GetWarnings ¶ added in v0.35.0
func (m *PrometheusInstantQueryResponse) GetWarnings() []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 (m *PrometheusInstantQueryResponse) String() 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 (m *PrometheusInstantQueryResult) GetScalar() *cortexpb.Sample
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 (m *PrometheusInstantQueryResult) String() 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 ¶
func (m *PrometheusInstantQueryResult_Matrix) Size() (n int)
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 ¶
func (m *PrometheusInstantQueryResult_Scalar) Size() (n int)
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 ¶
func (m *PrometheusInstantQueryResult_StringSample) Size() (n int)
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 ¶
func (m *PrometheusInstantQueryResult_Vector) Size() (n int)
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:"-"` Warnings []string `protobuf:"bytes,6,rep,name=Warnings,proto3" json:"warnings,omitempty"` 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) GetWarnings ¶ added in v0.35.0
func (m *PrometheusResponse) GetWarnings() []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) Descriptor() ([]byte, []int)
func (*PrometheusResponseQueryableSamplesStatsPerStep) GetTimestampMs ¶
func (m *PrometheusResponseQueryableSamplesStatsPerStep) GetTimestampMs() int64
func (*PrometheusResponseQueryableSamplesStatsPerStep) GetValue ¶
func (m *PrometheusResponseQueryableSamplesStatsPerStep) GetValue() int64
func (*PrometheusResponseQueryableSamplesStatsPerStep) Marshal ¶
func (m *PrometheusResponseQueryableSamplesStatsPerStep) Marshal() (dAtA []byte, err error)
func (*PrometheusResponseQueryableSamplesStatsPerStep) MarshalTo ¶
func (m *PrometheusResponseQueryableSamplesStatsPerStep) MarshalTo(dAtA []byte) (int, error)
func (*PrometheusResponseQueryableSamplesStatsPerStep) MarshalToSizedBuffer ¶
func (m *PrometheusResponseQueryableSamplesStatsPerStep) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PrometheusResponseQueryableSamplesStatsPerStep) ProtoMessage ¶
func (*PrometheusResponseQueryableSamplesStatsPerStep) ProtoMessage()
func (*PrometheusResponseQueryableSamplesStatsPerStep) Reset ¶
func (m *PrometheusResponseQueryableSamplesStatsPerStep) Reset()
func (*PrometheusResponseQueryableSamplesStatsPerStep) Size ¶
func (m *PrometheusResponseQueryableSamplesStatsPerStep) Size() (n int)
func (*PrometheusResponseQueryableSamplesStatsPerStep) String ¶
func (m *PrometheusResponseQueryableSamplesStatsPerStep) String() string
func (*PrometheusResponseQueryableSamplesStatsPerStep) Unmarshal ¶
func (m *PrometheusResponseQueryableSamplesStatsPerStep) Unmarshal(dAtA []byte) error
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 (m *PrometheusResponseQueryableSamplesStatsPerStep) XXX_Merge(src proto.Message)
func (*PrometheusResponseQueryableSamplesStatsPerStep) XXX_Size ¶
func (m *PrometheusResponseQueryableSamplesStatsPerStep) XXX_Size() int
func (*PrometheusResponseQueryableSamplesStatsPerStep) XXX_Unmarshal ¶
func (m *PrometheusResponseQueryableSamplesStatsPerStep) XXX_Unmarshal(b []byte) error
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 (m *PrometheusResponseSamplesStats) GetTotalQueryableSamplesPerStep() []*PrometheusResponseQueryableSamplesStatsPerStep
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 (m *PrometheusResponseSamplesStats) String() 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 (m *PrometheusResponseStats) GetSamples() *PrometheusResponseSamplesStats
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 ¶
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.
type RetryMiddlewareMetrics ¶
type RetryMiddlewareMetrics struct {
// contains filtered or unexported fields
}
func NewRetryMiddlewareMetrics ¶
func NewRetryMiddlewareMetrics(registerer prometheus.Registerer) *RetryMiddlewareMetrics
type RoundTripFunc ¶
RoundTripFunc is to http.RoundTripper what http.HandlerFunc is to http.Handler.
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) GetHistogram ¶ added in v0.32.0
func (m *Sample) GetHistogram() *SampleHistogram
func (*Sample) GetSampleValue ¶ added in v0.32.0
func (*Sample) GetTimestamp ¶ added in v0.32.0
func (*Sample) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Sample) MarshalToSizedBuffer ¶
func (*Sample) ProtoMessage ¶
func (*Sample) ProtoMessage()
func (*Sample) UnmarshalJSON ¶
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 (*Sample) XXX_Unmarshal ¶
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) 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 ¶
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) 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) GetSamples ¶
func (*Vector) MarshalToSizedBuffer ¶
func (*Vector) ProtoMessage ¶
func (*Vector) ProtoMessage()
func (*Vector) XXX_DiscardUnknown ¶
func (m *Vector) XXX_DiscardUnknown()