diff --git a/docs/blocks-storage/compactor.md b/docs/blocks-storage/compactor.md index fc0ab4ba11d..e9148823955 100644 --- a/docs/blocks-storage/compactor.md +++ b/docs/blocks-storage/compactor.md @@ -195,8 +195,8 @@ 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: | default = "consul"] @@ -204,6 +204,10 @@ compactor: # CLI flag: -compactor.ring.prefix [prefix: | default = "collectors/"] + # The consul_config configures the consul client. + # The CLI flags prefix for this block config is: compactor.ring + [consul: ] + dynamodb: # Region to access dynamodb. # CLI flag: -compactor.ring.dynamodb.region @@ -229,10 +233,6 @@ compactor: # CLI flag: -compactor.ring.dynamodb.timeout [timeout: | default = 2m] - # The consul_config configures the consul client. - # The CLI flags prefix for this block config is: compactor.ring - [consul: ] - # The etcd_config configures the etcd client. # The CLI flags prefix for this block config is: compactor.ring [etcd: ] diff --git a/docs/blocks-storage/store-gateway.md b/docs/blocks-storage/store-gateway.md index d3ea623e80a..506cf0f32a1 100644 --- a/docs/blocks-storage/store-gateway.md +++ b/docs/blocks-storage/store-gateway.md @@ -210,8 +210,8 @@ 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: | default = "consul"] @@ -219,6 +219,11 @@ store_gateway: # CLI flag: -store-gateway.sharding-ring.prefix [prefix: | default = "collectors/"] + # The consul_config configures the consul client. + # The CLI flags prefix for this block config is: + # store-gateway.sharding-ring + [consul: ] + dynamodb: # Region to access dynamodb. # CLI flag: -store-gateway.sharding-ring.dynamodb.region @@ -244,11 +249,6 @@ store_gateway: # CLI flag: -store-gateway.sharding-ring.dynamodb.timeout [timeout: | default = 2m] - # The consul_config configures the consul client. - # The CLI flags prefix for this block config is: - # store-gateway.sharding-ring - [consul: ] - # The etcd_config configures the etcd client. # The CLI flags prefix for this block config is: # store-gateway.sharding-ring diff --git a/docs/configuration/config-file-reference.md b/docs/configuration/config-file-reference.md index a72fafa4e61..73f94def3df 100644 --- a/docs/configuration/config-file-reference.md +++ b/docs/configuration/config-file-reference.md @@ -192,8 +192,8 @@ 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: | default = "consul"] @@ -201,6 +201,10 @@ parquet_converter: # CLI flag: -parquet-converter.ring.prefix [prefix: | default = "collectors/"] + # The consul_config configures the consul client. + # The CLI flags prefix for this block config is: parquet-converter.ring + [consul: ] + dynamodb: # Region to access dynamodb. # CLI flag: -parquet-converter.ring.dynamodb.region @@ -226,10 +230,6 @@ parquet_converter: # CLI flag: -parquet-converter.ring.dynamodb.timeout [timeout: | default = 2m] - # The consul_config configures the consul client. - # The CLI flags prefix for this block config is: parquet-converter.ring - [consul: ] - # The etcd_config configures the etcd client. # The CLI flags prefix for this block config is: parquet-converter.ring [etcd: ] @@ -451,8 +451,8 @@ 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: | default = "consul"] @@ -460,6 +460,10 @@ sharding_ring: # CLI flag: -alertmanager.sharding-ring.prefix [prefix: | default = "alertmanagers/"] + # The consul_config configures the consul client. + # The CLI flags prefix for this block config is: alertmanager.sharding-ring + [consul: ] + dynamodb: # Region to access dynamodb. # CLI flag: -alertmanager.sharding-ring.dynamodb.region @@ -485,10 +489,6 @@ sharding_ring: # CLI flag: -alertmanager.sharding-ring.dynamodb.timeout [timeout: | default = 2m] - # The consul_config configures the consul client. - # The CLI flags prefix for this block config is: alertmanager.sharding-ring - [consul: ] - # The etcd_config configures the etcd client. # The CLI flags prefix for this block config is: alertmanager.sharding-ring [etcd: ] @@ -2710,8 +2710,8 @@ 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: | default = "consul"] @@ -2719,6 +2719,10 @@ sharding_ring: # CLI flag: -compactor.ring.prefix [prefix: | default = "collectors/"] + # The consul_config configures the consul client. + # The CLI flags prefix for this block config is: compactor.ring + [consul: ] + dynamodb: # Region to access dynamodb. # CLI flag: -compactor.ring.dynamodb.region @@ -2744,10 +2748,6 @@ sharding_ring: # CLI flag: -compactor.ring.dynamodb.timeout [timeout: | default = 2m] - # The consul_config configures the consul client. - # The CLI flags prefix for this block config is: compactor.ring - [consul: ] - # The etcd_config configures the etcd client. # The CLI flags prefix for this block config is: compactor.ring [etcd: ] @@ -3039,8 +3039,8 @@ 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: | default = "consul"] @@ -3048,6 +3048,10 @@ ha_tracker: # CLI flag: -distributor.ha-tracker.prefix [prefix: | default = "ha-tracker/"] + # The consul_config configures the consul client. + # The CLI flags prefix for this block config is: distributor.ha-tracker + [consul: ] + dynamodb: # Region to access dynamodb. # CLI flag: -distributor.ha-tracker.dynamodb.region @@ -3073,10 +3077,6 @@ ha_tracker: # CLI flag: -distributor.ha-tracker.dynamodb.timeout [timeout: | default = 2m] - # The consul_config configures the consul client. - # The CLI flags prefix for this block config is: distributor.ha-tracker - [consul: ] - # The etcd_config configures the etcd client. # The CLI flags prefix for this block config is: distributor.ha-tracker [etcd: ] @@ -3147,8 +3147,8 @@ 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: | default = "consul"] @@ -3156,6 +3156,10 @@ ring: # CLI flag: -distributor.ring.prefix [prefix: | default = "collectors/"] + # The consul_config configures the consul client. + # The CLI flags prefix for this block config is: distributor.ring + [consul: ] + dynamodb: # Region to access dynamodb. # CLI flag: -distributor.ring.dynamodb.region @@ -3181,10 +3185,6 @@ ring: # CLI flag: -distributor.ring.dynamodb.timeout [timeout: | default = 2m] - # The consul_config configures the consul client. - # The CLI flags prefix for this block config is: distributor.ring - [consul: ] - # The etcd_config configures the etcd client. # The CLI flags prefix for this block config is: distributor.ring [etcd: ] @@ -3495,8 +3495,8 @@ 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: | default = "consul"] @@ -3504,6 +3504,9 @@ lifecycler: # CLI flag: -ring.prefix [prefix: | default = "collectors/"] + # The consul_config configures the consul client. + [consul: ] + dynamodb: # Region to access dynamodb. # CLI flag: -dynamodb.region @@ -3529,9 +3532,6 @@ lifecycler: # CLI flag: -dynamodb.timeout [timeout: | default = 2m] - # The consul_config configures the consul client. - [consul: ] - # The etcd_config configures the etcd client. [etcd: ] @@ -5300,8 +5300,8 @@ 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: | default = "consul"] @@ -5309,6 +5309,10 @@ ring: # CLI flag: -ruler.ring.prefix [prefix: | default = "rulers/"] + # The consul_config configures the consul client. + # The CLI flags prefix for this block config is: ruler.ring + [consul: ] + dynamodb: # Region to access dynamodb. # CLI flag: -ruler.ring.dynamodb.region @@ -5334,10 +5338,6 @@ ring: # CLI flag: -ruler.ring.dynamodb.timeout [timeout: | default = 2m] - # The consul_config configures the consul client. - # The CLI flags prefix for this block config is: ruler.ring - [consul: ] - # The etcd_config configures the etcd client. # The CLI flags prefix for this block config is: ruler.ring [etcd: ] @@ -6323,8 +6323,8 @@ 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: | default = "consul"] @@ -6332,6 +6332,10 @@ sharding_ring: # CLI flag: -store-gateway.sharding-ring.prefix [prefix: | default = "collectors/"] + # The consul_config configures the consul client. + # The CLI flags prefix for this block config is: store-gateway.sharding-ring + [consul: ] + dynamodb: # Region to access dynamodb. # CLI flag: -store-gateway.sharding-ring.dynamodb.region @@ -6357,10 +6361,6 @@ sharding_ring: # CLI flag: -store-gateway.sharding-ring.dynamodb.timeout [timeout: | default = 2m] - # The consul_config configures the consul client. - # The CLI flags prefix for this block config is: store-gateway.sharding-ring - [consul: ] - # The etcd_config configures the etcd client. # The CLI flags prefix for this block config is: store-gateway.sharding-ring [etcd: ] diff --git a/pkg/ring/kv/client.go b/pkg/ring/kv/client.go index eae1ee25189..f0a164a8b5d 100644 --- a/pkg/ring/kv/client.go +++ b/pkg/ring/kv/client.go @@ -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"` @@ -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 @@ -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 {