storegateway

package
v1.1.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 37 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// RingKey is the key under which we store the store gateways ring in the KVStore.
	RingKey = "store-gateway"

	// RingNameForServer is the name of the ring used by the store gateway server.
	RingNameForServer = "store-gateway"

	// RingNameForClient is the name of the ring used by the store gateway client (we need
	// a different name to avoid clashing Prometheus metrics when running in single-binary).
	RingNameForClient = "store-gateway-client"

	// We use a safe default instead of exposing to config option to the user
	// in order to simplify the config.
	RingNumTokens = 512
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlocksReplicationStrategy added in v1.1.0

type BlocksReplicationStrategy struct{}

func (*BlocksReplicationStrategy) Filter added in v1.1.0

func (s *BlocksReplicationStrategy) Filter(instances []ring.IngesterDesc, op ring.Operation, replicationFactor int, heartbeatTimeout time.Duration) ([]ring.IngesterDesc, int, error)

func (*BlocksReplicationStrategy) ShouldExtendReplicaSet added in v1.1.0

func (s *BlocksReplicationStrategy) ShouldExtendReplicaSet(instance ring.IngesterDesc, op ring.Operation) bool

type BucketStoreMetrics added in v1.1.0

type BucketStoreMetrics struct {
	// contains filtered or unexported fields
}

BucketStoreMetrics aggregates metrics exported by Thanos Bucket Store and re-exports those aggregates as Cortex metrics.

func NewBucketStoreMetrics added in v1.1.0

func NewBucketStoreMetrics() *BucketStoreMetrics

func (*BucketStoreMetrics) AddUserRegistry added in v1.1.0

func (m *BucketStoreMetrics) AddUserRegistry(user string, reg *prometheus.Registry)

func (*BucketStoreMetrics) Collect added in v1.1.0

func (m *BucketStoreMetrics) Collect(out chan<- prometheus.Metric)

func (*BucketStoreMetrics) Describe added in v1.1.0

func (m *BucketStoreMetrics) Describe(out chan<- *prometheus.Desc)

type BucketStoreSeriesServer added in v1.1.0

type BucketStoreSeriesServer struct {
	// This field just exist to pseudo-implement the unused methods of the interface.
	storepb.Store_SeriesServer

	SeriesSet []*storepb.Series
	Warnings  storage.Warnings
	// contains filtered or unexported fields
}

BucketStoreSeriesServer is an fake in-memory gRPC server used to call Thanos BucketStore.Series() without having to go through the gRPC networking stack.

func NewBucketStoreSeriesServer added in v1.1.0

func NewBucketStoreSeriesServer(ctx context.Context) *BucketStoreSeriesServer

func (*BucketStoreSeriesServer) Context added in v1.1.0

func (*BucketStoreSeriesServer) Send added in v1.1.0

type BucketStores added in v1.1.0

type BucketStores struct {
	// contains filtered or unexported fields
}

BucketStores is a multi-tenant wrapper of Thanos BucketStore.

func NewBucketStores added in v1.1.0

func NewBucketStores(cfg tsdb.Config, filters []block.MetadataFilter, bucketClient objstore.Bucket, logLevel logging.Level, logger log.Logger, reg prometheus.Registerer) (*BucketStores, error)

NewBucketStores makes a new BucketStores.

func (*BucketStores) InitialSync added in v1.1.0

func (u *BucketStores) InitialSync(ctx context.Context) error

InitialSync does an initial synchronization of blocks for all users.

func (*BucketStores) Series added in v1.1.0

Series makes a series request to the underlying user bucket store.

func (*BucketStores) SyncBlocks added in v1.1.0

func (u *BucketStores) SyncBlocks(ctx context.Context) error

SyncBlocks synchronizes the stores state with the Bucket store for every user.

type Config

type Config struct {
	ShardingEnabled bool       `yaml:"sharding_enabled"`
	ShardingRing    RingConfig `` /* 127-byte string literal not displayed */
}

Config holds the store gateway config.

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags registers the Config flags.

type MetadataFetcherMetrics added in v1.1.0

type MetadataFetcherMetrics struct {
	// contains filtered or unexported fields
}

This struct aggregates metrics exported by Thanos MetaFetcher and re-exports those aggregates as Cortex metrics.

func NewMetadataFetcherMetrics added in v1.1.0

func NewMetadataFetcherMetrics() *MetadataFetcherMetrics

func (*MetadataFetcherMetrics) AddUserRegistry added in v1.1.0

func (m *MetadataFetcherMetrics) AddUserRegistry(user string, reg *prometheus.Registry)

func (*MetadataFetcherMetrics) Collect added in v1.1.0

func (m *MetadataFetcherMetrics) Collect(out chan<- prometheus.Metric)

func (*MetadataFetcherMetrics) Describe added in v1.1.0

func (m *MetadataFetcherMetrics) Describe(out chan<- *prometheus.Desc)

type RingConfig

type RingConfig struct {
	KVStore           kv.Config     `` /* 206-byte string literal not displayed */
	HeartbeatPeriod   time.Duration `yaml:"heartbeat_period"`
	HeartbeatTimeout  time.Duration `yaml:"heartbeat_timeout"`
	ReplicationFactor int           `yaml:"replication_factor"`
	TokensFilePath    string        `yaml:"tokens_file_path"`

	// Instance details
	InstanceID             string   `yaml:"instance_id" doc:"hidden"`
	InstanceInterfaceNames []string `yaml:"instance_interface_names" doc:"hidden"`
	InstancePort           int      `yaml:"instance_port" doc:"hidden"`
	InstanceAddr           string   `yaml:"instance_addr" doc:"hidden"`

	// Injected internally
	ListenPort      int           `yaml:"-"`
	RingCheckPeriod time.Duration `yaml:"-"`
}

RingConfig masks the ring lifecycler config which contains many options not really required by the store gateways ring. This config is used to strip down the config to the minimum, and avoid confusion to the user.

func (*RingConfig) RegisterFlags

func (cfg *RingConfig) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config this to the given FlagSet

func (*RingConfig) ToLifecyclerConfig

func (cfg *RingConfig) ToLifecyclerConfig() (ring.BasicLifecyclerConfig, error)

func (*RingConfig) ToRingConfig added in v1.1.0

func (cfg *RingConfig) ToRingConfig() ring.Config

type ShardingMetadataFilter added in v1.1.0

type ShardingMetadataFilter struct {
	// contains filtered or unexported fields
}

ShardingMetadataFilter represents struct that allows sharding using the ring. Not go-routine safe.

func NewShardingMetadataFilter added in v1.1.0

func NewShardingMetadataFilter(r *ring.Ring, instanceAddr string, logger log.Logger) *ShardingMetadataFilter

NewShardingMetadataFilter creates ShardingMetadataFilter.

func (*ShardingMetadataFilter) Filter added in v1.1.0

func (f *ShardingMetadataFilter) Filter(_ context.Context, metas map[ulid.ULID]*metadata.Meta, synced *extprom.TxGaugeVec) error

Filter filters out blocks not included within the current shard.

type StoreGateway

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

StoreGateway is the Cortex service responsible to expose an API over the bucket where blocks are stored, supporting blocks sharding and replication across a pool of store gateway instances (optional).

func NewStoreGateway

func NewStoreGateway(gatewayCfg Config, storageCfg cortex_tsdb.Config, logLevel logging.Level, logger log.Logger, reg prometheus.Registerer) (*StoreGateway, error)

func (*StoreGateway) OnRingInstanceHeartbeat added in v1.1.0

func (g *StoreGateway) OnRingInstanceHeartbeat(_ *ring.BasicLifecycler, _ *ring.Desc, _ *ring.IngesterDesc)

func (*StoreGateway) OnRingInstanceRegister added in v1.1.0

func (g *StoreGateway) OnRingInstanceRegister(_ *ring.BasicLifecycler, ringDesc ring.Desc, instanceExists bool, instanceID string, instanceDesc ring.IngesterDesc) (ring.IngesterState, ring.Tokens)

func (*StoreGateway) OnRingInstanceStopping added in v1.1.0

func (g *StoreGateway) OnRingInstanceStopping(_ *ring.BasicLifecycler)

func (*StoreGateway) OnRingInstanceTokens added in v1.1.0

func (g *StoreGateway) OnRingInstanceTokens(_ *ring.BasicLifecycler, _ ring.Tokens)

func (*StoreGateway) RingHandler

func (c *StoreGateway) RingHandler(w http.ResponseWriter, req *http.Request)

func (*StoreGateway) Series added in v1.1.0

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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