# Functions
DoRequests executes a list of requests in parallel.
FromResult transforms a promql query result into a samplestream.
InstrumentMiddleware can be inserted into the middleware chain to expose timing information.
MergeMiddlewares produces a middleware that applies multiple middleware in turn; ie Merge(f,g,h).Wrap(handler) == f.Wrap(g.Wrap(h.Wrap(handler))).
NewEmptyPrometheusResponse returns an empty successful Prometheus query range response.
NewInstrumentMiddlewareMetrics makes a new InstrumentMiddlewareMetrics.
NewLimitsMiddleware creates a new Middleware that enforces query limits.
NewMockShardedQueryable creates a shard-aware in memory queryable.
NewQueryShardMiddleware creates a middleware which downstreams queries after AST mapping and query encoding.
NewResultsCacheMiddleware creates results cache middleware from config.
NewRetryMiddleware returns a middleware that retries requests if they fail with 500 or a non-HTTP error.
No description provided by the author
NewRoundTripper merges a set of middlewares into an handler, then inject it into the `next` roundtripper using the codec to translate requests and responses.
NewSeriesSet returns an in memory storage.SeriesSet from a []SampleStream As NewSeriesSet uses NewConcreteSeriesSet to implement SeriesSet, result will be sorted by label names.
NewTripperware returns a Tripperware configured with middlewares to limit, align, split, retry and cache requests.
ResponseToSamples is needed to map back from api response to the underlying series data.
SplitByIntervalMiddleware creates a new Middleware that splits requests by a given interval.
# Constants
StatusSuccess Prometheus success result.
# Variables
No description provided by the author
No description provided by the author
PassthroughMiddleware is a noop middleware.
PrometheusCodec is a codec to encode and decode Prometheus query range requests and responses.
ResultsCacheGenNumberHeaderName holds name of the header we want to set in http response.
StepAlignMiddleware aligns the start and end of request to the step to improved the cacheability of the query results.
# Structs
No description provided by the author
No description provided by the author
Config for query_range middleware chain.
No description provided by the author
InstrumentMiddlewareMetrics holds the metrics tracked by InstrumentMiddleware.
MockShardedQueryable is exported to be reused in the querysharding benchmarking.
NoopCollector is a noop collector that can be used as placeholder when no metric should tracked by the instrumentation.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PrometheusResponseExtractor helps extracting specific info from Query Response.
No description provided by the author
RequestResponse contains a request response and the respective request that was used.
ResultsCacheConfig is the config for the results cache.
No description provided by the author
No description provided by the author
ShardedQuerier is a an implementor of the Querier interface.
ShardedQueryable is an implementor of the Queryable interface.
ShardLabelSeries allows extending a Series with new labels.
# Interfaces
Buffer can be used to read a response body.
No description provided by the author
CacheSplitter generates cache keys.
Codec is used to encode/decode query range requests and responses so they can be passed down to middlewares.
Extractor is used by the cache to extract a subset of a response from a cache entry.
Handler is like http.Handle, but specifically for Prometheus query_range calls.
Limits allows us to specify per-tenant runtime limits on the behavior of the query handling code.
Merger is used by middlewares making multiple requests to merge back all responses into a single one.
Middleware is a higher order Handler.
Request represents a query range request that can be process by middlewares.
Response represents a query range response.
# Type aliases
HandlerFunc is like http.HandlerFunc, but for Handler.
No description provided by the author
MiddlewareFunc is like http.HandlerFunc, but for Middleware.
RoundTripFunc is to http.RoundTripper what http.HandlerFunc is to http.Handler.
ShardingConfigs is a slice of chunk shard configs.
ShouldCacheFn checks whether the current request should go to cache or not.
Tripperware is a signature for all http client-side middleware.