querier

package
v1.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 48 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChunksHandler

func ChunksHandler(queryable storage.Queryable) http.Handler

ChunksHandler allows you to fetch a compressed tar of all the chunks for a given time range and set of matchers. Only works with the new unified chunk querier, which is enabled when you turn on ingester chunk query streaming.

func New

func New(cfg Config, distributor Distributor, storeQueryable storage.Queryable, tombstonesLoader *purger.TombstonesLoader, reg prometheus.Registerer) (storage.Queryable, *promql.Engine)

New builds a queryable and promql engine.

func NewChunkStoreQueryable added in v0.7.0

func NewChunkStoreQueryable(cfg Config, chunkStore chunkstore.ChunkStore) storage.Queryable

func NewQueryable

func NewQueryable(distributor, store storage.Queryable, chunkIterFn chunkIteratorFunc, cfg Config, tombstonesLoader *purger.TombstonesLoader) storage.Queryable

NewQueryable creates a new Queryable for cortex.

func RemoteReadHandler

func RemoteReadHandler(q storage.Queryable) http.Handler

RemoteReadHandler handles Prometheus remote read requests.

Types

type BlockQueryable added in v0.7.0

type BlockQueryable struct {
	services.Service
	// contains filtered or unexported fields
}

BlockQueryable is a storage.Queryable implementation for blocks storage

func NewBlockQueryable added in v0.7.0

func NewBlockQueryable(cfg tsdb.Config, logLevel logging.Level, registerer prometheus.Registerer) (*BlockQueryable, error)

NewBlockQueryable returns a client to query a block store

func (*BlockQueryable) Querier added in v0.7.0

func (b *BlockQueryable) Querier(ctx context.Context, mint, maxt int64) (storage.Querier, error)

Querier returns a new Querier on the storage.

type Config

type Config struct {
	MaxConcurrent        int           `yaml:"max_concurrent"`
	Timeout              time.Duration `yaml:"timeout"`
	Iterators            bool          `yaml:"iterators"`
	BatchIterators       bool          `yaml:"batch_iterators"`
	IngesterStreaming    bool          `yaml:"ingester_streaming"`
	MaxSamples           int           `yaml:"max_samples"`
	QueryIngestersWithin time.Duration `yaml:"query_ingesters_within"`

	// QueryStoreAfter the time after which queries should also be sent to the store and not just ingesters.
	QueryStoreAfter    time.Duration `yaml:"query_store_after"`
	MaxQueryIntoFuture time.Duration `yaml:"max_query_into_future"`

	// The default evaluation interval for the promql engine.
	// Needs to be configured for subqueries to work as it is the default
	// step if not specified.
	DefaultEvaluationInterval time.Duration `yaml:"default_evaluation_interval"`

	// Directory for ActiveQueryTracker. If empty, ActiveQueryTracker will be disabled and MaxConcurrent will not be applied (!).
	// ActiveQueryTracker logs queries that were active during the last crash, but logs them on the next startup.
	// However, we need to use active query tracker, otherwise we cannot limit Max Concurrent queries in the PromQL
	// engine.
	ActiveQueryTrackerDir string `yaml:"active_query_tracker_dir"`
}

Config contains the configuration require to create a querier

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 added in v0.7.0

func (cfg *Config) Validate() error

Validate the config

type Distributor

type Distributor interface {
	Query(ctx context.Context, from, to model.Time, matchers ...*labels.Matcher) (model.Matrix, error)
	QueryStream(ctx context.Context, from, to model.Time, matchers ...*labels.Matcher) (*client.QueryStreamResponse, error)
	LabelValuesForLabelName(context.Context, model.LabelName) ([]string, error)
	LabelNames(context.Context) ([]string, error)
	MetricsForLabelMatchers(ctx context.Context, from, through model.Time, matchers ...*labels.Matcher) ([]metric.Metric, error)
}

Distributor is the read interface to the distributor, made an interface here to reduce package coupling.

type DummyAlertmanagerRetriever

type DummyAlertmanagerRetriever struct{}

DummyAlertmanagerRetriever implements AlertmanagerRetriever.

func (DummyAlertmanagerRetriever) Alertmanagers

func (DummyAlertmanagerRetriever) Alertmanagers() []*url.URL

Alertmanagers implements AlertmanagerRetriever.

func (DummyAlertmanagerRetriever) DroppedAlertmanagers

func (DummyAlertmanagerRetriever) DroppedAlertmanagers() []*url.URL

DroppedAlertmanagers implements AlertmanagerRetriever.

type DummyRulesRetriever

type DummyRulesRetriever struct{}

DummyRulesRetriever implements RulesRetriever.

func (DummyRulesRetriever) AlertingRules

func (DummyRulesRetriever) AlertingRules() []*rules.AlertingRule

AlertingRules implements RulesRetriever.

func (DummyRulesRetriever) RuleGroups

func (DummyRulesRetriever) RuleGroups() []*rules.Group

RuleGroups implements RulesRetriever.

type DummyTargetRetriever

type DummyTargetRetriever struct{}

DummyTargetRetriever implements github.com/prometheus/prometheus/web/api/v1.targetRetriever.

func (DummyTargetRetriever) TargetsActive

func (DummyTargetRetriever) TargetsActive() map[string][]*scrape.Target

TargetsActive implements targetRetriever.

func (DummyTargetRetriever) TargetsDropped

func (DummyTargetRetriever) TargetsDropped() map[string][]*scrape.Target

TargetsDropped implements targetRetriever.

type SeriesWithChunks added in v0.7.0

type SeriesWithChunks interface {
	storage.Series

	// Returns all chunks with series data.
	Chunks() []chunk.Chunk
}

SeriesWithChunks extends storage.Series interface with direct access to Cortex chunks.

type UserStore added in v0.4.0

type UserStore struct {
	services.Service
	// contains filtered or unexported fields
}

UserStore is a multi-tenant version of Thanos BucketStore

func NewUserStore added in v0.4.0

func NewUserStore(cfg tsdb.Config, bucketClient objstore.Bucket, logLevel logging.Level, logger log.Logger, registerer prometheus.Registerer) (*UserStore, error)

NewUserStore returns a new UserStore

func (*UserStore) Series added in v0.4.0

func (u *UserStore) Series(ctx context.Context, userID string, req *storepb.SeriesRequest) ([]*storepb.Series, storage.Warnings, error)

Series makes a series request to the underlying user store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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