diff --git a/docs/guides/rule-evaluations-via-query-frontend.md b/docs/guides/rule-evaluations-via-query-frontend.md new file mode 100644 index 00000000000..caa3006c17f --- /dev/null +++ b/docs/guides/rule-evaluations-via-query-frontend.md @@ -0,0 +1,63 @@ +--- +title: "Rule evaluations via query frontend" +linkTitle: "Rule evaluations via query frontend" +weight: 10 +slug: rule-evalutions-via-query-frontend +--- + +This guide explains how to configure the Ruler to evaluate rules via Query Frontends instead of the Ingesters and the pros and cons of rule evaluation via Query Frontend. + +## How to enable + +By default, the Ruler queries to the Ingesters for evaluating rules (alerting rules or recording rules). If you have set `-ruler.frontend-address` then the Ruler query to the Query Frontend for evaluation rules. +The address should be the gRPC listen address in host:port format. + +You can configure via args: +``` +-ruler.frontend-address=query-frontend.svc.cluster.local:9095 +``` +And via yaml: +```yaml +ruler: + frontend_address: query-frontend.svc.cluster.local:9095 +``` + +In addition, you can configure gRPC client (Ruler -> Query Frontend) config via args: +``` +-ruler.frontendClient.grpc-max-recv-msg-size=104857600 +-ruler.frontendClient.grpc-max-send-msg-size=16777216 +-ruler.frontendClient.grpc-compression="" +-ruler.frontendClient.grpc-client-rate-limit=0 +-ruler.frontendClient.grpc-client-rate-limit-burst=0 +-ruler.frontendClient.backoff-on-ratelimits=false +-ruler.frontendClient.backoff-min-period=100ms +-ruler.frontendClient.backoff-max-period=10s +-ruler.frontendClient.backoff-retries=10 +``` + +And via yaml: + +```yaml +ruler: + frontend_client: + max_recv_msg_size: 104857600 + max_send_msg_size: 16777216 + grpc_compression: "" + rate_limit: 0 + rate_limit_burst: | default = 0 + backoff_on_ratelimits: | default = false + backoff_config: + min_period: 100ms + max_period: 10s + max_retries: 10 +``` + +## Pros and Cons + +### Pros +The rule evaluation performance is improved as we can use Query Frontend features like the vertical query sharding. +The ruler can use fewer resources as it doesn't need to initialize the querier anymore. + +### Cons +Currently, the only support format of the query response of the Query Frontend is the JSON format. The JSON format only contains partial information of the native histogram. +So, if your rules use the native histogram, it is not allowed yet. \ No newline at end of file