Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/blocks-storage/compactor.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,19 @@ compactor:

sharding_ring:
kvstore:
# Backend storage to use for the ring. Supported values are: consul, etcd,
# inmemory, memberlist, multi.
# Backend storage to use for the ring. Supported values are: consul,
# dynamodb, etcd, inmemory, memberlist, multi.
# CLI flag: -compactor.ring.store
[store: <string> | default = "consul"]

# The prefix for the keys in the store. Should end with a /.
# CLI flag: -compactor.ring.prefix
[prefix: <string> | default = "collectors/"]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: compactor.ring
[consul: <consul_config>]

dynamodb:
# Region to access dynamodb.
# CLI flag: -compactor.ring.dynamodb.region
Expand All @@ -229,10 +233,6 @@ compactor:
# CLI flag: -compactor.ring.dynamodb.timeout
[timeout: <duration> | default = 2m]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: compactor.ring
[consul: <consul_config>]

# The etcd_config configures the etcd client.
# The CLI flags prefix for this block config is: compactor.ring
[etcd: <etcd_config>]
Expand Down
14 changes: 7 additions & 7 deletions docs/blocks-storage/store-gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,20 @@ store_gateway:
# This option needs be set both on the store-gateway and querier when
# running in microservices mode.
kvstore:
# Backend storage to use for the ring. Supported values are: consul, etcd,
# inmemory, memberlist, multi.
# Backend storage to use for the ring. Supported values are: consul,
# dynamodb, etcd, inmemory, memberlist, multi.
# CLI flag: -store-gateway.sharding-ring.store
[store: <string> | default = "consul"]

# The prefix for the keys in the store. Should end with a /.
# CLI flag: -store-gateway.sharding-ring.prefix
[prefix: <string> | default = "collectors/"]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is:
# store-gateway.sharding-ring
[consul: <consul_config>]

dynamodb:
# Region to access dynamodb.
# CLI flag: -store-gateway.sharding-ring.dynamodb.region
Expand All @@ -244,11 +249,6 @@ store_gateway:
# CLI flag: -store-gateway.sharding-ring.dynamodb.timeout
[timeout: <duration> | default = 2m]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is:
# store-gateway.sharding-ring
[consul: <consul_config>]

# The etcd_config configures the etcd client.
# The CLI flags prefix for this block config is:
# store-gateway.sharding-ring
Expand Down
94 changes: 47 additions & 47 deletions docs/configuration/config-file-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,19 @@ parquet_converter:

ring:
kvstore:
# Backend storage to use for the ring. Supported values are: consul, etcd,
# inmemory, memberlist, multi.
# Backend storage to use for the ring. Supported values are: consul,
# dynamodb, etcd, inmemory, memberlist, multi.
# CLI flag: -parquet-converter.ring.store
[store: <string> | default = "consul"]

# The prefix for the keys in the store. Should end with a /.
# CLI flag: -parquet-converter.ring.prefix
[prefix: <string> | default = "collectors/"]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: parquet-converter.ring
[consul: <consul_config>]

dynamodb:
# Region to access dynamodb.
# CLI flag: -parquet-converter.ring.dynamodb.region
Expand All @@ -226,10 +230,6 @@ parquet_converter:
# CLI flag: -parquet-converter.ring.dynamodb.timeout
[timeout: <duration> | default = 2m]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: parquet-converter.ring
[consul: <consul_config>]

# The etcd_config configures the etcd client.
# The CLI flags prefix for this block config is: parquet-converter.ring
[etcd: <etcd_config>]
Expand Down Expand Up @@ -451,15 +451,19 @@ The `alertmanager_config` configures the Cortex alertmanager.
sharding_ring:
# The key-value store used to share the hash ring across multiple instances.
kvstore:
# Backend storage to use for the ring. Supported values are: consul, etcd,
# inmemory, memberlist, multi.
# Backend storage to use for the ring. Supported values are: consul,
# dynamodb, etcd, inmemory, memberlist, multi.
# CLI flag: -alertmanager.sharding-ring.store
[store: <string> | default = "consul"]

# The prefix for the keys in the store. Should end with a /.
# CLI flag: -alertmanager.sharding-ring.prefix
[prefix: <string> | default = "alertmanagers/"]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: alertmanager.sharding-ring
[consul: <consul_config>]

dynamodb:
# Region to access dynamodb.
# CLI flag: -alertmanager.sharding-ring.dynamodb.region
Expand All @@ -485,10 +489,6 @@ sharding_ring:
# CLI flag: -alertmanager.sharding-ring.dynamodb.timeout
[timeout: <duration> | default = 2m]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: alertmanager.sharding-ring
[consul: <consul_config>]

# The etcd_config configures the etcd client.
# The CLI flags prefix for this block config is: alertmanager.sharding-ring
[etcd: <etcd_config>]
Expand Down Expand Up @@ -2710,15 +2710,19 @@ The `compactor_config` configures the compactor for the blocks storage.

sharding_ring:
kvstore:
# Backend storage to use for the ring. Supported values are: consul, etcd,
# inmemory, memberlist, multi.
# Backend storage to use for the ring. Supported values are: consul,
# dynamodb, etcd, inmemory, memberlist, multi.
# CLI flag: -compactor.ring.store
[store: <string> | default = "consul"]

# The prefix for the keys in the store. Should end with a /.
# CLI flag: -compactor.ring.prefix
[prefix: <string> | default = "collectors/"]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: compactor.ring
[consul: <consul_config>]

dynamodb:
# Region to access dynamodb.
# CLI flag: -compactor.ring.dynamodb.region
Expand All @@ -2744,10 +2748,6 @@ sharding_ring:
# CLI flag: -compactor.ring.dynamodb.timeout
[timeout: <duration> | default = 2m]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: compactor.ring
[consul: <consul_config>]

# The etcd_config configures the etcd client.
# The CLI flags prefix for this block config is: compactor.ring
[etcd: <etcd_config>]
Expand Down Expand Up @@ -3039,15 +3039,19 @@ ha_tracker:
# supported by the HA tracker since gossip propagation is too slow for HA
# purposes.
kvstore:
# Backend storage to use for the ring. Supported values are: consul, etcd,
# inmemory, memberlist, multi.
# Backend storage to use for the ring. Supported values are: consul,
# dynamodb, etcd, inmemory, memberlist, multi.
# CLI flag: -distributor.ha-tracker.store
[store: <string> | default = "consul"]

# The prefix for the keys in the store. Should end with a /.
# CLI flag: -distributor.ha-tracker.prefix
[prefix: <string> | default = "ha-tracker/"]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: distributor.ha-tracker
[consul: <consul_config>]

dynamodb:
# Region to access dynamodb.
# CLI flag: -distributor.ha-tracker.dynamodb.region
Expand All @@ -3073,10 +3077,6 @@ ha_tracker:
# CLI flag: -distributor.ha-tracker.dynamodb.timeout
[timeout: <duration> | default = 2m]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: distributor.ha-tracker
[consul: <consul_config>]

# The etcd_config configures the etcd client.
# The CLI flags prefix for this block config is: distributor.ha-tracker
[etcd: <etcd_config>]
Expand Down Expand Up @@ -3147,15 +3147,19 @@ ha_tracker:

ring:
kvstore:
# Backend storage to use for the ring. Supported values are: consul, etcd,
# inmemory, memberlist, multi.
# Backend storage to use for the ring. Supported values are: consul,
# dynamodb, etcd, inmemory, memberlist, multi.
# CLI flag: -distributor.ring.store
[store: <string> | default = "consul"]

# The prefix for the keys in the store. Should end with a /.
# CLI flag: -distributor.ring.prefix
[prefix: <string> | default = "collectors/"]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: distributor.ring
[consul: <consul_config>]

dynamodb:
# Region to access dynamodb.
# CLI flag: -distributor.ring.dynamodb.region
Expand All @@ -3181,10 +3185,6 @@ ring:
# CLI flag: -distributor.ring.dynamodb.timeout
[timeout: <duration> | default = 2m]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: distributor.ring
[consul: <consul_config>]

# The etcd_config configures the etcd client.
# The CLI flags prefix for this block config is: distributor.ring
[etcd: <etcd_config>]
Expand Down Expand Up @@ -3495,15 +3495,18 @@ The `ingester_config` configures the Cortex ingester.
lifecycler:
ring:
kvstore:
# Backend storage to use for the ring. Supported values are: consul, etcd,
# inmemory, memberlist, multi.
# Backend storage to use for the ring. Supported values are: consul,
# dynamodb, etcd, inmemory, memberlist, multi.
# CLI flag: -ring.store
[store: <string> | default = "consul"]

# The prefix for the keys in the store. Should end with a /.
# CLI flag: -ring.prefix
[prefix: <string> | default = "collectors/"]

# The consul_config configures the consul client.
[consul: <consul_config>]

dynamodb:
# Region to access dynamodb.
# CLI flag: -dynamodb.region
Expand All @@ -3529,9 +3532,6 @@ lifecycler:
# CLI flag: -dynamodb.timeout
[timeout: <duration> | default = 2m]

# The consul_config configures the consul client.
[consul: <consul_config>]

# The etcd_config configures the etcd client.
[etcd: <etcd_config>]

Expand Down Expand Up @@ -5300,15 +5300,19 @@ alertmanager_client:

ring:
kvstore:
# Backend storage to use for the ring. Supported values are: consul, etcd,
# inmemory, memberlist, multi.
# Backend storage to use for the ring. Supported values are: consul,
# dynamodb, etcd, inmemory, memberlist, multi.
# CLI flag: -ruler.ring.store
[store: <string> | default = "consul"]

# The prefix for the keys in the store. Should end with a /.
# CLI flag: -ruler.ring.prefix
[prefix: <string> | default = "rulers/"]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: ruler.ring
[consul: <consul_config>]

dynamodb:
# Region to access dynamodb.
# CLI flag: -ruler.ring.dynamodb.region
Expand All @@ -5334,10 +5338,6 @@ ring:
# CLI flag: -ruler.ring.dynamodb.timeout
[timeout: <duration> | default = 2m]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: ruler.ring
[consul: <consul_config>]

# The etcd_config configures the etcd client.
# The CLI flags prefix for this block config is: ruler.ring
[etcd: <etcd_config>]
Expand Down Expand Up @@ -6323,15 +6323,19 @@ sharding_ring:
# This option needs be set both on the store-gateway and querier when running
# in microservices mode.
kvstore:
# Backend storage to use for the ring. Supported values are: consul, etcd,
# inmemory, memberlist, multi.
# Backend storage to use for the ring. Supported values are: consul,
# dynamodb, etcd, inmemory, memberlist, multi.
# CLI flag: -store-gateway.sharding-ring.store
[store: <string> | default = "consul"]

# The prefix for the keys in the store. Should end with a /.
# CLI flag: -store-gateway.sharding-ring.prefix
[prefix: <string> | default = "collectors/"]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: store-gateway.sharding-ring
[consul: <consul_config>]

dynamodb:
# Region to access dynamodb.
# CLI flag: -store-gateway.sharding-ring.dynamodb.region
Expand All @@ -6357,10 +6361,6 @@ sharding_ring:
# CLI flag: -store-gateway.sharding-ring.dynamodb.timeout
[timeout: <duration> | default = 2m]

# The consul_config configures the consul client.
# The CLI flags prefix for this block config is: store-gateway.sharding-ring
[consul: <consul_config>]

# The etcd_config configures the etcd client.
# The CLI flags prefix for this block config is: store-gateway.sharding-ring
[etcd: <etcd_config>]
Expand Down
8 changes: 4 additions & 4 deletions pkg/ring/kv/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ var inmemoryStoreInit sync.Once
var inmemoryStore Client

// StoreConfig is a configuration used for building single store client, either
// Consul, Etcd, Memberlist or MultiClient. It was extracted from Config to keep
// Consul, DynamoDB, Etcd, Memberlist or MultiClient. It was extracted from Config to keep
// single-client config separate from final client-config (with all the wrappers)
type StoreConfig struct {
DynamoDB dynamodb.Config `yaml:"dynamodb"`
Consul consul.Config `yaml:"consul"`
DynamoDB dynamodb.Config `yaml:"dynamodb"`
Etcd etcd.Config `yaml:"etcd"`
Multi MultiConfig `yaml:"multi"`

Expand Down Expand Up @@ -81,7 +81,7 @@ func (cfg *Config) RegisterFlagsWithPrefix(flagsPrefix, defaultPrefix string, f
flagsPrefix = "ring."
}
f.StringVar(&cfg.Prefix, flagsPrefix+"prefix", defaultPrefix, "The prefix for the keys in the store. Should end with a /.")
f.StringVar(&cfg.Store, flagsPrefix+"store", "consul", "Backend storage to use for the ring. Supported values are: consul, etcd, inmemory, memberlist, multi.")
f.StringVar(&cfg.Store, flagsPrefix+"store", "consul", "Backend storage to use for the ring. Supported values are: consul, dynamodb, etcd, inmemory, memberlist, multi.")
}

// Client is a high-level client for key-value stores (such as Etcd and
Expand Down Expand Up @@ -120,7 +120,7 @@ type Client interface {
LastUpdateTime(key string) time.Time
}

// NewClient creates a new Client (consul, etcd or inmemory) based on the config,
// NewClient creates a new Client based on the config,
// encodes and decodes data for storage using the codec.
func NewClient(cfg Config, codec codec.Codec, reg prometheus.Registerer, logger log.Logger) (Client, error) {
if cfg.Mock != nil {
Expand Down
Loading