package
0.7.0
Repository: https://github.com/cortexproject/cortex.git
Documentation: pkg.go.dev

# 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.
LimitsMiddleware creates a new Middleware that invalidates large queries based on Limits interface.
LogToSpan writes information about this request to the OpenTracing span in the context, if there is one.
MergeMiddlewares produces a middleware that applies multiple middleware in turn; ie Merge(f,g,h).Wrap(handler) == f.Wrap(g.Wrap(h.Wrap(handler))).
NewInstrumentMiddlewareMetrics makes a new InstrumentMiddlewareMetrics.
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.
ParseTime parses the string into an int64, milliseconds since epoch.
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.
TimeFromMillis is a helper to turn milliseconds -> time.Time.
No description provided by the author

# 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.
PrometheusResponseExtractor is an `Extractor` for a Prometheus query range 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
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
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

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

ExtractorFunc is a sugar syntax for declaring an Extractor from a function.
HandlerFunc is like http.HandlerFunc, but for Handler.
MiddlewareFunc is like http.HandlerFunc, but for Middleware.
ShardingConfigs is a slice of chunk shard configs.