Documentation
¶
Index ¶
- func ChunksHandler(queryable storage.Queryable) http.Handler
- func New(cfg Config, distributor Distributor, chunkStore ChunkStore) (storage.Queryable, *promql.Engine)
- func NewQueryable(dq, cq storage.Queryable, distributor Distributor, ...) storage.Queryable
- func RemoteReadHandler(q storage.Queryable) http.Handler
- type BlockQuerier
- type ChunkStore
- type Config
- type Distributor
- type DummyAlertmanagerRetriever
- type DummyRulesRetriever
- type DummyTargetRetriever
- type UserStore
- func (u *UserStore) Info(ctx context.Context, req *storepb.InfoRequest) (*storepb.InfoResponse, error)
- func (u *UserStore) InitialSync(ctx context.Context) error
- func (u *UserStore) LabelNames(ctx context.Context, req *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error)
- func (u *UserStore) LabelValues(ctx context.Context, req *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error)
- func (u *UserStore) Series(req *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error
- func (u *UserStore) SyncStores(ctx context.Context) error
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, chunkStore ChunkStore) (storage.Queryable, *promql.Engine)
New builds a queryable and promql engine.
func NewQueryable ¶
func NewQueryable(dq, cq storage.Queryable, distributor Distributor, ingesterMaxQueryLookback time.Duration) 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 BlockQuerier ¶ added in v0.4.0
type BlockQuerier struct {
// contains filtered or unexported fields
}
BlockQuerier is a querier of thanos blocks
func NewBlockQuerier ¶ added in v0.4.0
func NewBlockQuerier(cfg tsdb.Config, r prometheus.Registerer) (*BlockQuerier, error)
NewBlockQuerier returns a client to query a block store
type ChunkStore ¶
type ChunkStore interface {
Get(ctx context.Context, userID string, from, through model.Time, matchers ...*labels.Matcher) ([]chunk.Chunk, error)
}
ChunkStore is the read-interface to the Chunk Store. Made an interface here to reduce package coupling.
type Config ¶
type Config struct {
MaxConcurrent int
Timeout time.Duration
Iterators bool
BatchIterators bool
IngesterStreaming bool
MaxSamples int
IngesterMaxQueryLookback time.Duration
// 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
// contains filtered or unexported fields
}
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.
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.TimeSeriesChunk, 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 UserStore ¶ added in v0.4.0
type UserStore struct {
// 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, logger log.Logger) (*UserStore, error)
NewUserStore returns a new UserStore
func (*UserStore) Info ¶ added in v0.4.0
func (u *UserStore) Info(ctx context.Context, req *storepb.InfoRequest) (*storepb.InfoResponse, error)
Info makes an info request to the underlying user store
func (*UserStore) InitialSync ¶ added in v0.4.0
func (u *UserStore) InitialSync(ctx context.Context) error
InitialSync iterates over the storage bucket creating user bucket stores, and calling InitialSync on each of them
func (*UserStore) LabelNames ¶ added in v0.4.0
func (u *UserStore) LabelNames(ctx context.Context, req *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error)
LabelNames makes a labelnames request to the underlying user store
func (*UserStore) LabelValues ¶ added in v0.4.0
func (u *UserStore) LabelValues(ctx context.Context, req *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error)
LabelValues makes a labelvalues request to the underlying user store
func (*UserStore) Series ¶ added in v0.4.0
func (u *UserStore) Series(req *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error
Series makes a series request to the underlying user store
func (*UserStore) SyncStores ¶ added in v0.4.0
func (u *UserStore) SyncStores(ctx context.Context) error
SyncStores iterates over the storage bucket creating user bucket stores