diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b4000653f2..359cae53ac1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,7 +52,7 @@ * [ENHANCEMENT] Improve the documentation around limits. #4905 * [ENHANCEMENT] Distributor: cache user overrides to reduce lock contention. #4904 * [FEATURE] Compactor: Added `-compactor.block-files-concurrency` allowing to configure number of go routines for download/upload block files during compaction. #4784 -* [FEATURE] Compactor: Added -compactor.blocks-fetch-concurrency` allowing to configure number of go routines for blocks during compaction. #4787 +* [FEATURE] Compactor: Added `-compactor.blocks-fetch-concurrency` allowing to configure number of go routines for blocks during compaction. #4787 * [FEATURE] Compactor: Added configurations for Azure MSI in blocks-storage, ruler-storage and alertmanager-storage. #4818 * [FEATURE] Ruler: Add support to pass custom implementations of queryable and pusher. #4782 * [FEATURE] Create OpenTelemetry Bridge for Tracing. Now cortex can send traces to multiple destinations using OTEL Collectors. #4834 @@ -61,6 +61,7 @@ * [FEATURE] Storage/Bucket: Added `-*.s3.bucket-lookup-type` allowing to configure the s3 bucket lookup type. #4794 * [FEATURE] QueryFrontend: Implement experimental vertical sharding at query frontend for range/instant queries. #4863 * [FEATURE] Querier: Added a new limit `-querier.max-fetched-data-bytes-per-query` allowing to limit the maximum size of all data in bytes that a query can fetch from each ingester and storage. #4854 +* [FEATURE] Added 2 flags `-alertmanager.alertmanager-client.grpc-compression` and `-querier.store-gateway-client.grpc-compression` to configure compression methods for grpc clients. #4889 * [BUGFIX] Storage/Bucket: Enable AWS SDK for go authentication for s3 to fix IMDSv1 authentication. #4897 * [BUGFIX] Memberlist: Add join with no retrying when starting service. #4804 * [BUGFIX] Ruler: Fix /ruler/rule_groups returns YAML with extra fields. #4767 diff --git a/docs/blocks-storage/querier.md b/docs/blocks-storage/querier.md index 47c7dfbd7bb..3c8cbdc3d62 100644 --- a/docs/blocks-storage/querier.md +++ b/docs/blocks-storage/querier.md @@ -207,6 +207,11 @@ querier: # CLI flag: -querier.store-gateway-client.tls-insecure-skip-verify [tls_insecure_skip_verify: | default = false] + # Use compression when sending messages. Supported values are: 'gzip', + # 'snappy' and '' (disable compression) + # CLI flag: -querier.store-gateway-client.grpc-compression + [grpc_compression: | default = ""] + # When distributor's sharding strategy is shuffle-sharding and this setting is # > 0, queriers fetch in-memory series from the minimum set of required # ingesters, selecting only ingesters which may have received series since diff --git a/docs/configuration/config-file-reference.md b/docs/configuration/config-file-reference.md index 000de55fd93..e97d4cdb6ff 100644 --- a/docs/configuration/config-file-reference.md +++ b/docs/configuration/config-file-reference.md @@ -885,6 +885,11 @@ store_gateway_client: # CLI flag: -querier.store-gateway-client.tls-insecure-skip-verify [tls_insecure_skip_verify: | default = false] + # Use compression when sending messages. Supported values are: 'gzip', + # 'snappy' and '' (disable compression) + # CLI flag: -querier.store-gateway-client.grpc-compression + [grpc_compression: | default = ""] + # When distributor's sharding strategy is shuffle-sharding and this setting is > # 0, queriers fetch in-memory series from the minimum set of required ingesters, # selecting only ingesters which may have received series since 'now - lookback @@ -1790,6 +1795,11 @@ alertmanager_client: # CLI flag: -alertmanager.alertmanager-client.tls-insecure-skip-verify [tls_insecure_skip_verify: | default = false] + # Use compression when sending messages. Supported values are: 'gzip', + # 'snappy' and '' (disable compression) + # CLI flag: -alertmanager.alertmanager-client.grpc-compression + [grpc_compression: | default = ""] + # The interval between persisting the current alertmanager state (notification # log and silences) to object storage. This is only used when sharding is # enabled. This state is read when all replicas for a shard can not be diff --git a/pkg/alertmanager/alertmanager_client.go b/pkg/alertmanager/alertmanager_client.go index e95d8708ae1..e75eeda2d06 100644 --- a/pkg/alertmanager/alertmanager_client.go +++ b/pkg/alertmanager/alertmanager_client.go @@ -34,15 +34,17 @@ type Client interface { // ClientConfig is the configuration struct for the alertmanager client. type ClientConfig struct { - RemoteTimeout time.Duration `yaml:"remote_timeout"` - TLSEnabled bool `yaml:"tls_enabled"` - TLS tls.ClientConfig `yaml:",inline"` + RemoteTimeout time.Duration `yaml:"remote_timeout"` + TLSEnabled bool `yaml:"tls_enabled"` + TLS tls.ClientConfig `yaml:",inline"` + GRPCCompression string `yaml:"grpc_compression"` } // RegisterFlagsWithPrefix registers flags with prefix. func (cfg *ClientConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) { f.BoolVar(&cfg.TLSEnabled, prefix+".tls-enabled", cfg.TLSEnabled, "Enable TLS in the GRPC client. This flag needs to be enabled when any other TLS flag is set. If set to false, insecure connection to gRPC server will be used.") f.DurationVar(&cfg.RemoteTimeout, prefix+".remote-timeout", 2*time.Second, "Timeout for downstream alertmanagers.") + f.StringVar(&cfg.GRPCCompression, prefix+".grpc-compression", "", "Use compression when sending messages. Supported values are: 'gzip', 'snappy' and '' (disable compression)") cfg.TLS.RegisterFlagsWithPrefix(prefix, f) } @@ -55,7 +57,7 @@ func newAlertmanagerClientsPool(discovery client.PoolServiceDiscovery, amClientC grpcCfg := grpcclient.Config{ MaxRecvMsgSize: 16 * 1024 * 1024, MaxSendMsgSize: 4 * 1024 * 1024, - GRPCCompression: "", + GRPCCompression: amClientCfg.GRPCCompression, RateLimit: 0, RateLimitBurst: 0, BackoffOnRatelimits: false, diff --git a/pkg/querier/store_gateway_client.go b/pkg/querier/store_gateway_client.go index b84a87846c1..6800fc03824 100644 --- a/pkg/querier/store_gateway_client.go +++ b/pkg/querier/store_gateway_client.go @@ -72,7 +72,7 @@ func newStoreGatewayClientPool(discovery client.PoolServiceDiscovery, clientConf clientCfg := grpcclient.Config{ MaxRecvMsgSize: 100 << 20, MaxSendMsgSize: 16 << 20, - GRPCCompression: "", + GRPCCompression: clientConfig.GRPCCompression, RateLimit: 0, RateLimitBurst: 0, BackoffOnRatelimits: false, @@ -96,11 +96,13 @@ func newStoreGatewayClientPool(discovery client.PoolServiceDiscovery, clientConf } type ClientConfig struct { - TLSEnabled bool `yaml:"tls_enabled"` - TLS tls.ClientConfig `yaml:",inline"` + TLSEnabled bool `yaml:"tls_enabled"` + TLS tls.ClientConfig `yaml:",inline"` + GRPCCompression string `yaml:"grpc_compression"` } func (cfg *ClientConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) { f.BoolVar(&cfg.TLSEnabled, prefix+".tls-enabled", cfg.TLSEnabled, "Enable TLS for gRPC client connecting to store-gateway.") + f.StringVar(&cfg.GRPCCompression, prefix+".grpc-compression", "", "Use compression when sending messages. Supported values are: 'gzip', 'snappy' and '' (disable compression)") cfg.TLS.RegisterFlagsWithPrefix(prefix, f) }