Documentation ¶
Index ¶
- func ChunksHandler(queryable storage.Queryable) http.Handler
- func MetadataHandler(d Distributor) http.Handler
- func New(cfg Config, distributor Distributor, storeQueryable storage.Queryable, ...) (storage.Queryable, *promql.Engine)
- func NewChunkStoreQueryable(cfg Config, chunkStore chunkstore.ChunkStore) storage.Queryable
- func NewQueryable(distributor, store storage.Queryable, chunkIterFn chunkIteratorFunc, ...) storage.Queryable
- func RemoteReadHandler(q storage.Queryable) http.Handler
- type BlockMeta
- type BlockMetas
- type BlockQueryable
- type BlocksConsistencyChecker
- type BlocksFinder
- type BlocksScanner
- type BlocksScannerConfig
- type BlocksStoreClient
- type BlocksStoreQueryable
- type BlocksStoreSet
- type BucketStoresService
- type Config
- type Distributor
- type DummyAlertmanagerRetriever
- type DummyRulesRetriever
- type DummyTargetRetriever
- type SeriesWithChunks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChunksHandler ¶
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 MetadataHandler ¶ added in v1.1.0
func MetadataHandler(d Distributor) http.Handler
MetadataHandler returns metric metadata held by Cortex for a given tenant. It is kept and returned as a set.
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
NewChunkStoreQueryable returns the storage.Queryable implementation against the chunks store.
func NewQueryable ¶
func NewQueryable(distributor, store storage.Queryable, chunkIterFn chunkIteratorFunc, cfg Config, tombstonesLoader *purger.TombstonesLoader) storage.Queryable
NewQueryable creates a new Queryable for cortex.
Types ¶
type BlockMeta ¶ added in v1.2.0
type BlockMeta struct { metadata.Meta // UploadedAt is the timestamp when the block has been completed to be uploaded // to the storage. UploadedAt time.Time }
BlockMeta is a struct extending the Thanos block metadata and adding Cortex-specific data too.
type BlockMetas ¶ added in v1.2.0
type BlockMetas []*BlockMeta
func (BlockMetas) String ¶ added in v1.2.0
func (s BlockMetas) String() string
type BlockQueryable ¶ added in v0.7.0
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
type BlocksConsistencyChecker ¶ added in v1.2.0
type BlocksConsistencyChecker struct {
// contains filtered or unexported fields
}
func NewBlocksConsistencyChecker ¶ added in v1.2.0
func NewBlocksConsistencyChecker(uploadGracePeriod, deletionGracePeriod time.Duration, logger log.Logger, reg prometheus.Registerer) *BlocksConsistencyChecker
type BlocksFinder ¶ added in v1.1.0
type BlocksFinder interface { services.Service // GetBlocks returns known blocks for userID containing samples within the range minT // and maxT (milliseconds, both included). Returned blocks are sorted by MaxTime descending. GetBlocks(userID string, minT, maxT int64) ([]*BlockMeta, map[ulid.ULID]*metadata.DeletionMark, error) }
BlocksFinder is the interface used to find blocks for a given user and time range.
type BlocksScanner ¶ added in v1.1.0
func NewBlocksScanner ¶ added in v1.1.0
func NewBlocksScanner(cfg BlocksScannerConfig, bucketClient objstore.Bucket, logger log.Logger, reg prometheus.Registerer) *BlocksScanner
func (*BlocksScanner) GetBlocks ¶ added in v1.1.0
func (d *BlocksScanner) GetBlocks(userID string, minT, maxT int64) ([]*BlockMeta, map[ulid.ULID]*metadata.DeletionMark, error)
GetBlocks returns known blocks for userID containing samples within the range minT and maxT (milliseconds, both included). Returned blocks are sorted by MaxTime descending.
type BlocksScannerConfig ¶ added in v1.1.0
type BlocksStoreClient ¶ added in v1.2.0
type BlocksStoreClient interface { storegatewaypb.StoreGatewayClient // RemoteAddress returns the address of the remote store-gateway and is used to uniquely // identify a store-gateway backend instance. RemoteAddress() string }
BlocksStoreClient is the interface that should be implemented by any client used to query a backend store-gateway.
type BlocksStoreQueryable ¶ added in v1.1.0
BlocksStoreQueryable is a queryable which queries blocks storage via the store-gateway.
func NewBlocksStoreQueryable ¶ added in v1.1.0
func NewBlocksStoreQueryable(stores BlocksStoreSet, finder BlocksFinder, consistency *BlocksConsistencyChecker, queryStoreAfter time.Duration, logger log.Logger, reg prometheus.Registerer) (*BlocksStoreQueryable, error)
func NewBlocksStoreQueryableFromConfig ¶ added in v1.1.0
func NewBlocksStoreQueryableFromConfig(querierCfg Config, gatewayCfg storegateway.Config, storageCfg cortex_tsdb.Config, logger log.Logger, reg prometheus.Registerer) (*BlocksStoreQueryable, error)
type BlocksStoreSet ¶ added in v1.1.0
type BlocksStoreSet interface { services.Service // GetClientsFor returns the store gateway clients that should be used to // query the set of blocks in input. The exclude parameter is the map of // blocks -> store-gateway addresses that should be excluded. GetClientsFor(blockIDs []ulid.ULID, exclude map[ulid.ULID][]string) (map[BlocksStoreClient][]ulid.ULID, error) }
BlocksStoreSet is the interface used to get the clients to query series on a set of blocks.
type BucketStoresService ¶ added in v1.1.0
BucketStoresService wraps BucketStores into a service which triggers both the initial sync at startup and a periodic sync honoring configured the sync interval.
func NewBucketStoresService ¶ added in v1.1.0
func NewBucketStoresService(cfg tsdb.Config, bucketClient objstore.Bucket, logLevel logging.Level, logger log.Logger, registerer prometheus.Registerer) (*BucketStoresService, error)
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"` // LookbackDelta determines the time since the last sample after which a time // series is considered stale. LookbackDelta time.Duration `yaml:"lookback_delta"` // Blocks storage only. StoreGatewayAddresses string `yaml:"store_gateway_addresses"` StoreGatewayClient tls.ClientConfig `yaml:"store_gateway_client"` // contains filtered or unexported fields }
Config contains the configuration require to create a querier
func (*Config) GetStoreGatewayAddresses ¶ added in v1.1.0
func (*Config) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet.
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) MetricsMetadata(ctx context.Context) ([]scrape.MetricMetadata, 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.
Source Files ¶
- block.go
- block_meta.go
- blocks_bucket_stores_service.go
- blocks_consistency_checker.go
- blocks_scanner.go
- blocks_store_balanced_set.go
- blocks_store_queryable.go
- blocks_store_replicated_set.go
- chunk_store_queryable.go
- chunks_handler.go
- distributor_queryable.go
- dummy.go
- matrix.go
- metadata_handler.go
- querier.go
- remote_read.go
- series_with_chunks.go
- store_gateway_client.go
- timeseries_series_set.go