mirror of
https://github.com/samber/awesome-prometheus-alerts.git
synced 2026-06-23 18:06:58 +08:00
feat: adding instruction for recording rules
This commit is contained in:
parent
0207783284
commit
19d2bd565d
1 changed files with 27 additions and 0 deletions
|
|
@ -99,6 +99,33 @@ receivers:
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
|
## Reduce Prometheus server load
|
||||||
|
|
||||||
|
For expansive or frequent PromQL queries, Prometheus allows to precompute rules.
|
||||||
|
|
||||||
|
{% highlight yaml %}
|
||||||
|
{% raw %}
|
||||||
|
groups:
|
||||||
|
|
||||||
|
# first define the recording rule
|
||||||
|
- name: ExampleRecordingGroup
|
||||||
|
rules:
|
||||||
|
- record: job:rabbitmq_queue_messages_delivered_total:rate:5m
|
||||||
|
expr: rate(rabbitmq_queue_messages_delivered_total[5m])
|
||||||
|
|
||||||
|
# then use it in alerts
|
||||||
|
- name: ExampleAlertingGroup
|
||||||
|
rules:
|
||||||
|
- alert: ExampleRabbitmqLowMessageDelivery
|
||||||
|
expr: sum(job:rabbitmq_queue_messages_delivered_total:rate:5m) < 10
|
||||||
|
for: 2m
|
||||||
|
labels:
|
||||||
|
severity: critical
|
||||||
|
annotations:
|
||||||
|
summary: "Low delivery rate in Rabbitmq queues"
|
||||||
|
{% endraw %}
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
If the notification takes too much time to be triggered, check the following delays:
|
If the notification takes too much time to be triggered, check the following delays:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue