# Labels to add or overwrite before storing the result. # time series with the metric name as given by 'record'. # evaluated at the current time, and the result recorded as a new set of The syntax for recording rules is: # The name of the time series to output to. Rules within a group are run sequentially at a regular interval. Recording and alerting rules exist in a rule group. This is especially useful for dashboards, which need to query the same expression repeatedly every time they refresh. Querying the precomputed result will then often be much faster than executing the original expression every time it is needed. Recording rules allow you to precompute frequently needed or computationally expensive expressions and save their result as a new set of time series. Thanos supports two types of rules which may be configured and then evaluated at regular intervals: recording rules and alerting rules. # How often rules in the group are evaluated. record: job:http_inprogress_requests:sumĮxpr: sum(http_inprogress_requests) by (job) Rule files use YAML, the syntax of a rule file is: groups:Ī simple example rules file would be: groups: This means that query failure are more likely to happen, that’s why clear strategy on what will happen to alert and during query unavailability is the key. For Prometheus it is unlikely to have alert/recording rule evaluation failure as evaluation is local.įor Ruler the read path is distributed, since most likely Ruler is querying Thanos Querier which gets data from remote Store APIs. The main tradeoff is its dependence on query reliability. Ruler has conceptual tradeoffs that might not be favorable for most use cases. alert.query-url "" \ # This tells what query URL to link to in UI. rule-file "/path/to/rules/*.rules.yaml" \ High-availability pairs can be run in parallel and should be distinguished by the designated replica label, just like regular Prometheus servers. The data of each Rule node can be labeled to satisfy the clusters labeling scheme. You can think of Rule as a simplified Prometheus that does not require a sidecar and does not scrape and do PromQL evaluation (no QueryAPI). It means that Thanos Rule in this mode does not expose the StoreAPI. This way, rule nodes only work as a data producer and the remote receive nodes work as source store nodes. Rule also has a stateless mode which sends rule evaluation results to some remote storages via remote write for better scalability. Rule nodes at the same time participate in the system as source store nodes, which means that they expose StoreAPI and upload their generated TSDB blocks to an object store. If more than one query is passed, round robin balancing is performed.īy default, rule evaluation results are written back to disk in the Prometheus 2.0 storage format. The thanos rule command evaluates Prometheus recording and alerting rules against chosen query API via repeated -query (or FileSD via -query.sd). The rule component should in particular not be used to circumvent solving rule deployment properly at the configuration management level. ![]() NOTE: It is recommended to keep deploying rules inside the relevant Prometheus servers locally.
0 Comments
Leave a Reply. |