# 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.
NewMockShardedQueryable creates a shard-aware in memory queryable.
NewResultsCacheMiddleware creates results cache middleware from config.
NewRetryMiddleware returns a middleware that retries requests if they fail with 500 or a non-HTTP error.
NewSeriesSet returns an in memory storage.SeriesSet from a []SampleStream As NewSeriesSet uses NewConcreteSeriesSet to implement SeriesSet, result will be sorted by label names.
ResponseToSamples is needed to map back from api response to the underlying series data.
# Constants
ResultsCacheGenNumberHeaderName holds name of the header we want to set in http response.
StatusSuccess Prometheus success result.
# Variables
PassthroughMiddleware is a noop middleware.
PrometheusCodecForInstantQueries is a codec to encode and decode Loki range metric query requests and responses.
PrometheusCodecForRangeQueries is a codec to encode and decode Loki range metric query requests and responses.
StepAlignMiddleware aligns the start and end of request to the step to improved the cacheability of the query results.
# Structs
Config for query_range middleware chain.
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.
PrometheusResponseExtractor helps extracting specific info from Query Response.
RequestResponse contains a request response and the respective request that was used.
ResultsCacheConfig is the config for the results cache.
ShardLabelSeries allows extending a Series with new labels.
# Interfaces
Buffer can be used to read a response body.
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.
Middleware is a higher order Handler.
# Type aliases
HandlerFunc is like http.HandlerFunc, but for Handler.
MiddlewareFunc is like http.HandlerFunc, but for Middleware.
ParallelismForReqFn returns the parallelism for a given request.
RoundTripFunc is to http.RoundTripper what http.HandlerFunc is to http.Handler.
ShouldCacheFn checks whether the current request should go to cache or not.
Tripperware is a signature for all http client-side middleware.