Documentation ¶
Index ¶
- Variables
- func DecodeCachedHTTPResponse(res *CachedHTTPResponse) *http.Response
- func DecodeInstantQueryTimeParams(reqValues *url.Values, defaultNow func() time.Time) (time int64, err error)
- func DecodeLabelsQueryTimeParams(reqValues *url.Values, usePromDefaults bool) (start, end int64, err error)
- func DecodeRangeQueryTimeParams(reqValues *url.Values) (start, end, step int64, err error)
- func IsActiveNativeHistogramMetricsQuery(path string) bool
- func IsActiveSeriesQuery(path string) bool
- func IsCardinalityQuery(path string) bool
- func IsInstantQuery(path string) bool
- func IsLabelNamesQuery(path string) bool
- func IsLabelValuesQuery(path string) bool
- func IsLabelsQuery(path string) bool
- func IsRangeQuery(path string) bool
- func IsRemoteReadQuery(path string) bool
- func NewFrontendRunningRoundTripper(next http.RoundTripper, service services.Service, timeout time.Duration, ...) http.RoundTripper
- func ParseRemoteReadRequestValuesWithoutConsumingBody(req *http.Request) (url.Values, error)
- type CacheKeyGenerator
- type CachedHTTPHeader
- func (*CachedHTTPHeader) Descriptor() ([]byte, []int)
- func (this *CachedHTTPHeader) Equal(that interface{}) bool
- func (m *CachedHTTPHeader) GetName() string
- func (m *CachedHTTPHeader) GetValue() string
- func (this *CachedHTTPHeader) GoString() string
- func (m *CachedHTTPHeader) Marshal() (dAtA []byte, err error)
- func (m *CachedHTTPHeader) MarshalTo(dAtA []byte) (int, error)
- func (m *CachedHTTPHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CachedHTTPHeader) ProtoMessage()
- func (m *CachedHTTPHeader) Reset()
- func (m *CachedHTTPHeader) Size() (n int)
- func (this *CachedHTTPHeader) String() string
- func (m *CachedHTTPHeader) Unmarshal(dAtA []byte) error
- func (m *CachedHTTPHeader) XXX_DiscardUnknown()
- func (m *CachedHTTPHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CachedHTTPHeader) XXX_Merge(src proto.Message)
- func (m *CachedHTTPHeader) XXX_Size() int
- func (m *CachedHTTPHeader) XXX_Unmarshal(b []byte) error
- type CachedHTTPResponse
- func (*CachedHTTPResponse) Descriptor() ([]byte, []int)
- func (this *CachedHTTPResponse) Equal(that interface{}) bool
- func (m *CachedHTTPResponse) GetBody() []byte
- func (m *CachedHTTPResponse) GetCacheKey() string
- func (m *CachedHTTPResponse) GetHeaders() []*CachedHTTPHeader
- func (m *CachedHTTPResponse) GetStatusCode() int32
- func (this *CachedHTTPResponse) GoString() string
- func (m *CachedHTTPResponse) Marshal() (dAtA []byte, err error)
- func (m *CachedHTTPResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *CachedHTTPResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CachedHTTPResponse) ProtoMessage()
- func (m *CachedHTTPResponse) Reset()
- func (m *CachedHTTPResponse) Size() (n int)
- func (this *CachedHTTPResponse) String() string
- func (m *CachedHTTPResponse) Unmarshal(dAtA []byte) error
- func (m *CachedHTTPResponse) XXX_DiscardUnknown()
- func (m *CachedHTTPResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CachedHTTPResponse) XXX_Merge(src proto.Message)
- func (m *CachedHTTPResponse) XXX_Size() int
- func (m *CachedHTTPResponse) XXX_Unmarshal(b []byte) error
- type CachedResponse
- func (*CachedResponse) Descriptor() ([]byte, []int)
- func (this *CachedResponse) Equal(that interface{}) bool
- func (m *CachedResponse) GetExtents() []Extent
- func (m *CachedResponse) GetKey() string
- func (this *CachedResponse) GoString() 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 (this *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 Codec
- type Config
- type DefaultCacheKeyGenerator
- func (g DefaultCacheKeyGenerator) LabelValues(r *http.Request) (*GenericQueryCacheKey, error)
- func (DefaultCacheKeyGenerator) LabelValuesCardinality(r *http.Request) (*GenericQueryCacheKey, error)
- func (g DefaultCacheKeyGenerator) QueryRequest(_ context.Context, userID string, r MetricsQueryRequest) string
- type EstimatedSeriesCount
- type Extent
- func (*Extent) Descriptor() ([]byte, []int)
- func (this *Extent) Equal(that interface{}) bool
- func (m *Extent) GetEnd() int64
- func (m *Extent) GetQueryTimestampMs() int64
- func (m *Extent) GetResponse() *types.Any
- func (m *Extent) GetStart() int64
- func (m *Extent) GetTraceId() string
- func (this *Extent) GoString() 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 (this *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 GenericQueryCacheKey
- type HandlerFunc
- type Hints
- type LabelsQueryRequest
- type Limits
- type Merger
- type MetricsQueryHandler
- type MetricsQueryMiddleware
- type MetricsQueryMiddlewareFunc
- type MetricsQueryRequest
- type Options
- func (*Options) Descriptor() ([]byte, []int)
- func (this *Options) Equal(that interface{}) bool
- func (m *Options) GetCacheDisabled() bool
- func (m *Options) GetInstantSplitDisabled() bool
- func (m *Options) GetInstantSplitInterval() int64
- func (m *Options) GetShardingDisabled() bool
- func (m *Options) GetTotalShards() int32
- func (this *Options) GoString() string
- func (m *Options) Marshal() (dAtA []byte, err error)
- func (m *Options) MarshalTo(dAtA []byte) (int, error)
- func (m *Options) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Options) ProtoMessage()
- func (m *Options) Reset()
- func (m *Options) Size() (n int)
- func (this *Options) String() string
- func (m *Options) Unmarshal(dAtA []byte) error
- func (m *Options) XXX_DiscardUnknown()
- func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Options) XXX_Merge(src proto.Message)
- func (m *Options) XXX_Size() int
- func (m *Options) XXX_Unmarshal(b []byte) error
- type PrometheusData
- func (*PrometheusData) Descriptor() ([]byte, []int)
- func (this *PrometheusData) Equal(that interface{}) bool
- func (m *PrometheusData) GetResult() []SampleStream
- func (m *PrometheusData) GetResultType() string
- func (this *PrometheusData) GoString() string
- func (m *PrometheusData) Marshal() (dAtA []byte, err error)
- func (d *PrometheusData) MarshalJSON() ([]byte, 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 (this *PrometheusData) String() string
- func (m *PrometheusData) Unmarshal(dAtA []byte) error
- func (d *PrometheusData) UnmarshalJSON(b []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 PrometheusHeader
- func (*PrometheusHeader) Descriptor() ([]byte, []int)
- func (this *PrometheusHeader) Equal(that interface{}) bool
- func (m *PrometheusHeader) GetName() string
- func (m *PrometheusHeader) GetValues() []string
- func (this *PrometheusHeader) GoString() string
- func (m *PrometheusHeader) Marshal() (dAtA []byte, err error)
- func (m *PrometheusHeader) MarshalTo(dAtA []byte) (int, error)
- func (m *PrometheusHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PrometheusHeader) ProtoMessage()
- func (m *PrometheusHeader) Reset()
- func (m *PrometheusHeader) Size() (n int)
- func (this *PrometheusHeader) String() string
- func (m *PrometheusHeader) Unmarshal(dAtA []byte) error
- func (m *PrometheusHeader) XXX_DiscardUnknown()
- func (m *PrometheusHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PrometheusHeader) XXX_Merge(src proto.Message)
- func (m *PrometheusHeader) XXX_Size() int
- func (m *PrometheusHeader) XXX_Unmarshal(b []byte) error
- type PrometheusInstantQueryRequest
- func (r *PrometheusInstantQueryRequest) AddSpanTags(sp opentracing.Span)
- func (r *PrometheusInstantQueryRequest) GetEnd() int64
- func (r *PrometheusInstantQueryRequest) GetHeaders() []*PrometheusHeader
- func (r *PrometheusInstantQueryRequest) GetHints() *Hints
- func (r *PrometheusInstantQueryRequest) GetID() int64
- func (r *PrometheusInstantQueryRequest) GetMaxT() int64
- func (r *PrometheusInstantQueryRequest) GetMinT() int64
- func (r *PrometheusInstantQueryRequest) GetOptions() Options
- func (r *PrometheusInstantQueryRequest) GetPath() string
- func (r *PrometheusInstantQueryRequest) GetQuery() string
- func (r *PrometheusInstantQueryRequest) GetStart() int64
- func (r *PrometheusInstantQueryRequest) GetStep() int64
- func (r *PrometheusInstantQueryRequest) GetTime() int64
- func (r *PrometheusInstantQueryRequest) WithEstimatedSeriesCountHint(count uint64) (MetricsQueryRequest, error)
- func (r *PrometheusInstantQueryRequest) WithExpr(queryExpr parser.Expr) (MetricsQueryRequest, error)
- func (r *PrometheusInstantQueryRequest) WithHeaders(headers []*PrometheusHeader) (MetricsQueryRequest, error)
- func (r *PrometheusInstantQueryRequest) WithID(id int64) (MetricsQueryRequest, error)
- func (r *PrometheusInstantQueryRequest) WithQuery(query string) (MetricsQueryRequest, error)
- func (r *PrometheusInstantQueryRequest) WithStartEnd(time int64, _ int64) (MetricsQueryRequest, error)
- func (r *PrometheusInstantQueryRequest) WithTotalQueriesHint(totalQueries int32) (MetricsQueryRequest, error)
- type PrometheusLabelNamesQueryRequest
- func (r *PrometheusLabelNamesQueryRequest) AddSpanTags(sp opentracing.Span)
- func (r *PrometheusLabelNamesQueryRequest) GetEnd() int64
- func (r *PrometheusLabelNamesQueryRequest) GetEndOrDefault() int64
- func (r *PrometheusLabelNamesQueryRequest) GetID() int64
- func (r *PrometheusLabelNamesQueryRequest) GetLabelMatcherSets() []string
- func (r *PrometheusLabelNamesQueryRequest) GetLabelName() string
- func (r *PrometheusLabelNamesQueryRequest) GetLimit() uint64
- func (r *PrometheusLabelNamesQueryRequest) GetPath() string
- func (r *PrometheusLabelNamesQueryRequest) GetStart() int64
- func (r *PrometheusLabelNamesQueryRequest) GetStartOrDefault() int64
- type PrometheusLabelValuesQueryRequest
- func (r *PrometheusLabelValuesQueryRequest) AddSpanTags(sp opentracing.Span)
- func (r *PrometheusLabelValuesQueryRequest) GetEnd() int64
- func (r *PrometheusLabelValuesQueryRequest) GetEndOrDefault() int64
- func (r *PrometheusLabelValuesQueryRequest) GetID() int64
- func (r *PrometheusLabelValuesQueryRequest) GetLabelMatcherSets() []string
- func (r *PrometheusLabelValuesQueryRequest) GetLabelName() string
- func (r *PrometheusLabelValuesQueryRequest) GetLimit() uint64
- func (r *PrometheusLabelValuesQueryRequest) GetStart() int64
- func (r *PrometheusLabelValuesQueryRequest) GetStartOrDefault() int64
- type PrometheusRangeQueryRequest
- func (r *PrometheusRangeQueryRequest) AddSpanTags(sp opentracing.Span)
- func (r *PrometheusRangeQueryRequest) GetEnd() int64
- func (r *PrometheusRangeQueryRequest) GetHeaders() []*PrometheusHeader
- func (r *PrometheusRangeQueryRequest) GetHints() *Hints
- func (r *PrometheusRangeQueryRequest) GetID() int64
- func (r *PrometheusRangeQueryRequest) GetMaxT() int64
- func (r *PrometheusRangeQueryRequest) GetMinT() int64
- func (r *PrometheusRangeQueryRequest) GetOptions() Options
- func (r *PrometheusRangeQueryRequest) GetPath() string
- func (r *PrometheusRangeQueryRequest) GetQuery() string
- func (r *PrometheusRangeQueryRequest) GetStart() int64
- func (r *PrometheusRangeQueryRequest) GetStep() int64
- func (r *PrometheusRangeQueryRequest) WithEstimatedSeriesCountHint(count uint64) (MetricsQueryRequest, error)
- func (r *PrometheusRangeQueryRequest) WithExpr(queryExpr parser.Expr) (MetricsQueryRequest, error)
- func (r *PrometheusRangeQueryRequest) WithHeaders(headers []*PrometheusHeader) (MetricsQueryRequest, error)
- func (r *PrometheusRangeQueryRequest) WithID(id int64) (MetricsQueryRequest, error)
- func (r *PrometheusRangeQueryRequest) WithQuery(query string) (MetricsQueryRequest, error)
- func (r *PrometheusRangeQueryRequest) WithStartEnd(start int64, end int64) (MetricsQueryRequest, error)
- func (r *PrometheusRangeQueryRequest) WithTotalQueriesHint(totalQueries int32) (MetricsQueryRequest, error)
- type PrometheusResponse
- func (*PrometheusResponse) Descriptor() ([]byte, []int)
- func (this *PrometheusResponse) Equal(that interface{}) bool
- func (m *PrometheusResponse) GetData() *PrometheusData
- func (m *PrometheusResponse) GetError() string
- func (m *PrometheusResponse) GetErrorType() string
- func (m *PrometheusResponse) GetHeaders() []*PrometheusHeader
- func (m *PrometheusResponse) GetInfos() []string
- func (m *PrometheusResponse) GetStatus() string
- func (m *PrometheusResponse) GetWarnings() []string
- func (this *PrometheusResponse) GoString() 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 (this *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 QueryDetails
- type QueryStatistics
- func (*QueryStatistics) Descriptor() ([]byte, []int)
- func (this *QueryStatistics) Equal(that interface{}) bool
- func (m *QueryStatistics) GetEstimatedSeriesCount() uint64
- func (this *QueryStatistics) GoString() string
- func (m *QueryStatistics) Marshal() (dAtA []byte, err error)
- func (m *QueryStatistics) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryStatistics) ProtoMessage()
- func (m *QueryStatistics) Reset()
- func (m *QueryStatistics) Size() (n int)
- func (this *QueryStatistics) String() string
- func (m *QueryStatistics) Unmarshal(dAtA []byte) error
- func (m *QueryStatistics) XXX_DiscardUnknown()
- func (m *QueryStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryStatistics) XXX_Merge(src proto.Message)
- func (m *QueryStatistics) XXX_Size() int
- func (m *QueryStatistics) XXX_Unmarshal(b []byte) error
- type Response
- type ResultsCacheConfig
- type RoundTripFunc
- type SampleStream
- func (*SampleStream) Descriptor() ([]byte, []int)
- func (this *SampleStream) Equal(that interface{}) bool
- func (m *SampleStream) GetHistograms() []mimirpb.FloatHistogramPair
- func (m *SampleStream) GetSamples() []mimirpb.Sample
- func (this *SampleStream) GoString() string
- 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 (this *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 Tripperware
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthModel = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowModel = fmt.Errorf("proto: integer overflow") )
var ErrUnsupportedRequest = errors.New("request is not cacheable")
ErrUnsupportedRequest is intended to be used with CacheKeyGenerator
Functions ¶
func DecodeCachedHTTPResponse ¶
func DecodeCachedHTTPResponse(res *CachedHTTPResponse) *http.Response
func DecodeInstantQueryTimeParams ¶
func DecodeInstantQueryTimeParams(reqValues *url.Values, defaultNow func() time.Time) (time int64, err error)
DecodeInstantQueryTimeParams encapsulates Prometheus instant query time param parsing, emulating the logic in prometheus/prometheus/web/api/v1#API.query.
func DecodeLabelsQueryTimeParams ¶
func DecodeLabelsQueryTimeParams(reqValues *url.Values, usePromDefaults bool) (start, end int64, err error)
DecodeLabelsQueryTimeParams encapsulates Prometheus label names and label values query time param parsing, emulating the logic in prometheus/prometheus/web/api/v1#API.labelNames and v1#API.labelValues.
Setting `usePromDefaults` true will set missing timestamp params to the Prometheus default min and max query timestamps; false will default to 0 for missing timestamp params.
func DecodeRangeQueryTimeParams ¶
DecodeRangeQueryTimeParams encapsulates Prometheus instant query time param parsing, emulating the logic in prometheus/prometheus/web/api/v1#API.query_range.
func IsActiveSeriesQuery ¶
func IsCardinalityQuery ¶
func IsInstantQuery ¶
func IsLabelNamesQuery ¶
func IsLabelValuesQuery ¶
func IsLabelsQuery ¶
func IsRangeQuery ¶
func IsRemoteReadQuery ¶
func NewFrontendRunningRoundTripper ¶
func NewFrontendRunningRoundTripper(next http.RoundTripper, service services.Service, timeout time.Duration, log log.Logger) http.RoundTripper
func ParseRemoteReadRequestValuesWithoutConsumingBody ¶
ParseRemoteReadRequestValuesWithoutConsumingBody parses a remote read request without consuming the body. It does not check the req.Body size, so it is the caller's responsibility to ensure that the body is not too large.
Types ¶
type CacheKeyGenerator ¶
type CacheKeyGenerator interface { // QueryRequest should generate a cache key based on the tenant ID and MetricsQueryRequest. QueryRequest(ctx context.Context, tenantID string, r MetricsQueryRequest) string // LabelValues should return a cache key for a label values request. The cache key does not need to contain the tenant ID. // LabelValues can return ErrUnsupportedRequest, in which case the response won't be treated as an error, but the item will still not be cached. // LabelValues should return a nil *GenericQueryCacheKey when it returns an error and // should always return non-nil *GenericQueryCacheKey when the returned error is nil. LabelValues(r *http.Request) (*GenericQueryCacheKey, error) // LabelValuesCardinality should return a cache key for a label values cardinality request. The cache key does not need to contain the tenant ID. // LabelValuesCardinality can return ErrUnsupportedRequest, in which case the response won't be treated as an error, but the item will still not be cached. // LabelValuesCardinality should return a nil *GenericQueryCacheKey when it returns an error and // should always return non-nil *GenericQueryCacheKey when the returned error is nil. LabelValuesCardinality(r *http.Request) (*GenericQueryCacheKey, error) }
CacheKeyGenerator generates cache keys. This is a useful interface for downstream consumers who wish to implement their own strategies.
type CachedHTTPHeader ¶
type CachedHTTPHeader struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` }
CachedHTTPHeader holds a HTTP header.
func (*CachedHTTPHeader) Descriptor ¶
func (*CachedHTTPHeader) Descriptor() ([]byte, []int)
func (*CachedHTTPHeader) Equal ¶
func (this *CachedHTTPHeader) Equal(that interface{}) bool
func (*CachedHTTPHeader) GetName ¶
func (m *CachedHTTPHeader) GetName() string
func (*CachedHTTPHeader) GetValue ¶
func (m *CachedHTTPHeader) GetValue() string
func (*CachedHTTPHeader) GoString ¶
func (this *CachedHTTPHeader) GoString() string
func (*CachedHTTPHeader) Marshal ¶
func (m *CachedHTTPHeader) Marshal() (dAtA []byte, err error)
func (*CachedHTTPHeader) MarshalToSizedBuffer ¶
func (m *CachedHTTPHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CachedHTTPHeader) ProtoMessage ¶
func (*CachedHTTPHeader) ProtoMessage()
func (*CachedHTTPHeader) Reset ¶
func (m *CachedHTTPHeader) Reset()
func (*CachedHTTPHeader) Size ¶
func (m *CachedHTTPHeader) Size() (n int)
func (*CachedHTTPHeader) String ¶
func (this *CachedHTTPHeader) String() string
func (*CachedHTTPHeader) Unmarshal ¶
func (m *CachedHTTPHeader) Unmarshal(dAtA []byte) error
func (*CachedHTTPHeader) XXX_DiscardUnknown ¶
func (m *CachedHTTPHeader) XXX_DiscardUnknown()
func (*CachedHTTPHeader) XXX_Marshal ¶
func (m *CachedHTTPHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CachedHTTPHeader) XXX_Merge ¶
func (m *CachedHTTPHeader) XXX_Merge(src proto.Message)
func (*CachedHTTPHeader) XXX_Size ¶
func (m *CachedHTTPHeader) XXX_Size() int
func (*CachedHTTPHeader) XXX_Unmarshal ¶
func (m *CachedHTTPHeader) XXX_Unmarshal(b []byte) error
type CachedHTTPResponse ¶
type CachedHTTPResponse struct { // cacheKey contains the non-hashed cache key, used to guarantee there haven't // been any hashed cache key collision. CacheKey string `protobuf:"bytes,1,opt,name=cache_key,json=cacheKey,proto3" json:"cache_key,omitempty"` // statusCode contains the HTTP response status code. StatusCode int32 `protobuf:"varint,2,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` // headers contains the HTTP response headers. Headers []*CachedHTTPHeader `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty"` // body contains the HTTP response body. Body []byte `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` }
CachedHTTPResponse holds a generic HTTP response in the query results cache.
func EncodeCachedHTTPResponse ¶
func EncodeCachedHTTPResponse(cacheKey string, res *http.Response) (*CachedHTTPResponse, error)
EncodeCachedHTTPResponse encodes the input http.Response into CachedHTTPResponse. The input res.Body is replaced in this function, so that it can be safely consumed again.
func (*CachedHTTPResponse) Descriptor ¶
func (*CachedHTTPResponse) Descriptor() ([]byte, []int)
func (*CachedHTTPResponse) Equal ¶
func (this *CachedHTTPResponse) Equal(that interface{}) bool
func (*CachedHTTPResponse) GetBody ¶
func (m *CachedHTTPResponse) GetBody() []byte
func (*CachedHTTPResponse) GetCacheKey ¶
func (m *CachedHTTPResponse) GetCacheKey() string
func (*CachedHTTPResponse) GetHeaders ¶
func (m *CachedHTTPResponse) GetHeaders() []*CachedHTTPHeader
func (*CachedHTTPResponse) GetStatusCode ¶
func (m *CachedHTTPResponse) GetStatusCode() int32
func (*CachedHTTPResponse) GoString ¶
func (this *CachedHTTPResponse) GoString() string
func (*CachedHTTPResponse) Marshal ¶
func (m *CachedHTTPResponse) Marshal() (dAtA []byte, err error)
func (*CachedHTTPResponse) MarshalTo ¶
func (m *CachedHTTPResponse) MarshalTo(dAtA []byte) (int, error)
func (*CachedHTTPResponse) MarshalToSizedBuffer ¶
func (m *CachedHTTPResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CachedHTTPResponse) ProtoMessage ¶
func (*CachedHTTPResponse) ProtoMessage()
func (*CachedHTTPResponse) Reset ¶
func (m *CachedHTTPResponse) Reset()
func (*CachedHTTPResponse) Size ¶
func (m *CachedHTTPResponse) Size() (n int)
func (*CachedHTTPResponse) String ¶
func (this *CachedHTTPResponse) String() string
func (*CachedHTTPResponse) Unmarshal ¶
func (m *CachedHTTPResponse) Unmarshal(dAtA []byte) error
func (*CachedHTTPResponse) XXX_DiscardUnknown ¶
func (m *CachedHTTPResponse) XXX_DiscardUnknown()
func (*CachedHTTPResponse) XXX_Marshal ¶
func (m *CachedHTTPResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CachedHTTPResponse) XXX_Merge ¶
func (m *CachedHTTPResponse) XXX_Merge(src proto.Message)
func (*CachedHTTPResponse) XXX_Size ¶
func (m *CachedHTTPResponse) XXX_Size() int
func (*CachedHTTPResponse) XXX_Unmarshal ¶
func (m *CachedHTTPResponse) XXX_Unmarshal(b []byte) error
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"` }
func (*CachedResponse) Descriptor ¶
func (*CachedResponse) Descriptor() ([]byte, []int)
func (*CachedResponse) Equal ¶
func (this *CachedResponse) Equal(that interface{}) bool
func (*CachedResponse) GetExtents ¶
func (m *CachedResponse) GetExtents() []Extent
func (*CachedResponse) GetKey ¶
func (m *CachedResponse) GetKey() string
func (*CachedResponse) GoString ¶
func (this *CachedResponse) GoString() 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 (this *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 Codec ¶
type Codec interface { Merger // DecodeMetricsQueryRequest decodes a MetricsQueryRequest from an http request. DecodeMetricsQueryRequest(context.Context, *http.Request) (MetricsQueryRequest, error) // DecodeLabelsQueryRequest decodes a LabelsQueryRequest from an http request. DecodeLabelsQueryRequest(context.Context, *http.Request) (LabelsQueryRequest, 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, MetricsQueryRequest, log.Logger) (Response, error) // EncodeMetricsQueryRequest encodes a MetricsQueryRequest into an http request. EncodeMetricsQueryRequest(context.Context, MetricsQueryRequest) (*http.Request, error) // EncodeLabelsQueryRequest encodes a LabelsQueryRequest into an http request. EncodeLabelsQueryRequest(context.Context, LabelsQueryRequest) (*http.Request, error) // EncodeResponse encodes a Response into an http response. EncodeResponse(context.Context, *http.Request, Response) (*http.Response, error) }
Codec is used to encode/decode query requests and responses so they can be passed down to middlewares.
func NewPrometheusCodec ¶
func NewPrometheusCodec( registerer prometheus.Registerer, lookbackDelta time.Duration, queryResultResponseFormat string, ) Codec
type Config ¶
type Config struct { SplitQueriesByInterval time.Duration `yaml:"split_queries_by_interval" category:"advanced"` ResultsCacheConfig `yaml:"results_cache"` CacheResults bool `yaml:"cache_results"` MaxRetries int `yaml:"max_retries" category:"advanced"` NotRunningTimeout time.Duration `yaml:"not_running_timeout" category:"advanced"` ShardedQueries bool `yaml:"parallelize_shardable_queries"` PrunedQueries bool `yaml:"prune_queries" category:"experimental"` TargetSeriesPerShard uint64 `yaml:"query_sharding_target_series_per_shard" category:"advanced"` ShardActiveSeriesQueries bool `yaml:"shard_active_series_queries" category:"experimental"` UseActiveSeriesDecoder bool `yaml:"use_active_series_decoder" category:"experimental"` // CacheKeyGenerator allows to inject a CacheKeyGenerator to use for generating cache keys. // If nil, the querymiddleware package uses a DefaultCacheKeyGenerator with SplitQueriesByInterval. CacheKeyGenerator CacheKeyGenerator `yaml:"-"` // ExtraInstantQueryMiddlewares and ExtraRangeQueryMiddlewares allows to // inject custom middlewares into the middleware chain of instant and // range queries. These middlewares will be placed right after default // middlewares and before the query sharding middleware, in order to avoid // interfering with core functionality. ExtraInstantQueryMiddlewares []MetricsQueryMiddleware `yaml:"-"` ExtraRangeQueryMiddlewares []MetricsQueryMiddleware `yaml:"-"` QueryResultResponseFormat string `yaml:"query_result_response_format"` }
Config for query_range middleware chain.
func (*Config) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet.
type DefaultCacheKeyGenerator ¶
type DefaultCacheKeyGenerator struct {
// contains filtered or unexported fields
}
func NewDefaultCacheKeyGenerator ¶
func NewDefaultCacheKeyGenerator(codec Codec, interval time.Duration) DefaultCacheKeyGenerator
func (DefaultCacheKeyGenerator) LabelValues ¶
func (g DefaultCacheKeyGenerator) LabelValues(r *http.Request) (*GenericQueryCacheKey, error)
func (DefaultCacheKeyGenerator) LabelValuesCardinality ¶
func (DefaultCacheKeyGenerator) LabelValuesCardinality(r *http.Request) (*GenericQueryCacheKey, error)
func (DefaultCacheKeyGenerator) QueryRequest ¶
func (g DefaultCacheKeyGenerator) QueryRequest(_ context.Context, userID string, r MetricsQueryRequest) string
QueryRequest generates a cache key based on the userID, MetricsQueryRequest and interval.
type EstimatedSeriesCount ¶
type EstimatedSeriesCount struct {
EstimatedSeriesCount uint64
}
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"` // Unix timestamp when the query with this response was executed. // If the response is combination of multiple queries over time, all of which had timestamp set, this is the timestamp of oldest query. // When merging extents and some of them have 0 query timestamp, we keep non-zero timestamp, if possible. QueryTimestampMs int64 `protobuf:"varint,6,opt,name=query_timestamp_ms,json=queryTimestampMs,proto3" json:"query_timestamp_ms,omitempty"` }
func (*Extent) Descriptor ¶
func (*Extent) GetQueryTimestampMs ¶
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 }
Extractor is used by the cache to extract a subset of a response from a cache entry.
type GenericQueryCacheKey ¶
type HandlerFunc ¶
type HandlerFunc func(context.Context, MetricsQueryRequest) (Response, error)
HandlerFunc is like http.HandlerFunc, but for MetricsQueryHandler.
func (HandlerFunc) Do ¶
func (q HandlerFunc) Do(ctx context.Context, req MetricsQueryRequest) (Response, error)
Do implements MetricsQueryHandler.
type Hints ¶
type Hints struct { // Total number of queries that are expected to be executed to serve the original request. TotalQueries int32 // Estimated total number of series that a request might return. CardinalityEstimate *EstimatedSeriesCount }
func (*Hints) GetCardinalityEstimate ¶
func (h *Hints) GetCardinalityEstimate() *EstimatedSeriesCount
func (*Hints) GetEstimatedSeriesCount ¶
func (*Hints) GetTotalQueries ¶
type LabelsQueryRequest ¶
type LabelsQueryRequest interface { // GetLabelName returns the label name param from a Label Values request `/api/v1/label/<label_name>/values` // or an empty string for a Label Names request `/api/v1/labels` GetLabelName() string // GetStart returns the start timestamp of the request in milliseconds GetStart() int64 // GetStartOrDefault returns the start timestamp of the request in milliseconds, // or the Prometheus v1 API MinTime if no start timestamp was provided on the original request. GetStartOrDefault() int64 // GetEnd returns the start timestamp of the request in milliseconds GetEnd() int64 // GetEndOrDefault returns the end timestamp of the request in milliseconds, // or the Prometheus v1 API MaxTime if no end timestamp was provided on the original request. GetEndOrDefault() int64 // GetLabelMatcherSets returns the label matchers a.k.a series selectors for Prometheus label query requests, // as retained in their original string format. This enables the request to be symmetrically decoded and encoded // to and from the http request format without needing to undo the Prometheus parser converting between formats // like `up{job="prometheus"}` and `{__name__="up, job="prometheus"}`, or other idiosyncrasies. GetLabelMatcherSets() []string // GetLimit returns the limit of the number of items in the response. GetLimit() uint64 // AddSpanTags writes information about this request to an OpenTracing span AddSpanTags(opentracing.Span) }
LabelsQueryRequest represents a label names or values query request that can be process by middlewares.
type Limits ¶
type Limits interface { // MaxQueryLookback returns the max lookback period of queries. MaxQueryLookback(userID string) time.Duration // MaxTotalQueryLength returns the limit of the length (in time) of a query. MaxTotalQueryLength(userID string) time.Duration // MaxQueryParallelism returns the limit to the number of split queries the // frontend will process in parallel. MaxQueryParallelism(userID string) int // MaxQueryExpressionSizeBytes returns the limit of the max number of bytes long a raw // query may be. 0 means "unlimited". MaxQueryExpressionSizeBytes(userID string) int // MaxCacheFreshness returns the period after which results are cacheable, // to prevent caching of very recent results. MaxCacheFreshness(userID string) time.Duration // QueryShardingTotalShards returns the number of shards to use for a given tenant. QueryShardingTotalShards(userID string) int // QueryShardingMaxShardedQueries returns the max number of sharded queries that can // be run for a given received query. 0 to disable limit. QueryShardingMaxShardedQueries(userID string) int // QueryShardingMaxRegexpSizeBytes returns the limit to the max number of bytes allowed // for a regexp matcher in a shardable query. If a query contains a regexp matcher longer // than this limit, the query will not be sharded. 0 to disable limit. QueryShardingMaxRegexpSizeBytes(userID string) int // SplitInstantQueriesByInterval returns the time interval to split instant queries for a given tenant. SplitInstantQueriesByInterval(userID string) time.Duration // CompactorSplitAndMergeShards returns the number of shards to use when splitting blocks // This method is copied from compactor.ConfigProvider. CompactorSplitAndMergeShards(userID string) int // CompactorBlocksRetentionPeriod returns the retention period for a given user. CompactorBlocksRetentionPeriod(userID string) time.Duration // OutOfOrderTimeWindow returns the out-of-order time window for the user. OutOfOrderTimeWindow(userID string) time.Duration // NativeHistogramsIngestionEnabled returns whether to ingest native histograms in the ingester NativeHistogramsIngestionEnabled(userID string) bool // ResultsCacheTTL returns TTL for cached results for query that doesn't fall into out of order window, or // if out of order ingestion is disabled. ResultsCacheTTL(userID string) time.Duration // ResultsCacheTTLForOutOfOrderTimeWindow returns TTL for cached results for query that falls into out-of-order ingestion window. ResultsCacheTTLForOutOfOrderTimeWindow(userID string) time.Duration // ResultsCacheTTLForCardinalityQuery returns TTL for cached results for cardinality queries. ResultsCacheTTLForCardinalityQuery(userID string) time.Duration // ResultsCacheTTLForLabelsQuery returns TTL for cached results for label names and values queries. ResultsCacheTTLForLabelsQuery(userID string) time.Duration // ResultsCacheForUnalignedQueryEnabled returns whether to cache results for queries that are not step-aligned ResultsCacheForUnalignedQueryEnabled(userID string) bool // BlockedQueries returns the blocked queries. BlockedQueries(userID string) []*validation.BlockedQuery // AlignQueriesWithStep returns if queries should be adjusted to be step-aligned AlignQueriesWithStep(userID string) bool // QueryIngestersWithin returns the maximum lookback beyond which queries are not sent to ingester. QueryIngestersWithin(userID string) time.Duration // IngestStorageReadConsistency returns the default read consistency for the tenant. IngestStorageReadConsistency(userID string) string }
Limits allows us to specify per-tenant runtime limits on the behavior of the query handling code.
type Merger ¶
type Merger interface { // MergeResponse merges responses from multiple requests into a single Response MergeResponse(...Response) (Response, error) }
Merger is used by middlewares making multiple requests to merge back all responses into a single one.
type MetricsQueryHandler ¶
type MetricsQueryHandler interface {
Do(context.Context, MetricsQueryRequest) (Response, error)
}
MetricsQueryHandler is like http.Handle, but specifically for Prometheus query and query_range calls.
type MetricsQueryMiddleware ¶
type MetricsQueryMiddleware interface {
Wrap(MetricsQueryHandler) MetricsQueryHandler
}
MetricsQueryMiddleware is a higher order MetricsQueryHandler.
func MergeMetricsQueryMiddlewares ¶
func MergeMetricsQueryMiddlewares(middleware ...MetricsQueryMiddleware) MetricsQueryMiddleware
MergeMetricsQueryMiddlewares produces a middleware that applies multiple middleware in turn; ie Merge(f,g,h).Wrap(handler) == f.Wrap(g.Wrap(h.Wrap(handler)))
type MetricsQueryMiddlewareFunc ¶
type MetricsQueryMiddlewareFunc func(MetricsQueryHandler) MetricsQueryHandler
MetricsQueryMiddlewareFunc is like http.HandlerFunc, but for MetricsQueryMiddleware.
func (MetricsQueryMiddlewareFunc) Wrap ¶
func (q MetricsQueryMiddlewareFunc) Wrap(h MetricsQueryHandler) MetricsQueryHandler
Wrap implements MetricsQueryMiddleware.
type MetricsQueryRequest ¶
type MetricsQueryRequest interface { // GetID returns the ID of the request used to correlate downstream requests and responses. GetID() int64 // GetPath returns the URL Path of the request GetPath() string // GetHeaders returns the HTTP headers in the request. GetHeaders() []*PrometheusHeader // GetStart returns the start timestamp of the query time range in milliseconds. GetStart() int64 // GetEnd returns the end timestamp of the query time range in milliseconds. // The start and end timestamp are set to the same value in case of an instant query. GetEnd() int64 // GetStep returns the step of the request in milliseconds. GetStep() int64 // GetQuery returns the query of the request. GetQuery() string // GetMinT returns the minimum timestamp in milliseconds of data to be queried, // as determined from the start timestamp and any range vector or offset in the query. GetMinT() int64 // GetMaxT returns the maximum timestamp in milliseconds of data to be queried, // as determined from the end timestamp and any offset in the query. GetMaxT() int64 // GetOptions returns the options for the given request. GetOptions() Options // GetHints returns hints that could be optionally attached to the request to pass down the stack. // These hints can be used to optimize the query execution. GetHints() *Hints // WithID clones the current request with the provided ID. WithID(id int64) (MetricsQueryRequest, error) // WithStartEnd clone the current request with different start and end timestamp. // Implementations must ensure minT and maxT are recalculated when the start and end timestamp change. WithStartEnd(startTime int64, endTime int64) (MetricsQueryRequest, error) // WithQuery clones the current request with a different query; returns error if query parse fails. // Implementations must ensure minT and maxT are recalculated when the query changes. WithQuery(string) (MetricsQueryRequest, error) // WithHeaders clones the current request with different headers. WithHeaders([]*PrometheusHeader) (MetricsQueryRequest, error) // WithExpr clones the current `PrometheusRangeQueryRequest` with a new query expression. // Implementations must ensure minT and maxT are recalculated when the query changes. WithExpr(parser.Expr) (MetricsQueryRequest, error) // WithTotalQueriesHint adds the number of total queries to this request's Hints. WithTotalQueriesHint(int32) (MetricsQueryRequest, error) // WithEstimatedSeriesCountHint WithEstimatedCardinalityHint adds a cardinality estimate to this request's Hints. WithEstimatedSeriesCountHint(uint64) (MetricsQueryRequest, error) // AddSpanTags writes information about this request to an OpenTracing span AddSpanTags(opentracing.Span) }
MetricsQueryRequest represents an instant or query range request that can be process by middlewares.
type Options ¶
type Options struct { CacheDisabled bool `protobuf:"varint,1,opt,name=CacheDisabled,proto3" json:"CacheDisabled,omitempty"` ShardingDisabled bool `protobuf:"varint,2,opt,name=ShardingDisabled,proto3" json:"ShardingDisabled,omitempty"` TotalShards int32 `protobuf:"varint,3,opt,name=TotalShards,proto3" json:"TotalShards,omitempty"` InstantSplitDisabled bool `protobuf:"varint,4,opt,name=InstantSplitDisabled,proto3" json:"InstantSplitDisabled,omitempty"` // Instant split by time interval unit stored in nanoseconds (time.Duration unit in int64) InstantSplitInterval int64 `protobuf:"varint,5,opt,name=InstantSplitInterval,proto3" json:"InstantSplitInterval,omitempty"` }
func (*Options) Descriptor ¶
func (*Options) GetCacheDisabled ¶
func (*Options) GetInstantSplitDisabled ¶
func (*Options) GetInstantSplitInterval ¶
func (*Options) GetShardingDisabled ¶
func (*Options) GetTotalShards ¶
func (*Options) MarshalToSizedBuffer ¶
func (*Options) ProtoMessage ¶
func (*Options) ProtoMessage()
func (*Options) XXX_DiscardUnknown ¶
func (m *Options) XXX_DiscardUnknown()
func (*Options) XXX_Marshal ¶
func (*Options) XXX_Unmarshal ¶
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"` }
func (*PrometheusData) Descriptor ¶
func (*PrometheusData) Descriptor() ([]byte, []int)
func (*PrometheusData) Equal ¶
func (this *PrometheusData) Equal(that interface{}) bool
func (*PrometheusData) GetResult ¶
func (m *PrometheusData) GetResult() []SampleStream
func (*PrometheusData) GetResultType ¶
func (m *PrometheusData) GetResultType() string
func (*PrometheusData) GoString ¶
func (this *PrometheusData) GoString() string
func (*PrometheusData) Marshal ¶
func (m *PrometheusData) Marshal() (dAtA []byte, err error)
func (*PrometheusData) MarshalJSON ¶
func (d *PrometheusData) MarshalJSON() ([]byte, 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 (this *PrometheusData) String() string
func (*PrometheusData) Unmarshal ¶
func (m *PrometheusData) Unmarshal(dAtA []byte) error
func (*PrometheusData) UnmarshalJSON ¶
func (d *PrometheusData) UnmarshalJSON(b []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 PrometheusHeader ¶
type PrometheusHeader struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"-"` Values []string `protobuf:"bytes,2,rep,name=Values,proto3" json:"-"` }
func (*PrometheusHeader) Descriptor ¶
func (*PrometheusHeader) Descriptor() ([]byte, []int)
func (*PrometheusHeader) Equal ¶
func (this *PrometheusHeader) Equal(that interface{}) bool
func (*PrometheusHeader) GetName ¶
func (m *PrometheusHeader) GetName() string
func (*PrometheusHeader) GetValues ¶
func (m *PrometheusHeader) GetValues() []string
func (*PrometheusHeader) GoString ¶
func (this *PrometheusHeader) GoString() string
func (*PrometheusHeader) Marshal ¶
func (m *PrometheusHeader) Marshal() (dAtA []byte, err error)
func (*PrometheusHeader) MarshalToSizedBuffer ¶
func (m *PrometheusHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PrometheusHeader) ProtoMessage ¶
func (*PrometheusHeader) ProtoMessage()
func (*PrometheusHeader) Reset ¶
func (m *PrometheusHeader) Reset()
func (*PrometheusHeader) Size ¶
func (m *PrometheusHeader) Size() (n int)
func (*PrometheusHeader) String ¶
func (this *PrometheusHeader) String() string
func (*PrometheusHeader) Unmarshal ¶
func (m *PrometheusHeader) Unmarshal(dAtA []byte) error
func (*PrometheusHeader) XXX_DiscardUnknown ¶
func (m *PrometheusHeader) XXX_DiscardUnknown()
func (*PrometheusHeader) XXX_Marshal ¶
func (m *PrometheusHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PrometheusHeader) XXX_Merge ¶
func (m *PrometheusHeader) XXX_Merge(src proto.Message)
func (*PrometheusHeader) XXX_Size ¶
func (m *PrometheusHeader) XXX_Size() int
func (*PrometheusHeader) XXX_Unmarshal ¶
func (m *PrometheusHeader) XXX_Unmarshal(b []byte) error
type PrometheusInstantQueryRequest ¶
type PrometheusInstantQueryRequest struct {
// contains filtered or unexported fields
}
func NewPrometheusInstantQueryRequest ¶
func NewPrometheusInstantQueryRequest( urlPath string, headers []*PrometheusHeader, time int64, lookbackDelta time.Duration, queryExpr parser.Expr, options Options, hints *Hints, ) *PrometheusInstantQueryRequest
func (*PrometheusInstantQueryRequest) AddSpanTags ¶
func (r *PrometheusInstantQueryRequest) AddSpanTags(sp opentracing.Span)
AddSpanTags writes query information about the current `PrometheusInstantQueryRequest` to a span's tag ("attributes" in OpenTelemetry parlance).
func (*PrometheusInstantQueryRequest) GetEnd ¶
func (r *PrometheusInstantQueryRequest) GetEnd() int64
func (*PrometheusInstantQueryRequest) GetHeaders ¶
func (r *PrometheusInstantQueryRequest) GetHeaders() []*PrometheusHeader
func (*PrometheusInstantQueryRequest) GetHints ¶
func (r *PrometheusInstantQueryRequest) GetHints() *Hints
func (*PrometheusInstantQueryRequest) GetID ¶
func (r *PrometheusInstantQueryRequest) GetID() int64
func (*PrometheusInstantQueryRequest) GetMaxT ¶
func (r *PrometheusInstantQueryRequest) GetMaxT() int64
GetMaxT returns the maximum timestamp in milliseconds of data to be queried, as determined from the end timestamp and any offset in the query.
func (*PrometheusInstantQueryRequest) GetMinT ¶
func (r *PrometheusInstantQueryRequest) GetMinT() int64
GetMinT returns the minimum timestamp in milliseconds of data to be queried, as determined from the start timestamp and any range vector or offset in the query.
func (*PrometheusInstantQueryRequest) GetOptions ¶
func (r *PrometheusInstantQueryRequest) GetOptions() Options
func (*PrometheusInstantQueryRequest) GetPath ¶
func (r *PrometheusInstantQueryRequest) GetPath() string
func (*PrometheusInstantQueryRequest) GetQuery ¶
func (r *PrometheusInstantQueryRequest) GetQuery() string
func (*PrometheusInstantQueryRequest) GetStart ¶
func (r *PrometheusInstantQueryRequest) GetStart() int64
func (*PrometheusInstantQueryRequest) GetStep ¶
func (r *PrometheusInstantQueryRequest) GetStep() int64
func (*PrometheusInstantQueryRequest) GetTime ¶
func (r *PrometheusInstantQueryRequest) GetTime() int64
func (*PrometheusInstantQueryRequest) WithEstimatedSeriesCountHint ¶
func (r *PrometheusInstantQueryRequest) WithEstimatedSeriesCountHint(count uint64) (MetricsQueryRequest, error)
func (*PrometheusInstantQueryRequest) WithExpr ¶
func (r *PrometheusInstantQueryRequest) WithExpr(queryExpr parser.Expr) (MetricsQueryRequest, error)
WithExpr clones the current `PrometheusInstantQueryRequest` with a new query expression.
func (*PrometheusInstantQueryRequest) WithHeaders ¶
func (r *PrometheusInstantQueryRequest) WithHeaders(headers []*PrometheusHeader) (MetricsQueryRequest, error)
WithHeaders clones the current `PrometheusRangeQueryRequest` with new headers.
func (*PrometheusInstantQueryRequest) WithID ¶
func (r *PrometheusInstantQueryRequest) WithID(id int64) (MetricsQueryRequest, error)
func (*PrometheusInstantQueryRequest) WithQuery ¶
func (r *PrometheusInstantQueryRequest) WithQuery(query string) (MetricsQueryRequest, error)
WithQuery clones the current `PrometheusInstantQueryRequest` with a new query; returns error if query parse fails.
func (*PrometheusInstantQueryRequest) WithStartEnd ¶
func (r *PrometheusInstantQueryRequest) WithStartEnd(time int64, _ int64) (MetricsQueryRequest, error)
WithStartEnd clones the current `PrometheusInstantQueryRequest` with a new `time` timestamp.
func (*PrometheusInstantQueryRequest) WithTotalQueriesHint ¶
func (r *PrometheusInstantQueryRequest) WithTotalQueriesHint(totalQueries int32) (MetricsQueryRequest, error)
type PrometheusLabelNamesQueryRequest ¶
type PrometheusLabelNamesQueryRequest struct { Path string Start int64 End int64 // labelMatcherSets is a repeated field here in order to enable the representation // of labels queries which have not yet been split; the prometheus querier code // will eventually split requests like `?match[]=up&match[]=process_start_time_seconds{job="prometheus"}` // into separate queries, one for each matcher set LabelMatcherSets []string // ID of the request used to correlate downstream requests and responses. ID int64 // Limit the number of label names returned. A value of 0 means no limit Limit uint64 }
func (*PrometheusLabelNamesQueryRequest) AddSpanTags ¶
func (r *PrometheusLabelNamesQueryRequest) AddSpanTags(sp opentracing.Span)
AddSpanTags writes query information about the current `PrometheusLabelNamesQueryRequest` to a span's tag ("attributes" in OpenTelemetry parlance).
func (*PrometheusLabelNamesQueryRequest) GetEnd ¶
func (r *PrometheusLabelNamesQueryRequest) GetEnd() int64
func (*PrometheusLabelNamesQueryRequest) GetEndOrDefault ¶
func (r *PrometheusLabelNamesQueryRequest) GetEndOrDefault() int64
func (*PrometheusLabelNamesQueryRequest) GetID ¶
func (r *PrometheusLabelNamesQueryRequest) GetID() int64
func (*PrometheusLabelNamesQueryRequest) GetLabelMatcherSets ¶
func (r *PrometheusLabelNamesQueryRequest) GetLabelMatcherSets() []string
func (*PrometheusLabelNamesQueryRequest) GetLabelName ¶
func (r *PrometheusLabelNamesQueryRequest) GetLabelName() string
func (*PrometheusLabelNamesQueryRequest) GetLimit ¶
func (r *PrometheusLabelNamesQueryRequest) GetLimit() uint64
func (*PrometheusLabelNamesQueryRequest) GetPath ¶
func (r *PrometheusLabelNamesQueryRequest) GetPath() string
func (*PrometheusLabelNamesQueryRequest) GetStart ¶
func (r *PrometheusLabelNamesQueryRequest) GetStart() int64
func (*PrometheusLabelNamesQueryRequest) GetStartOrDefault ¶
func (r *PrometheusLabelNamesQueryRequest) GetStartOrDefault() int64
type PrometheusLabelValuesQueryRequest ¶
type PrometheusLabelValuesQueryRequest struct { Path string LabelName string Start int64 End int64 // labelMatcherSets is a repeated field here in order to enable the representation // of labels queries which have not yet been split; the prometheus querier code // will eventually split requests like `?match[]=up&match[]=process_start_time_seconds{job="prometheus"}` // into separate queries, one for each matcher set LabelMatcherSets []string // ID of the request used to correlate downstream requests and responses. ID int64 // Limit the number of label values returned. A value of 0 means no limit. Limit uint64 }
func (*PrometheusLabelValuesQueryRequest) AddSpanTags ¶
func (r *PrometheusLabelValuesQueryRequest) AddSpanTags(sp opentracing.Span)
AddSpanTags writes query information about the current `PrometheusLabelNamesQueryRequest` to a span's tag ("attributes" in OpenTelemetry parlance).
func (*PrometheusLabelValuesQueryRequest) GetEnd ¶
func (r *PrometheusLabelValuesQueryRequest) GetEnd() int64
func (*PrometheusLabelValuesQueryRequest) GetEndOrDefault ¶
func (r *PrometheusLabelValuesQueryRequest) GetEndOrDefault() int64
func (*PrometheusLabelValuesQueryRequest) GetID ¶
func (r *PrometheusLabelValuesQueryRequest) GetID() int64
func (*PrometheusLabelValuesQueryRequest) GetLabelMatcherSets ¶
func (r *PrometheusLabelValuesQueryRequest) GetLabelMatcherSets() []string
func (*PrometheusLabelValuesQueryRequest) GetLabelName ¶
func (r *PrometheusLabelValuesQueryRequest) GetLabelName() string
func (*PrometheusLabelValuesQueryRequest) GetLimit ¶
func (r *PrometheusLabelValuesQueryRequest) GetLimit() uint64
func (*PrometheusLabelValuesQueryRequest) GetStart ¶
func (r *PrometheusLabelValuesQueryRequest) GetStart() int64
func (*PrometheusLabelValuesQueryRequest) GetStartOrDefault ¶
func (r *PrometheusLabelValuesQueryRequest) GetStartOrDefault() int64
type PrometheusRangeQueryRequest ¶
type PrometheusRangeQueryRequest struct {
// contains filtered or unexported fields
}
func NewPrometheusRangeQueryRequest ¶
func NewPrometheusRangeQueryRequest( urlPath string, headers []*PrometheusHeader, start, end, step int64, lookbackDelta time.Duration, queryExpr parser.Expr, options Options, hints *Hints, ) *PrometheusRangeQueryRequest
func (*PrometheusRangeQueryRequest) AddSpanTags ¶
func (r *PrometheusRangeQueryRequest) AddSpanTags(sp opentracing.Span)
AddSpanTags writes the current `PrometheusRangeQueryRequest` parameters to the specified span tags ("attributes" in OpenTelemetry parlance).
func (*PrometheusRangeQueryRequest) GetEnd ¶
func (r *PrometheusRangeQueryRequest) GetEnd() int64
func (*PrometheusRangeQueryRequest) GetHeaders ¶
func (r *PrometheusRangeQueryRequest) GetHeaders() []*PrometheusHeader
func (*PrometheusRangeQueryRequest) GetHints ¶
func (r *PrometheusRangeQueryRequest) GetHints() *Hints
func (*PrometheusRangeQueryRequest) GetID ¶
func (r *PrometheusRangeQueryRequest) GetID() int64
func (*PrometheusRangeQueryRequest) GetMaxT ¶
func (r *PrometheusRangeQueryRequest) GetMaxT() int64
GetMaxT returns the maximum timestamp in milliseconds of data to be queried, as determined from the end timestamp and any offset in the query.
func (*PrometheusRangeQueryRequest) GetMinT ¶
func (r *PrometheusRangeQueryRequest) GetMinT() int64
GetMinT returns the minimum timestamp in milliseconds of data to be queried, as determined from the start timestamp and any range vector or offset in the query.
func (*PrometheusRangeQueryRequest) GetOptions ¶
func (r *PrometheusRangeQueryRequest) GetOptions() Options
func (*PrometheusRangeQueryRequest) GetPath ¶
func (r *PrometheusRangeQueryRequest) GetPath() string
func (*PrometheusRangeQueryRequest) GetQuery ¶
func (r *PrometheusRangeQueryRequest) GetQuery() string
func (*PrometheusRangeQueryRequest) GetStart ¶
func (r *PrometheusRangeQueryRequest) GetStart() int64
func (*PrometheusRangeQueryRequest) GetStep ¶
func (r *PrometheusRangeQueryRequest) GetStep() int64
func (*PrometheusRangeQueryRequest) WithEstimatedSeriesCountHint ¶
func (r *PrometheusRangeQueryRequest) WithEstimatedSeriesCountHint(count uint64) (MetricsQueryRequest, error)
WithEstimatedSeriesCountHint clones the current `PrometheusRangeQueryRequest` with an added Hint value for EstimatedCardinality.
func (*PrometheusRangeQueryRequest) WithExpr ¶
func (r *PrometheusRangeQueryRequest) WithExpr(queryExpr parser.Expr) (MetricsQueryRequest, error)
WithExpr clones the current `PrometheusRangeQueryRequest` with a new query expression.
func (*PrometheusRangeQueryRequest) WithHeaders ¶
func (r *PrometheusRangeQueryRequest) WithHeaders(headers []*PrometheusHeader) (MetricsQueryRequest, error)
WithHeaders clones the current `PrometheusRangeQueryRequest` with new headers.
func (*PrometheusRangeQueryRequest) WithID ¶
func (r *PrometheusRangeQueryRequest) WithID(id int64) (MetricsQueryRequest, error)
WithID clones the current `PrometheusRangeQueryRequest` with the provided ID.
func (*PrometheusRangeQueryRequest) WithQuery ¶
func (r *PrometheusRangeQueryRequest) WithQuery(query string) (MetricsQueryRequest, error)
WithQuery clones the current `PrometheusRangeQueryRequest` with a new query; returns error if query parse fails.
func (*PrometheusRangeQueryRequest) WithStartEnd ¶
func (r *PrometheusRangeQueryRequest) WithStartEnd(start int64, end int64) (MetricsQueryRequest, error)
WithStartEnd clones the current `PrometheusRangeQueryRequest` with a new `start` and `end` timestamp.
func (*PrometheusRangeQueryRequest) WithTotalQueriesHint ¶
func (r *PrometheusRangeQueryRequest) WithTotalQueriesHint(totalQueries int32) (MetricsQueryRequest, error)
WithTotalQueriesHint clones the current `PrometheusRangeQueryRequest` with an added Hint value for TotalQueries.
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 []*PrometheusHeader `protobuf:"bytes,5,rep,name=Headers,proto3" json:"-"` Warnings []string `protobuf:"bytes,6,rep,name=Warnings,proto3" json:"warnings,omitempty"` Infos []string `protobuf:"bytes,7,rep,name=Infos,proto3" json:"infos,omitempty"` }
func (*PrometheusResponse) Descriptor ¶
func (*PrometheusResponse) Descriptor() ([]byte, []int)
func (*PrometheusResponse) Equal ¶
func (this *PrometheusResponse) Equal(that interface{}) bool
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() []*PrometheusHeader
func (*PrometheusResponse) GetInfos ¶
func (m *PrometheusResponse) GetInfos() []string
func (*PrometheusResponse) GetStatus ¶
func (m *PrometheusResponse) GetStatus() string
func (*PrometheusResponse) GetWarnings ¶
func (m *PrometheusResponse) GetWarnings() []string
func (*PrometheusResponse) GoString ¶
func (this *PrometheusResponse) GoString() 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 (this *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.
type QueryDetails ¶
type QueryDetails struct { QuerierStats *stats.Stats // Start and End are the parsed start and end times of the unmodified user request. Start, End time.Time // MinT and MaxT are the earliest and latest points in time which the query might try to use. // For example, they account for range selectors and @ modifiers. // MinT and MaxT may be zero-valued if the query doesn't process samples. MinT, MaxT time.Time Step time.Duration ResultsCacheMissBytes int ResultsCacheHitBytes int }
func ContextWithEmptyDetails ¶
func ContextWithEmptyDetails(ctx context.Context) (*QueryDetails, context.Context)
ContextWithEmptyDetails returns a context with empty QueryDetails. The returned context also has querier stats.Stats injected. The stats pointer in the context and the stats pointer in the QueryDetails are the same.
func QueryDetailsFromContext ¶
func QueryDetailsFromContext(ctx context.Context) *QueryDetails
QueryDetailsFromContext gets the QueryDetails out of the Context. Returns nil if stats have not been initialised in the context.
type QueryStatistics ¶
type QueryStatistics struct {
EstimatedSeriesCount uint64 `protobuf:"varint,1,opt,name=EstimatedSeriesCount,proto3" json:"EstimatedSeriesCount,omitempty"`
}
func (*QueryStatistics) Descriptor ¶
func (*QueryStatistics) Descriptor() ([]byte, []int)
func (*QueryStatistics) Equal ¶
func (this *QueryStatistics) Equal(that interface{}) bool
func (*QueryStatistics) GetEstimatedSeriesCount ¶
func (m *QueryStatistics) GetEstimatedSeriesCount() uint64
func (*QueryStatistics) GoString ¶
func (this *QueryStatistics) GoString() string
func (*QueryStatistics) Marshal ¶
func (m *QueryStatistics) Marshal() (dAtA []byte, err error)
func (*QueryStatistics) MarshalToSizedBuffer ¶
func (m *QueryStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryStatistics) ProtoMessage ¶
func (*QueryStatistics) ProtoMessage()
func (*QueryStatistics) Reset ¶
func (m *QueryStatistics) Reset()
func (*QueryStatistics) Size ¶
func (m *QueryStatistics) Size() (n int)
func (*QueryStatistics) String ¶
func (this *QueryStatistics) String() string
func (*QueryStatistics) Unmarshal ¶
func (m *QueryStatistics) Unmarshal(dAtA []byte) error
func (*QueryStatistics) XXX_DiscardUnknown ¶
func (m *QueryStatistics) XXX_DiscardUnknown()
func (*QueryStatistics) XXX_Marshal ¶
func (m *QueryStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryStatistics) XXX_Merge ¶
func (m *QueryStatistics) XXX_Merge(src proto.Message)
func (*QueryStatistics) XXX_Size ¶
func (m *QueryStatistics) XXX_Size() int
func (*QueryStatistics) XXX_Unmarshal ¶
func (m *QueryStatistics) XXX_Unmarshal(b []byte) error
type Response ¶
type Response interface { proto.Message // GetHeaders returns the HTTP headers in the response. GetHeaders() []*PrometheusHeader }
Response represents a query range response.
type ResultsCacheConfig ¶
type ResultsCacheConfig struct { cache.BackendConfig `yaml:",inline"` Compression cache.CompressionConfig `yaml:",inline"` }
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() error
type RoundTripFunc ¶
RoundTripFunc is to http.RoundTripper what http.HandlerFunc is to http.Handler.
type SampleStream ¶
type SampleStream struct { Labels []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" json:"metric"` Samples []mimirpb.Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"values"` Histograms []mimirpb.FloatHistogramPair `protobuf:"bytes,3,rep,name=histograms,proto3" json:"histograms"` }
func (*SampleStream) Descriptor ¶
func (*SampleStream) Descriptor() ([]byte, []int)
func (*SampleStream) Equal ¶
func (this *SampleStream) Equal(that interface{}) bool
func (*SampleStream) GetHistograms ¶
func (m *SampleStream) GetHistograms() []mimirpb.FloatHistogramPair
func (*SampleStream) GetSamples ¶
func (m *SampleStream) GetSamples() []mimirpb.Sample
func (*SampleStream) GoString ¶
func (this *SampleStream) GoString() string
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 (this *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.
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 Tripperware ¶
type Tripperware func(http.RoundTripper) http.RoundTripper
Tripperware is a signature for all http client-side middleware.
func MergeTripperwares ¶
func MergeTripperwares(tripperware ...Tripperware) Tripperware
MergeTripperwares produces a tripperware that applies multiple tripperware in turn; ie Merge(f,g,h).Wrap(tripper) == f(g(h(tripper)))
func NewTripperware ¶
func NewTripperware( cfg Config, log log.Logger, limits Limits, codec Codec, cacheExtractor Extractor, engineOpts promql.EngineOpts, engineExperimentalFunctionsEnabled bool, ingestStorageTopicOffsetsReader *ingest.TopicOffsetsReader, registerer prometheus.Registerer, ) (Tripperware, error)
NewTripperware returns a Tripperware configured with middlewares to limit, align, split, retry and cache requests.
Source Files ¶
- blocker.go
- cardinality.go
- cardinality_query_cache.go
- codec.go
- codec_json.go
- codec_protobuf.go
- errors.go
- generic_query_cache.go
- instrumentation.go
- labels_query_cache.go
- limits.go
- model.pb.go
- model_extra.go
- prune.go
- querysharding.go
- read_consistency.go
- remote_read.go
- results_cache.go
- retry.go
- roundtrip.go
- running.go
- shard_active_native_histogram_metrics.go
- shard_active_series.go
- shard_active_series_response_decoder.go
- shard_by_series_base.go
- sharded_queryable.go
- split_and_cache.go
- split_by_instant_interval.go
- stats.go
- step_align.go