Documentation ¶
Index ¶
- type BucketStore
- func (s *BucketStore) Close() (err error)
- func (s *BucketStore) Info(context.Context, *storepb.InfoRequest) (*storepb.InfoResponse, error)
- func (s *BucketStore) InitialSync(ctx context.Context) error
- func (s *BucketStore) LabelNames(context.Context, *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error)
- func (s *BucketStore) LabelValues(ctx context.Context, req *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error)
- func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error
- func (s *BucketStore) SyncBlocks(ctx context.Context) error
- func (s *BucketStore) TimeRange() (mint, maxt int64)
- type Client
- type PrometheusStore
- func (p *PrometheusStore) Info(ctx context.Context, r *storepb.InfoRequest) (*storepb.InfoResponse, error)
- func (p *PrometheusStore) LabelNames(ctx context.Context, r *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error)
- func (p *PrometheusStore) LabelValues(ctx context.Context, r *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error)
- func (p *PrometheusStore) Series(r *storepb.SeriesRequest, s storepb.Store_SeriesServer) error
- type ProxyStore
- func (s *ProxyStore) Info(ctx context.Context, r *storepb.InfoRequest) (*storepb.InfoResponse, error)
- func (s *ProxyStore) LabelNames(ctx context.Context, r *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error)
- func (s *ProxyStore) LabelValues(ctx context.Context, r *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error)
- func (s *ProxyStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error
- type TSDBStore
- func (s *TSDBStore) Info(ctx context.Context, r *storepb.InfoRequest) (*storepb.InfoResponse, error)
- func (s *TSDBStore) LabelNames(ctx context.Context, r *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error)
- func (s *TSDBStore) LabelValues(ctx context.Context, r *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error)
- func (s *TSDBStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketStore ¶
type BucketStore struct {
// contains filtered or unexported fields
}
BucketStore implements the store API backed by a bucket. It loads all index files to local disk.
func NewBucketStore ¶
func NewBucketStore( logger log.Logger, reg prometheus.Registerer, bucket objstore.BucketReader, dir string, indexCacheSizeBytes uint64, maxChunkPoolBytes uint64, debugLogging bool, blockSyncConcurrency int, ) (*BucketStore, error)
NewBucketStore creates a new bucket backed store that implements the store API against an object store bucket. It is optimized to work against high latency backends.
func (*BucketStore) Info ¶
func (s *BucketStore) Info(context.Context, *storepb.InfoRequest) (*storepb.InfoResponse, error)
Info implements the storepb.StoreServer interface.
func (*BucketStore) InitialSync ¶
func (s *BucketStore) InitialSync(ctx context.Context) error
InitialSync perform blocking sync with extra step at the end to delete locally saved blocks that are no longer present in the bucket. The mismatch of these can only happen between restarts, so we can do that only once per startup.
func (*BucketStore) LabelNames ¶
func (s *BucketStore) LabelNames(context.Context, *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error)
LabelNames implements the storepb.StoreServer interface.
func (*BucketStore) LabelValues ¶
func (s *BucketStore) LabelValues(ctx context.Context, req *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error)
LabelValues implements the storepb.StoreServer interface.
func (*BucketStore) Series ¶
func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error
Series implements the storepb.StoreServer interface. TODO(bwplotka): It buffers all chunks in memory and only then streams to client. 1. Either count chunk sizes and error out too big query. 2. Stream posting -> series -> chunk all together.
func (*BucketStore) SyncBlocks ¶
func (s *BucketStore) SyncBlocks(ctx context.Context) error
SyncBlocks synchronizes the stores state with the Bucket bucket. It will reuse disk space as persistent cache based on s.dir param.
func (*BucketStore) TimeRange ¶
func (s *BucketStore) TimeRange() (mint, maxt int64)
TimeRange returns the minimum and maximum timestamp of data available in the store.
type Client ¶
type Client interface { // Client to access the store. storepb.StoreClient // Labels that apply to all data exposed by the backing store. Labels() []storepb.Label // Minimum and maximum time range of data in the store. TimeRange() (mint int64, maxt int64) String() string }
Client holds meta information about a store.
type PrometheusStore ¶
type PrometheusStore struct {
// contains filtered or unexported fields
}
PrometheusStore implements the store node API on top of the Prometheus remote read API.
func NewPrometheusStore ¶
func NewPrometheusStore( logger log.Logger, client *http.Client, baseURL *url.URL, component component.StoreAPI, externalLabels func() labels.Labels, timestamps func() (mint int64, maxt int64), ) (*PrometheusStore, error)
NewPrometheusStore returns a new PrometheusStore that uses the given HTTP client to talk to Prometheus. It attaches the provided external labels to all results.
func (*PrometheusStore) Info ¶
func (p *PrometheusStore) Info(ctx context.Context, r *storepb.InfoRequest) (*storepb.InfoResponse, error)
Info returns store information about the Prometheus instance. NOTE(bplotka): MaxTime & MinTime are not accurate nor adjusted dynamically like these included in gossip meta. This is fine for now, but might be needed in future.
func (*PrometheusStore) LabelNames ¶
func (p *PrometheusStore) LabelNames(ctx context.Context, r *storepb.LabelNamesRequest) ( *storepb.LabelNamesResponse, error, )
LabelNames returns all known label names.
func (*PrometheusStore) LabelValues ¶
func (p *PrometheusStore) LabelValues(ctx context.Context, r *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error)
LabelValues returns all known label values for a given label name.
func (*PrometheusStore) Series ¶
func (p *PrometheusStore) Series(r *storepb.SeriesRequest, s storepb.Store_SeriesServer) error
Series returns all series for a requested time range and label matcher.
type ProxyStore ¶
type ProxyStore struct {
// contains filtered or unexported fields
}
ProxyStore implements the store API that proxies request to all given underlying stores.
func NewProxyStore ¶
func NewProxyStore( logger log.Logger, stores func(context.Context) ([]Client, error), component component.StoreAPI, selectorLabels labels.Labels, ) *ProxyStore
NewProxyStore returns a new ProxyStore that uses the given clients that implements storeAPI to fan-in all series to the client. Note that there is no deduplication support. Deduplication should be done on the highest level (just before PromQL)
func (*ProxyStore) Info ¶
func (s *ProxyStore) Info(ctx context.Context, r *storepb.InfoRequest) (*storepb.InfoResponse, error)
Info returns store information about the external labels this store have.
func (*ProxyStore) LabelNames ¶
func (s *ProxyStore) LabelNames(ctx context.Context, r *storepb.LabelNamesRequest) ( *storepb.LabelNamesResponse, error, )
LabelNames returns all known label names.
func (*ProxyStore) LabelValues ¶
func (s *ProxyStore) LabelValues(ctx context.Context, r *storepb.LabelValuesRequest) ( *storepb.LabelValuesResponse, error, )
LabelValues returns all known label values for a given label name.
func (*ProxyStore) Series ¶
func (s *ProxyStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error
Series returns all series for a requested time range and label matcher. Requested series are taken from other stores and proxied to RPC client. NOTE: Resulted data are not trimmed exactly to min and max time range.
type TSDBStore ¶
type TSDBStore struct {
// contains filtered or unexported fields
}
TSDBStore implements the store API against a local TSDB instance. It attaches the provided external labels to all results. It only responds with raw data and does not support downsampling.
func NewTSDBStore ¶
func NewTSDBStore(logger log.Logger, reg prometheus.Registerer, db *tsdb.DB, component component.SourceStoreAPI, externalLabels labels.Labels) *TSDBStore
NewTSDBStore creates a new TSDBStore.
func (*TSDBStore) Info ¶
func (s *TSDBStore) Info(ctx context.Context, r *storepb.InfoRequest) (*storepb.InfoResponse, error)
Info returns store information about the Prometheus instance.
func (*TSDBStore) LabelNames ¶
func (s *TSDBStore) LabelNames(ctx context.Context, r *storepb.LabelNamesRequest) ( *storepb.LabelNamesResponse, error, )
LabelNames returns all known label names.
func (*TSDBStore) LabelValues ¶
func (s *TSDBStore) LabelValues(ctx context.Context, r *storepb.LabelValuesRequest) ( *storepb.LabelValuesResponse, error, )
LabelValues returns all known label values for a given label name.
func (*TSDBStore) Series ¶
func (s *TSDBStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error
Series returns all series for a requested time range and label matcher. The returned data may exceed the requested time bounds.