Documentation ¶
Index ¶
- func NewEngine(distributor Querier, chunkStore ChunkStore) *promql.Engine
- type ChunkQuerier
- func (q *ChunkQuerier) LabelValuesForLabelName(ctx context.Context, ln model.LabelName) (model.LabelValues, error)
- func (q *ChunkQuerier) MetricsForLabelMatchers(ctx context.Context, from, through model.Time, ...) ([]metric.Metric, error)
- func (q *ChunkQuerier) Query(ctx context.Context, from, to model.Time, matchers ...*metric.LabelMatcher) (model.Matrix, error)
- type ChunkStore
- type DummyStorage
- type MergeQuerier
- func (qm MergeQuerier) Close() error
- func (qm MergeQuerier) LabelValuesForLabelName(ctx context.Context, name model.LabelName) (model.LabelValues, error)
- func (qm MergeQuerier) LastSampleForLabelMatchers(ctx context.Context, cutoff model.Time, matcherSets ...metric.LabelMatchers) (model.Vector, error)
- func (qm MergeQuerier) MetricsForLabelMatchers(ctx context.Context, from, through model.Time, ...) ([]metric.Metric, error)
- func (qm MergeQuerier) Query(ctx context.Context, from, to model.Time, matchers ...*metric.LabelMatcher) (model.Matrix, error)
- func (qm MergeQuerier) QueryInstant(ctx context.Context, ts model.Time, stalenessDelta time.Duration, ...) ([]local.SeriesIterator, error)
- func (qm MergeQuerier) QueryRange(ctx context.Context, from, to model.Time, matchers ...*metric.LabelMatcher) ([]local.SeriesIterator, error)
- func (qm MergeQuerier) RemoteReadHandler(w http.ResponseWriter, r *http.Request)
- type Querier
- type Queryable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChunkQuerier ¶
type ChunkQuerier struct {
Store ChunkStore
}
A ChunkQuerier is a Querier that fetches samples from a ChunkStore.
func (*ChunkQuerier) LabelValuesForLabelName ¶
func (q *ChunkQuerier) LabelValuesForLabelName(ctx context.Context, ln model.LabelName) (model.LabelValues, error)
LabelValuesForLabelName returns all of the label values that are associated with a given label name.
func (*ChunkQuerier) MetricsForLabelMatchers ¶
func (q *ChunkQuerier) MetricsForLabelMatchers(ctx context.Context, from, through model.Time, matcherSets ...metric.LabelMatchers) ([]metric.Metric, error)
MetricsForLabelMatchers is a noop for chunk querier.
type ChunkStore ¶
type ChunkStore interface {
Get(ctx context.Context, from, through model.Time, matchers ...*metric.LabelMatcher) ([]chunk.Chunk, error)
}
ChunkStore is the interface we need to get chunks
type DummyStorage ¶
type DummyStorage struct {
Queryable
}
DummyStorage creates a local.Storage compatible struct from a Queryable, such that it can be used with web.NewAPI. TODO(juliusv): Remove all the dummy local.Storage methods below once the upstream web API expects a leaner interface.
func (DummyStorage) Append ¶
func (DummyStorage) Append(*model.Sample) error
Append implements local.Storage. Needed to satisfy interface requirements for usage with the Prometheus web API.
func (DummyStorage) DropMetricsForLabelMatchers ¶
func (DummyStorage) DropMetricsForLabelMatchers(context.Context, ...*metric.LabelMatcher) (int, error)
DropMetricsForLabelMatchers implements local.Storage. Needed to satisfy interface requirements for usage with the Prometheus web API.
func (DummyStorage) NeedsThrottling ¶
func (DummyStorage) NeedsThrottling() bool
NeedsThrottling implements local.Storage. Needed to satisfy interface requirements for usage with the Prometheus web API.
func (DummyStorage) Start ¶
func (DummyStorage) Start() error
Start implements local.Storage. Needed to satisfy interface requirements for usage with the Prometheus web API.
func (DummyStorage) Stop ¶
func (DummyStorage) Stop() error
Stop implements local.Storage. Needed to satisfy interface requirements for usage with the Prometheus web API.
func (DummyStorage) WaitForIndexing ¶
func (DummyStorage) WaitForIndexing()
WaitForIndexing implements local.Storage. Needed to satisfy interface requirements for usage with the Prometheus web API.
type MergeQuerier ¶
type MergeQuerier struct {
Queriers []Querier
}
A MergeQuerier is a promql.Querier that merges the results of multiple cortex.Queriers for the same query.
func (MergeQuerier) LabelValuesForLabelName ¶
func (qm MergeQuerier) LabelValuesForLabelName(ctx context.Context, name model.LabelName) (model.LabelValues, error)
LabelValuesForLabelName implements local.Querier.
func (MergeQuerier) LastSampleForLabelMatchers ¶
func (qm MergeQuerier) LastSampleForLabelMatchers(ctx context.Context, cutoff model.Time, matcherSets ...metric.LabelMatchers) (model.Vector, error)
LastSampleForLabelMatchers implements local.Querier.
func (MergeQuerier) MetricsForLabelMatchers ¶
func (qm MergeQuerier) MetricsForLabelMatchers(ctx context.Context, from, through model.Time, matcherSets ...metric.LabelMatchers) ([]metric.Metric, error)
MetricsForLabelMatchers Implements local.Querier.
func (MergeQuerier) Query ¶
func (qm MergeQuerier) Query(ctx context.Context, from, to model.Time, matchers ...*metric.LabelMatcher) (model.Matrix, error)
Query fetches series for a given time range and label matchers from multiple promql.Queriers and returns the merged results as a model.Matrix.
func (MergeQuerier) QueryInstant ¶
func (qm MergeQuerier) QueryInstant(ctx context.Context, ts model.Time, stalenessDelta time.Duration, matchers ...*metric.LabelMatcher) ([]local.SeriesIterator, error)
QueryInstant fetches series for a given instant and label matchers from multiple promql.Queriers and returns the merged results as a map of series iterators.
func (MergeQuerier) QueryRange ¶
func (qm MergeQuerier) QueryRange(ctx context.Context, from, to model.Time, matchers ...*metric.LabelMatcher) ([]local.SeriesIterator, error)
QueryRange fetches series for a given time range and label matchers from multiple promql.Queriers and returns the merged results as a map of series iterators.
func (MergeQuerier) RemoteReadHandler ¶
func (qm MergeQuerier) RemoteReadHandler(w http.ResponseWriter, r *http.Request)
RemoteReadHandler handles Prometheus remote read requests.
type Querier ¶
type Querier interface { Query(ctx context.Context, from, to model.Time, matchers ...*metric.LabelMatcher) (model.Matrix, error) LabelValuesForLabelName(context.Context, model.LabelName) (model.LabelValues, error) MetricsForLabelMatchers(ctx context.Context, from, through model.Time, matcherSets ...metric.LabelMatchers) ([]metric.Metric, error) }
A Querier allows querying all samples in a given time range that match a set of label matchers.
type Queryable ¶
type Queryable struct {
Q MergeQuerier
}
Queryable is an adapter between Prometheus' Queryable and Querier.
func NewQueryable ¶
func NewQueryable(distributor Querier, chunkStore ChunkStore) Queryable
NewQueryable creates a new Queryable for cortex.