From 1289791a6ce1217b1e44bb520160325dd5dc7c8a Mon Sep 17 00:00:00 2001 From: Charles Korn Date: Wed, 12 Apr 2023 11:23:38 +1000 Subject: [PATCH 1/2] Enable protobuf query result payload format by default for rule evaluation path. --- cmd/mimir/config-descriptor.json | 5 ++--- cmd/mimir/help-all.txt.tmpl | 2 +- cmd/mimir/help.txt.tmpl | 2 ++ .../mimir/references/configuration-parameters/index.md | 6 +++--- pkg/ruler/remotequerier.go | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cmd/mimir/config-descriptor.json b/cmd/mimir/config-descriptor.json index 23365538a58..d2303b3dd14 100644 --- a/cmd/mimir/config-descriptor.json +++ b/cmd/mimir/config-descriptor.json @@ -10087,10 +10087,9 @@ "required": false, "desc": "Format to use when retrieving query results from query-frontends. Supported values: json, protobuf", "fieldValue": null, - "fieldDefaultValue": "json", + "fieldDefaultValue": "protobuf", "fieldFlag": "ruler.query-frontend.query-result-response-format", - "fieldType": "string", - "fieldCategory": "experimental" + "fieldType": "string" } ], "fieldValue": null, diff --git a/cmd/mimir/help-all.txt.tmpl b/cmd/mimir/help-all.txt.tmpl index af8fb9feff5..2dc34484ab6 100644 --- a/cmd/mimir/help-all.txt.tmpl +++ b/cmd/mimir/help-all.txt.tmpl @@ -2116,7 +2116,7 @@ Usage of ./cmd/mimir/mimir: -ruler.query-frontend.grpc-client-config.tls-server-name string Override the expected name on the server certificate. -ruler.query-frontend.query-result-response-format string - [experimental] Format to use when retrieving query results from query-frontends. Supported values: json, protobuf (default "json") + Format to use when retrieving query results from query-frontends. Supported values: json, protobuf (default "protobuf") -ruler.query-stats-enabled Report the wall time for ruler queries to complete as a per-tenant metric and as an info level log message. -ruler.recording-rules-evaluation-enabled diff --git a/cmd/mimir/help.txt.tmpl b/cmd/mimir/help.txt.tmpl index 53ac746b9fd..c7b9fe19640 100644 --- a/cmd/mimir/help.txt.tmpl +++ b/cmd/mimir/help.txt.tmpl @@ -583,6 +583,8 @@ Usage of ./cmd/mimir/mimir: Maximum number of rules per rule group per-tenant. 0 to disable. (default 20) -ruler.query-frontend.address string GRPC listen address of the query-frontend(s). Must be a DNS address (prefixed with dns:///) to enable client side load balancing. + -ruler.query-frontend.query-result-response-format string + Format to use when retrieving query results from query-frontends. Supported values: json, protobuf (default "protobuf") -ruler.ring.consul.hostname string Hostname and port of Consul. (default "localhost:8500") -ruler.ring.etcd.endpoints string diff --git a/docs/sources/mimir/references/configuration-parameters/index.md b/docs/sources/mimir/references/configuration-parameters/index.md index 2965ebab5b6..745437a0b44 100644 --- a/docs/sources/mimir/references/configuration-parameters/index.md +++ b/docs/sources/mimir/references/configuration-parameters/index.md @@ -1590,10 +1590,10 @@ query_frontend: # ruler.query-frontend.grpc-client-config [grpc_client_config: ] - # (experimental) Format to use when retrieving query results from - # query-frontends. Supported values: json, protobuf + # Format to use when retrieving query results from query-frontends. Supported + # values: json, protobuf # CLI flag: -ruler.query-frontend.query-result-response-format - [query_result_response_format: | default = "json"] + [query_result_response_format: | default = "protobuf"] tenant_federation: # Enable rule groups to query against multiple tenants. The tenant IDs diff --git a/pkg/ruler/remotequerier.go b/pkg/ruler/remotequerier.go index 2887830f069..6162d263d78 100644 --- a/pkg/ruler/remotequerier.go +++ b/pkg/ruler/remotequerier.go @@ -61,7 +61,7 @@ type QueryFrontendConfig struct { // GRPCClientConfig contains gRPC specific config options. GRPCClientConfig grpcclient.Config `yaml:"grpc_client_config" doc:"description=Configures the gRPC client used to communicate between the rulers and query-frontends."` - QueryResultResponseFormat string `yaml:"query_result_response_format" category:"experimental"` + QueryResultResponseFormat string `yaml:"query_result_response_format"` } func (c *QueryFrontendConfig) RegisterFlags(f *flag.FlagSet) { @@ -73,7 +73,7 @@ func (c *QueryFrontendConfig) RegisterFlags(f *flag.FlagSet) { c.GRPCClientConfig.RegisterFlagsWithPrefix("ruler.query-frontend.grpc-client-config", f) - f.StringVar(&c.QueryResultResponseFormat, "ruler.query-frontend.query-result-response-format", formatJSON, fmt.Sprintf("Format to use when retrieving query results from query-frontends. Supported values: %s", strings.Join(allFormats, ", "))) + f.StringVar(&c.QueryResultResponseFormat, "ruler.query-frontend.query-result-response-format", formatProtobuf, fmt.Sprintf("Format to use when retrieving query results from query-frontends. Supported values: %s", strings.Join(allFormats, ", "))) } func (c *QueryFrontendConfig) Validate() error { From 5a730416684bf0765a3b2e999c66ad07553684c7 Mon Sep 17 00:00:00 2001 From: Charles Korn Date: Wed, 12 Apr 2023 11:26:09 +1000 Subject: [PATCH 2/2] Add changelog entry and update experimental features list in docs. --- CHANGELOG.md | 2 +- docs/sources/mimir/configure/about-versioning.md | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c655f0dcd12..0fc035a9253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ * [CHANGE] Ingester: the configuration parameter `-blocks-storage.tsdb.max-tsdb-opening-concurrency-on-startup` has been deprecated and will be removed in Mimir 2.10. #4445 * [CHANGE] Query-frontend: Cached results now contain timestamp which allows Mimir to check if cached results are still valid based on current TTL configured for tenant. Results cached by previous Mimir version are used until they expire from cache, which can take up to 7 days. If you need to use per-tenant TTL sooner, please flush results cache manually. #4439 * [CHANGE] Ingester: the `cortex_ingester_tsdb_wal_replay_duration_seconds` metrics has been removed. #4465 -* [CHANGE] Query-frontend: use protobuf internal query result payload format by default. This feature is no longer considered experimental. #4557 +* [CHANGE] Query-frontend and ruler: use protobuf internal query result payload format by default. This feature is no longer considered experimental. #4557 #4709 * [CHANGE] Ruler: reject creating federated rule groups while tenant federation is disabled. Previously the rule groups would be silently dropped during bucket sync. #4555 * [CHANGE] Compactor: the `/api/v1/upload/block/{block}/finish` endpoint now returns a `429` status code when the compactor has reached the limit specified by `-compactor.max-block-upload-validation-concurrency`. #4598 * [CHANGE] Store-gateway: cache key format for expanded postings has changed. This will invalidate the expanded postings in the index cache when deployed. #4667 diff --git a/docs/sources/mimir/configure/about-versioning.md b/docs/sources/mimir/configure/about-versioning.md index 837ac2fc6b7..b375e4d8733 100644 --- a/docs/sources/mimir/configure/about-versioning.md +++ b/docs/sources/mimir/configure/about-versioning.md @@ -117,8 +117,6 @@ The following features are currently experimental: - `-max-separate-metrics-groups-per-user` - Overrides-exporter - Peer discovery / tenant sharding for overrides exporters (`-overrides-exporter.ring.enabled`) -- Protobuf internal query result payload format for rule evaluation (`-ruler.query-frontend.query-result-response-format=protobuf`) - - Note that using the protobuf format for the query path (`-query-frontend.query-result-response-format=protobuf`) is not considered experimental - Per-tenant Results cache TTL (`-query-frontend.results-cache-ttl`, `-query-frontend.results-cache-ttl-for-out-of-order-time-window`) - Fetching TLS secrets from Vault for various clients (`-vault.enabled`)