querymiddleware

package
v0.0.0-...-fbfa8e9 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: AGPL-3.0 Imports: 81 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthModel = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowModel   = fmt.Errorf("proto: integer overflow")
)
View Source
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 DecodeCardinalityQueryParams

func DecodeCardinalityQueryParams(r *http.Request) (any, error)

DecodeCardinalityQueryParams strictly handles validation for cardinality API endpoint parameters. The current decoding of the cardinality requests is handled in the cardinality package which is not yet compatible with the codec's approach of using interfaces and multiple concrete proto implementations to represent different query types.

func DecodeInstantQueryTimeParams

func DecodeInstantQueryTimeParams(reqValues *url.Values) (time int64, err error)

DecodeInstantQueryTimeParams encapsulates Prometheus instant query time param parsing, emulating the logic in prometheus/prometheus/web/api/v1#API.query.

func DecodeLabelsSeriesQueryTimeParams

func DecodeLabelsSeriesQueryTimeParams(reqValues *url.Values) (start, end int64, err error)

DecodeLabelsSeriesQueryTimeParams encapsulates Prometheus query time param parsing for label names, label values, and series endpoints, emulating prometheus/prometheus/web/api/v1. Note: the Prometheus HTTP API spec claims that the series endpoint `start` and `end` parameters are not optional, but the Prometheus implementation allows them to be optional. Until this changes we can reuse the same PromTimeParamDecoder structs as the label names and values endpoints.

func DecodeRangeQueryTimeParams

func DecodeRangeQueryTimeParams(reqValues *url.Values) (start, end, step int64, err error)

DecodeRangeQueryTimeParams encapsulates Prometheus instant query time param parsing, emulating the logic in prometheus/prometheus/web/api/v1#API.query_range.

func DecorateWithParamName

func DecorateWithParamName(err error, field string) error

func IsActiveNativeHistogramMetricsQuery

func IsActiveNativeHistogramMetricsQuery(path string) bool

func IsActiveSeriesQuery

func IsActiveSeriesQuery(path string) bool

func IsCardinalityQuery

func IsCardinalityQuery(path string) bool

func IsInstantQuery

func IsInstantQuery(path string) bool

func IsLabelNamesQuery

func IsLabelNamesQuery(path string) bool

func IsLabelValuesQuery

func IsLabelValuesQuery(path string) bool

func IsLabelsQuery

func IsLabelsQuery(path string) bool

func IsRangeQuery

func IsRangeQuery(path string) bool

func IsRemoteReadQuery

func IsRemoteReadQuery(path string) bool

func IsSeriesQuery

func IsSeriesQuery(path string) bool

func NewCardinalityQueryRequestValidationRoundTripper

func NewCardinalityQueryRequestValidationRoundTripper(next http.RoundTripper) http.RoundTripper

func NewFrontendRunningRoundTripper

func NewFrontendRunningRoundTripper(next http.RoundTripper, service services.Service, timeout time.Duration, log log.Logger) http.RoundTripper

func NewLabelsQueryRequestValidationRoundTripper

func NewLabelsQueryRequestValidationRoundTripper(codec Codec, next http.RoundTripper) http.RoundTripper

func NewLimitedParallelismRoundTripper

func NewLimitedParallelismRoundTripper(next http.RoundTripper, codec Codec, limits Limits, middlewares ...MetricsQueryMiddleware) http.RoundTripper

NewLimitedParallelismRoundTripper creates a new roundtripper that enforces MaxQueryParallelism to the `next` roundtripper across `middlewares`.

func NewMetricsQueryRequestValidationRoundTripper

func NewMetricsQueryRequestValidationRoundTripper(codec Codec, next http.RoundTripper) http.RoundTripper

func NewQueryDetailsStartEndRoundTripper

func NewQueryDetailsStartEndRoundTripper(next http.RoundTripper) http.RoundTripper

NewQueryDetailsStartEndRoundTripper parses "start" and "end" parameters from the query and sets same fields in the QueryDetails in the context.

func NewRemoteReadRoundTripper

func NewRemoteReadRoundTripper(next http.RoundTripper, middlewares ...MetricsQueryMiddleware) http.RoundTripper

func NewShardedQueryable

func NewShardedQueryable(req MetricsQueryRequest, annotationAccumulator *AnnotationAccumulator, next MetricsQueryHandler, handleEmbeddedQuery HandleEmbeddedQueryFunc) *shardedQueryable

NewShardedQueryable makes a new shardedQueryable. We expect a new queryable is created for each query, otherwise the response headers tracker doesn't work as expected, because it merges the headers for all queries run through the queryable and never reset them.

func ParseRemoteReadRequestValuesWithoutConsumingBody

func ParseRemoteReadRequestValuesWithoutConsumingBody(req *http.Request) (url.Values, error)

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 AnnotationAccumulator

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

AnnotationAccumulator collects annotations returned by sharded queries.

func NewAnnotationAccumulator

func NewAnnotationAccumulator() *AnnotationAccumulator

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

	// QueryRequestError should generate a cache key based on errors for the tenant ID and MetricsQueryRequest.
	QueryRequestError(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 CachedError

type CachedError struct {
	Key          string `protobuf:"bytes,1,opt,name=key,proto3" json:"key"`
	ErrorType    string `protobuf:"bytes,2,opt,name=errorType,proto3" json:"errorType"`
	ErrorMessage string `protobuf:"bytes,3,opt,name=errorMessage,proto3" json:"errorMessage"`
}

func (*CachedError) Descriptor

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

func (*CachedError) Equal

func (this *CachedError) Equal(that interface{}) bool

func (*CachedError) GetErrorMessage

func (m *CachedError) GetErrorMessage() string

func (*CachedError) GetErrorType

func (m *CachedError) GetErrorType() string

func (*CachedError) GetKey

func (m *CachedError) GetKey() string

func (*CachedError) GoString

func (this *CachedError) GoString() string

func (*CachedError) Marshal

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

func (*CachedError) MarshalTo

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

func (*CachedError) MarshalToSizedBuffer

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

func (*CachedError) ProtoMessage

func (*CachedError) ProtoMessage()

func (*CachedError) Reset

func (m *CachedError) Reset()

func (*CachedError) Size

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

func (*CachedError) String

func (this *CachedError) String() string

func (*CachedError) Unmarshal

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

func (*CachedError) XXX_DiscardUnknown

func (m *CachedError) XXX_DiscardUnknown()

func (*CachedError) XXX_Marshal

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

func (*CachedError) XXX_Merge

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

func (*CachedError) XXX_Size

func (m *CachedError) XXX_Size() int

func (*CachedError) XXX_Unmarshal

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

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) MarshalTo

func (m *CachedHTTPHeader) MarshalTo(dAtA []byte) (int, 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) MarshalTo

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

func (*CachedResponse) MarshalToSizedBuffer

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

func (*CachedResponse) ProtoMessage

func (*CachedResponse) ProtoMessage()

func (*CachedResponse) Reset

func (m *CachedResponse) Reset()

func (*CachedResponse) Size

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

func (*CachedResponse) String

func (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 CardinalityQueryRequestValidationRoundTripper

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

func (CardinalityQueryRequestValidationRoundTripper) RoundTrip

type Codec

type Codec interface {
	Merger
	// DecodeMetricsQueryRequest decodes a MetricsQueryRequest from an http request.
	DecodeMetricsQueryRequest(context.Context, *http.Request) (MetricsQueryRequest, error)
	// DecodeLabelsSeriesQueryRequest decodes a LabelsSeriesQueryRequest from an http request.
	DecodeLabelsSeriesQueryRequest(context.Context, *http.Request) (LabelsSeriesQueryRequest, error)
	// DecodeMetricsQueryResponse 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.
	DecodeMetricsQueryResponse(context.Context, *http.Response, MetricsQueryRequest, log.Logger) (Response, error)
	// DecodeLabelsSeriesQueryResponse 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.
	DecodeLabelsSeriesQueryResponse(context.Context, *http.Response, LabelsSeriesQueryRequest, log.Logger) (Response, error)
	// EncodeMetricsQueryRequest encodes a MetricsQueryRequest into an http request.
	EncodeMetricsQueryRequest(context.Context, MetricsQueryRequest) (*http.Request, error)
	// EncodeLabelsSeriesQueryRequest encodes a LabelsSeriesQueryRequest into an http request.
	EncodeLabelsSeriesQueryRequest(context.Context, LabelsSeriesQueryRequest) (*http.Request, error)
	// EncodeMetricsQueryResponse encodes a Response from a MetricsQueryRequest into an http response.
	EncodeMetricsQueryResponse(context.Context, *http.Request, Response) (*http.Response, error)
	// EncodeLabelsSeriesQueryResponse encodes a Response from a LabelsSeriesQueryRequest into an http response.
	EncodeLabelsSeriesQueryResponse(context.Context, *http.Request, Response, bool) (*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,
	propagateHeaders []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"`
	CacheErrors                      bool          `yaml:"cache_errors" category:"experimental"`
	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"`
	BlockPromQLExperimentalFunctions bool          `yaml:"block_promql_experimental_functions" 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

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

RegisterFlags adds the flags required to config this to the given FlagSet.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates the config.

type DefaultCacheKeyGenerator

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

func NewDefaultCacheKeyGenerator

func NewDefaultCacheKeyGenerator(codec Codec, interval time.Duration) DefaultCacheKeyGenerator

func (DefaultCacheKeyGenerator) LabelValues

func (DefaultCacheKeyGenerator) LabelValuesCardinality

func (DefaultCacheKeyGenerator) LabelValuesCardinality(r *http.Request) (*GenericQueryCacheKey, error)

func (DefaultCacheKeyGenerator) QueryRequest

QueryRequest generates a cache key based on the userID, MetricsQueryRequest and interval.

func (DefaultCacheKeyGenerator) QueryRequestError

func (g DefaultCacheKeyGenerator) QueryRequestError(_ context.Context, tenantID string, r MetricsQueryRequest) string

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) Descriptor() ([]byte, []int)

func (*Extent) Equal

func (this *Extent) Equal(that interface{}) bool

func (*Extent) GetEnd

func (m *Extent) GetEnd() int64

func (*Extent) GetQueryTimestampMs

func (m *Extent) GetQueryTimestampMs() int64

func (*Extent) GetResponse

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

func (*Extent) GetStart

func (m *Extent) GetStart() int64

func (*Extent) GetTraceId

func (m *Extent) GetTraceId() string

func (*Extent) GoString

func (this *Extent) GoString() string

func (*Extent) Marshal

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

func (*Extent) MarshalTo

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

func (*Extent) MarshalToSizedBuffer

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

func (*Extent) ProtoMessage

func (*Extent) ProtoMessage()

func (*Extent) Reset

func (m *Extent) Reset()

func (*Extent) Size

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

func (*Extent) String

func (this *Extent) String() string

func (*Extent) Unmarshal

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

func (*Extent) XXX_DiscardUnknown

func (m *Extent) XXX_DiscardUnknown()

func (*Extent) XXX_Marshal

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

func (*Extent) XXX_Merge

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

func (*Extent) XXX_Size

func (m *Extent) XXX_Size() int

func (*Extent) XXX_Unmarshal

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

type Extractor

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

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

type GenericQueryCacheKey

type GenericQueryCacheKey struct {
	// CacheKey is a full non-hashed representation of the request, used to uniquely identify
	// a request in the cache.
	CacheKey string

	// CacheKeyPrefix is a cache key prefix to use for this request.
	CacheKeyPrefix string
}

type HandleEmbeddedQueryFunc

type HandleEmbeddedQueryFunc func(ctx context.Context, queryExpr astmapper.EmbeddedQuery, query MetricsQueryRequest, handler MetricsQueryHandler) ([]SampleStream, *PrometheusResponse, error)

type HandlerFunc

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

HandlerFunc is like http.HandlerFunc, but for MetricsQueryHandler.

func (HandlerFunc) Do

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 (h *Hints) GetEstimatedSeriesCount() uint64

func (*Hints) GetTotalQueries

func (h *Hints) GetTotalQueries() int32

type LabelsHandlerFunc

type LabelsHandlerFunc func(context.Context, LabelsSeriesQueryRequest) (Response, error)

LabelsHandlerFunc is like http.HandlerFunc, but for LabelsQueryHandler.

func (LabelsHandlerFunc) Do

Do implements LabelsQueryHandler.

type LabelsQueryHandler

type LabelsQueryHandler interface {
	Do(context.Context, LabelsSeriesQueryRequest) (Response, error)
}

LabelsQueryHandler is like http.Handler, but specifically for Prometheus label names and values calls.

type LabelsQueryRequestValidationRoundTripper

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

func (LabelsQueryRequestValidationRoundTripper) RoundTrip

type LabelsSeriesQueryRequest

type LabelsSeriesQueryRequest 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
	// GetHeaders returns the HTTP headers in the request.
	GetHeaders() []*PrometheusHeader
	// WithLabelName clones the current request with a different label name param.
	WithLabelName(string) (LabelsSeriesQueryRequest, error)
	// WithLabelMatcherSets clones the current request with different label matchers.
	WithLabelMatcherSets([]string) (LabelsSeriesQueryRequest, error)
	// WithHeaders clones the current request with different headers.
	WithHeaders([]*PrometheusHeader) (LabelsSeriesQueryRequest, error)
	// AddSpanTags writes information about this request to an OpenTracing span
	AddSpanTags(opentracing.Span)
}

LabelsSeriesQueryRequest represents a label names, label values, or series 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

	// ResultsCacheTTLForErrors returns TTL for cached non-transient errors.
	ResultsCacheTTLForErrors(userID string) time.Duration

	// ResultsCacheForUnalignedQueryEnabled returns whether to cache results for queries that are not step-aligned
	ResultsCacheForUnalignedQueryEnabled(userID string) bool

	// EnabledPromQLExperimentalFunctions returns the names of PromQL experimental functions allowed for the tenant.
	EnabledPromQLExperimentalFunctions(userID string) []string

	// 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.Handler, 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

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 MetricsQueryRequestValidationRoundTripper

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

func (MetricsQueryRequestValidationRoundTripper) RoundTrip

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) Descriptor() ([]byte, []int)

func (*Options) Equal

func (this *Options) Equal(that interface{}) bool

func (*Options) GetCacheDisabled

func (m *Options) GetCacheDisabled() bool

func (*Options) GetInstantSplitDisabled

func (m *Options) GetInstantSplitDisabled() bool

func (*Options) GetInstantSplitInterval

func (m *Options) GetInstantSplitInterval() int64

func (*Options) GetShardingDisabled

func (m *Options) GetShardingDisabled() bool

func (*Options) GetTotalShards

func (m *Options) GetTotalShards() int32

func (*Options) GoString

func (this *Options) GoString() string

func (*Options) Marshal

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

func (*Options) MarshalTo

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

func (*Options) MarshalToSizedBuffer

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

func (*Options) ProtoMessage

func (*Options) ProtoMessage()

func (*Options) Reset

func (m *Options) Reset()

func (*Options) Size

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

func (*Options) String

func (this *Options) String() string

func (*Options) Unmarshal

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

func (*Options) XXX_DiscardUnknown

func (m *Options) XXX_DiscardUnknown()

func (*Options) XXX_Marshal

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

func (*Options) XXX_Merge

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

func (*Options) XXX_Size

func (m *Options) XXX_Size() int

func (*Options) XXX_Unmarshal

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

type PromTimeParamDecoder

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

PromTimeParamDecoder provides common functionality for decoding Prometheus time parameters.

func (PromTimeParamDecoder) Decode

func (p PromTimeParamDecoder) Decode(reqValues *url.Values) (int64, error)

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) MarshalTo

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

func (*PrometheusData) MarshalToSizedBuffer

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

func (*PrometheusData) ProtoMessage

func (*PrometheusData) ProtoMessage()

func (*PrometheusData) Reset

func (m *PrometheusData) Reset()

func (*PrometheusData) Size

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

func (*PrometheusData) String

func (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) MarshalTo

func (m *PrometheusHeader) MarshalTo(dAtA []byte) (int, 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 (*PrometheusInstantQueryRequest) GetHeaders

func (*PrometheusInstantQueryRequest) GetHints

func (r *PrometheusInstantQueryRequest) GetHints() *Hints

func (*PrometheusInstantQueryRequest) GetID

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 (*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

WithExpr clones the current `PrometheusInstantQueryRequest` with a new query expression.

func (*PrometheusInstantQueryRequest) WithHeaders

WithHeaders clones the current `PrometheusRangeQueryRequest` with new headers.

func (*PrometheusInstantQueryRequest) WithID

func (*PrometheusInstantQueryRequest) WithQuery

WithQuery clones the current `PrometheusInstantQueryRequest` with a new query; returns error if query parse fails.

func (*PrometheusInstantQueryRequest) WithStartEnd

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
	Headers []*PrometheusHeader
}

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 (*PrometheusLabelNamesQueryRequest) GetEndOrDefault

func (r *PrometheusLabelNamesQueryRequest) GetEndOrDefault() int64

func (*PrometheusLabelNamesQueryRequest) GetHeaders

func (*PrometheusLabelNamesQueryRequest) GetID

func (*PrometheusLabelNamesQueryRequest) GetLabelMatcherSets

func (r *PrometheusLabelNamesQueryRequest) GetLabelMatcherSets() []string

func (*PrometheusLabelNamesQueryRequest) GetLabelName

func (r *PrometheusLabelNamesQueryRequest) GetLabelName() string

func (*PrometheusLabelNamesQueryRequest) GetLimit

func (*PrometheusLabelNamesQueryRequest) GetPath

func (*PrometheusLabelNamesQueryRequest) GetStart

func (*PrometheusLabelNamesQueryRequest) GetStartOrDefault

func (r *PrometheusLabelNamesQueryRequest) GetStartOrDefault() int64

func (*PrometheusLabelNamesQueryRequest) WithHeaders

WithHeaders clones the current `PrometheusLabelNamesQueryRequest` with new headers.

func (*PrometheusLabelNamesQueryRequest) WithLabelMatcherSets

func (r *PrometheusLabelNamesQueryRequest) WithLabelMatcherSets(labelMatcherSets []string) (LabelsSeriesQueryRequest, error)

WithLabelMatcherSets clones the current `PrometheusLabelNamesQueryRequest` with new label matcher sets.

func (*PrometheusLabelNamesQueryRequest) WithLabelName

WithLabelName clones the current `PrometheusLabelNamesQueryRequest` with a new label name param.

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
	Headers []*PrometheusHeader
}

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 (*PrometheusLabelValuesQueryRequest) GetEndOrDefault

func (r *PrometheusLabelValuesQueryRequest) GetEndOrDefault() int64

func (*PrometheusLabelValuesQueryRequest) GetHeaders

func (*PrometheusLabelValuesQueryRequest) GetID

func (*PrometheusLabelValuesQueryRequest) GetLabelMatcherSets

func (r *PrometheusLabelValuesQueryRequest) GetLabelMatcherSets() []string

func (*PrometheusLabelValuesQueryRequest) GetLabelName

func (r *PrometheusLabelValuesQueryRequest) GetLabelName() string

func (*PrometheusLabelValuesQueryRequest) GetLimit

func (*PrometheusLabelValuesQueryRequest) GetStart

func (*PrometheusLabelValuesQueryRequest) GetStartOrDefault

func (r *PrometheusLabelValuesQueryRequest) GetStartOrDefault() int64

func (*PrometheusLabelValuesQueryRequest) WithHeaders

WithHeaders clones the current `PrometheusLabelValuesQueryRequest` with new headers.

func (*PrometheusLabelValuesQueryRequest) WithLabelMatcherSets

func (r *PrometheusLabelValuesQueryRequest) WithLabelMatcherSets(labelMatcherSets []string) (LabelsSeriesQueryRequest, error)

WithLabelMatcherSets clones the current `PrometheusLabelValuesQueryRequest` with new label matcher sets.

func (*PrometheusLabelValuesQueryRequest) WithLabelName

WithLabelName clones the current `PrometheusLabelValuesQueryRequest` with a new label name param.

type PrometheusLabelsResponse

type PrometheusLabelsResponse struct {
	Status    string              `json:"status"`
	Data      []string            `json:"data"`
	ErrorType string              `json:"errorType,omitempty"`
	Error     string              `json:"error,omitempty"`
	Headers   []*PrometheusHeader `json:"-"`
}

func (*PrometheusLabelsResponse) GetHeaders

func (m *PrometheusLabelsResponse) GetHeaders() []*PrometheusHeader

func (*PrometheusLabelsResponse) ProtoMessage

func (*PrometheusLabelsResponse) ProtoMessage()

func (*PrometheusLabelsResponse) Reset

func (m *PrometheusLabelsResponse) Reset()

func (*PrometheusLabelsResponse) String

func (m *PrometheusLabelsResponse) String() string

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 (*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

WithExpr clones the current `PrometheusRangeQueryRequest` with a new query expression.

func (*PrometheusRangeQueryRequest) WithHeaders

WithHeaders clones the current `PrometheusRangeQueryRequest` with new headers.

func (*PrometheusRangeQueryRequest) WithID

WithID clones the current `PrometheusRangeQueryRequest` with the provided ID.

func (*PrometheusRangeQueryRequest) WithQuery

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 PrometheusSeriesQueryRequest

type PrometheusSeriesQueryRequest 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
	Headers []*PrometheusHeader
}

func (*PrometheusSeriesQueryRequest) AddSpanTags

func (r *PrometheusSeriesQueryRequest) AddSpanTags(sp opentracing.Span)

AddSpanTags writes query information about the current `PrometheusSeriesQueryRequest` to a span's tag ("attributes" in OpenTelemetry parlance).

func (*PrometheusSeriesQueryRequest) GetEnd

func (r *PrometheusSeriesQueryRequest) GetEnd() int64

func (*PrometheusSeriesQueryRequest) GetEndOrDefault

func (r *PrometheusSeriesQueryRequest) GetEndOrDefault() int64

func (*PrometheusSeriesQueryRequest) GetHeaders

func (*PrometheusSeriesQueryRequest) GetID

func (*PrometheusSeriesQueryRequest) GetLabelMatcherSets

func (r *PrometheusSeriesQueryRequest) GetLabelMatcherSets() []string

func (*PrometheusSeriesQueryRequest) GetLabelName

func (r *PrometheusSeriesQueryRequest) GetLabelName() string

func (*PrometheusSeriesQueryRequest) GetLimit

func (r *PrometheusSeriesQueryRequest) GetLimit() uint64

func (*PrometheusSeriesQueryRequest) GetPath

func (r *PrometheusSeriesQueryRequest) GetPath() string

func (*PrometheusSeriesQueryRequest) GetStart

func (r *PrometheusSeriesQueryRequest) GetStart() int64

func (*PrometheusSeriesQueryRequest) GetStartOrDefault

func (r *PrometheusSeriesQueryRequest) GetStartOrDefault() int64

func (*PrometheusSeriesQueryRequest) WithHeaders

WithHeaders clones the current `PrometheusSeriesQueryRequest` with new headers.

func (*PrometheusSeriesQueryRequest) WithLabelMatcherSets

func (r *PrometheusSeriesQueryRequest) WithLabelMatcherSets(labelMatcherSets []string) (LabelsSeriesQueryRequest, error)

WithLabelMatcherSets clones the current `PrometheusSeriesQueryRequest` with new label matcher sets.

func (*PrometheusSeriesQueryRequest) WithLabelName

WithLabelName clones the current `PrometheusSeriesQueryRequest` with a new label name param.

type PrometheusSeriesResponse

type PrometheusSeriesResponse struct {
	Status    string              `json:"status"`
	Data      []SeriesData        `json:"data"`
	ErrorType string              `json:"errorType,omitempty"`
	Error     string              `json:"error,omitempty"`
	Headers   []*PrometheusHeader `json:"-"`
}

func (*PrometheusSeriesResponse) GetHeaders

func (m *PrometheusSeriesResponse) GetHeaders() []*PrometheusHeader

func (*PrometheusSeriesResponse) ProtoMessage

func (*PrometheusSeriesResponse) ProtoMessage()

func (*PrometheusSeriesResponse) Reset

func (m *PrometheusSeriesResponse) Reset()

func (*PrometheusSeriesResponse) String

func (m *PrometheusSeriesResponse) String() string

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) MarshalTo

func (m *QueryStatistics) MarshalTo(dAtA []byte) (int, 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.

func ExecuteQueryOnQueryable

func ExecuteQueryOnQueryable(ctx context.Context, r MetricsQueryRequest, engine *promql.Engine, queryable storage.Queryable, annotationAccumulator *AnnotationAccumulator) (Response, error)

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

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

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

func (RoundTripFunc) RoundTrip

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

RoundTrip implements http.RoundTripper.

type 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 ResponseToSamples

func ResponseToSamples(resp *PrometheusResponse) ([]SampleStream, error)

ResponseToSamples is needed to map back from api response to the underlying series data

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) MarshalTo

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

func (*SampleStream) MarshalToSizedBuffer

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

func (*SampleStream) ProtoMessage

func (*SampleStream) ProtoMessage()

func (*SampleStream) Reset

func (m *SampleStream) Reset()

func (*SampleStream) Size

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

func (*SampleStream) String

func (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 SeriesData

type SeriesData map[string]string

func (*SeriesData) String

func (d *SeriesData) String() string

type TimeParamType

type TimeParamType int

TimeParamType enumerates the types of time parameters in Prometheus API. https://prometheus.io/docs/prometheus/latest/querying/api/

const (
	// RFC3339OrUnixMS represents the <rfc3339 | unix_timestamp> type in Prometheus Querying API docs
	RFC3339OrUnixMS TimeParamType = iota
	// DurationMS represents the <duration> type in Prometheus Querying API docs
	DurationMS
	// DurationMSOrFloatMS represents the <duration | float> in Prometheus Querying API docs
	DurationMSOrFloatMS
)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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