Skip to content

Commit dfd861f

Browse files
committed
Add support rule evaluation via query frontend docs
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
1 parent d829d65 commit dfd861f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: "Rule evaluations via query frontend"
3+
linkTitle: "Rule evaluations via query frontend"
4+
weight: 10
5+
slug: rule-evalutions-via-query-frontend
6+
---
7+
8+
This guide explains how to configure the Ruler to evaluate rules via Query Frontends instead of the Ingester/Store Gateway and the pros and cons of rule evaluation via Query Frontend.
9+
10+
## How to enable
11+
12+
By default, the Ruler queries both Ingesters and Store Gateway depending on the Rule time range for evaluating rules (alerting rules or recording rules). If you have set `-ruler.frontend-address` then the Ruler queries the Query Frontend for evaluation rules.
13+
The address should be the gRPC listen address in host:port format.
14+
15+
You can configure via args:
16+
```
17+
-ruler.frontend-address=query-frontend.svc.cluster.local:9095
18+
```
19+
And via yaml:
20+
```yaml
21+
ruler:
22+
frontend_address: query-frontend.svc.cluster.local:9095
23+
```
24+
25+
In addition, you can configure gRPC client (Ruler -> Query Frontend) config, please refer to frontend_client section in [ruler config](../configuration/config-file-reference.md#ruler_config).
26+
27+
## Pros and Cons
28+
If this feature is enabled, the query execute path is as follows:
29+
30+
Ruler -> Query Frontend -> Query Scheduler -> Querier -> Ingester/Store Gateway
31+
32+
There are pros and cons regarding query performance as more hops than before (Ruler -> Ingester/Store Gateway).
33+
### Pros
34+
- The rule evaluation performance could be improved in such a situation where the number of Queriers pulling queries from the Query Scheduler is good enough.
35+
If then, the queries in Query Scheduler are fetched in a reasonable time (i.e. a lof of hops are not a defect for query performance). In this environment, query performance could be improved as we can use Query Frontend features like the vertical query sharding.
36+
- The Ruler can use fewer resources as it doesn't need to run query engine to evaluate rules.
37+
38+
### Cons
39+
- If there are not enough Queriers, adding rule queries to Query Scheduler could cause query starvation problem (queries in Query Scheduler could not be fetched in a reasonable time), so rules cannot be evaluated in time.
40+
- 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.
41+
So, if your rules use the native histogram, it is not allowed yet.

0 commit comments

Comments
 (0)