Docs: add section about periodic state saving for alerting (#81244)

This commit is contained in:
Jean-Philippe Quéméner 2024-01-25 17:05:58 +01:00 committed by GitHub
parent 7d0017f3f2
commit 25dd8d5ceb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,3 +55,15 @@ Grafana cannot be used to receive external alerts. You can only send alerts to t
You have the option to send Grafana managed alerts to an external Alertmanager, you can find this option in the admin tab on the Alerting page.
For more information, refer to [this GitHub discussion](https://github.com/grafana/grafana/discussions/45773).
## High load on database caused by a high number of alert instances
If you have a high number of alert instances, it can happen that the load on the database gets very high, as each state
transition of an alert instance will be saved in the database.
This can be prevented by writing to the database periodically. For this the feature flag `alertingSaveStatePeriodic` needs
to be enabled. By default it will save the states every 5 minutes to the database and on each shutdown. The periodic interval
can also be configured using the `state_periodic_save_interval` configuration flag.
The time it takes to write to the database periodically can be monitored using the `state_full_sync_duration_seconds` metric
that is exposed by Grafana.