mirror of
https://github.com/prometheus/prometheus.git
synced 2026-01-19 15:41:11 +01:00
* Optimise concurrent rule evaluation for rules querying ALERTS and ALERTS_FOR_STATE Signed-off-by: Marco Pracucci <marco@pracucci.com> * Further optimised the case of ALERTS and ALERTS_FOR_STATE without alertname label matcher Signed-off-by: Marco Pracucci <marco@pracucci.com> --------- Signed-off-by: Marco Pracucci <marco@pracucci.com>
21 lines
732 B
YAML
21 lines
732 B
YAML
groups:
|
|
- name: test
|
|
rules:
|
|
# independents
|
|
- record: job:http_requests:rate1m
|
|
expr: sum by (job)(rate(http_requests_total[1m]))
|
|
- record: job:http_requests:rate5m
|
|
expr: sum by (job)(rate(http_requests_total[5m]))
|
|
|
|
# dependents because of metric is matching
|
|
- record: job:http_requests:rate15m
|
|
expr: sum by (job)(rate(http_requests_total[15m]))
|
|
- record: TooManyRequests
|
|
expr: job:http_requests:rate15m > 100
|
|
|
|
# dependents because of ALERTS is matching
|
|
- alert: TooManyFailures
|
|
expr: sum by (job)(rate(http_requests_failed_total[1m])) > 100
|
|
- alert: TooManyFailuresAlerts
|
|
expr: count(ALERTS{alertname="TooManyFailures"}) > 5
|