Alerting: Add clean_upgrade config and deprecate force_migration (#78324)
* Alerting: Add clean_upgrade config and deprecate force_migration Upgrading to UA and rolling back will no longer delete any data by default. Instead, each set of tables will remain unchanged when switching between legacy and UA. As such, the force_migration config has been deprecated and no extra configuration is required to roll back to legacy anymore. If clean_upgrade is set to true when upgrading from legacy alerting to Unified Alerting, grafana will first delete all existing Unified Alerting resources, thus re-upgrading all organizations from scratch. If false or unset, organizations that have previously upgraded will not lose their existing Unified Alerting data when switching between legacy and Unified Alerting. Similar to force_migration, it should be kept false when not needed as it may cause unintended data-loss if left enabled. --------- Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
This commit is contained in:
co-authored by
Christopher Moyer
parent
0f0249abea
commit
5a80962de9
@@ -23,7 +23,7 @@ Existing installations that do not use legacy alerting will have Grafana Alertin
|
||||
|
||||
Likewise, existing installations that use legacy alerting will be automatically upgraded to Grafana Alerting unless you have opted out of Grafana Alerting before migration takes place. During the upgrade, legacy alerts are migrated to the new alerts type and no alerts or alerting data are lost.
|
||||
|
||||
Once the upgrade has taken place, you still have the option to roll back to legacy alerting. However, we do not recommend choosing this option. If you do choose to roll back, Grafana will restore your alerts to the alerts you had at the point in time when the upgrade took place. All new alerts and changes made exclusively in Grafana Alerting will be deleted.
|
||||
Once the upgrade has taken place, you still have the option to roll back to legacy alerting. However, we do not recommend choosing this option. If you do choose to roll back, Grafana will restore your alerts to the alerts you had at the point in time when the upgrade took place.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Cloud customers, who do not want to upgrade to Grafana Alerting, should contact customer support.
|
||||
@@ -91,13 +91,9 @@ If you want to turn alerting back on, you can remove both flags to enable Grafan
|
||||
|
||||
Once the upgrade has taken place, you still have the option to roll back to legacy alerting. If you choose to roll back, Grafana will restore your alerts to the alerts you had at the point in time when the upgrade took place.
|
||||
|
||||
All new alerts and changes made exclusively in Grafana Alerting will be deleted.
|
||||
|
||||
To roll back to legacy alerting, enter the following in your configuration:
|
||||
|
||||
```toml
|
||||
force_migration = true
|
||||
|
||||
[alerting]
|
||||
enabled = true
|
||||
|
||||
@@ -105,7 +101,14 @@ enabled = true
|
||||
enabled = false
|
||||
```
|
||||
|
||||
> **Note**: We do not recommend this option. If you choose to roll back, Grafana will restore your alerts to the alerts you had at the point in time when the upgrade took place. All new alerts and changes made exclusively in Grafana Alerting will be deleted.
|
||||
> **Note**: The next time you upgrade to Grafana Alerting, Grafana will restore your Grafana Alerting alerts and configuration to those you had before rolling back.
|
||||
|
||||
If, after rolling back, you wish to delete any existing Grafana Alerting configuration and upgrade your legacy alerting configuration again from scratch, you can enable the `clean_upgrade` option:
|
||||
|
||||
```toml
|
||||
[unified_alerting.upgrade]
|
||||
clean_upgrade = true
|
||||
```
|
||||
|
||||
## Opt in
|
||||
|
||||
|
||||
@@ -148,11 +148,19 @@ Options are `production` and `development`. Default is `production`. _Do not_ ch
|
||||
Set the name of the grafana-server instance. Used in logging, internal metrics, and clustering info. Defaults to: `${HOSTNAME}`, which will be replaced with
|
||||
environment variable `HOSTNAME`, if that is empty or does not exist Grafana will try to use system calls to get the machine name.
|
||||
|
||||
### force_migration
|
||||
## force_migration
|
||||
|
||||
Force migration will run migrations that might cause data loss. Default is `false`.
|
||||
{{% admonition type="note" %}}
|
||||
This option is deprecated - [See `clean_upgrade` option]({{< relref "#clean_upgrade" >}}) instead.
|
||||
{{% /admonition %}}
|
||||
|
||||
Set force_migration=true in your grafana.ini and restart Grafana to roll back and delete Unified Alerting configuration data. Any alert rules created while using Unified Alerting will be deleted by rolling back.
|
||||
When you restart Grafana to rollback from Grafana Alerting to legacy alerting, delete any existing Grafana Alerting data, such as alert rules, contact points, and notification policies. Default is `false`.
|
||||
|
||||
If `false` or unset, existing Grafana Alerting data is not changed or deleted when rolling back to legacy alerting.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
It should be kept false or unset when not needed, as it may cause unintended data loss if left enabled.
|
||||
{{% /admonition %}}
|
||||
|
||||
<hr />
|
||||
|
||||
@@ -1489,7 +1497,7 @@ For more information about the Grafana alerts, refer to [About Grafana Alerting]
|
||||
|
||||
### enabled
|
||||
|
||||
Enable or disable Grafana Alerting. If disabled, all your legacy alerting data will be available again, but the data you created using Grafana Alerting will be deleted. Set force_migration=true to avoid deletion of data. The default value is `true`.
|
||||
Enable or disable Grafana Alerting. If disabled, all your legacy alerting data will be available again. The default value is `true`.
|
||||
|
||||
Alerting Rules migrated from dashboards and panels will include a link back via the `annotations`.
|
||||
|
||||
@@ -1629,6 +1637,22 @@ For example: `disabled_labels=grafana_folder`
|
||||
|
||||
<hr>
|
||||
|
||||
## [unified_alerting.upgrade]
|
||||
|
||||
For more information about upgrading to Grafana Alerting, refer to [Upgrade Alerting](/docs/grafana/next/alerting/set-up/migrating-alerts/).
|
||||
|
||||
### clean_upgrade
|
||||
|
||||
When you restart Grafana to upgrade from legacy alerting to Grafana Alerting, delete any existing Grafana Alerting data from a previous upgrade, such as alert rules, contact points, and notification policies. Default is `false`.
|
||||
|
||||
If `false` or unset, existing Grafana Alerting data is not changed or deleted when you switch between legacy and Unified Alerting.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
It should be kept false when not needed, as it may cause unintended data loss if left enabled.
|
||||
{{% /admonition %}}
|
||||
|
||||
<hr>
|
||||
|
||||
## [alerting]
|
||||
|
||||
For more information about the legacy dashboard alerting feature in Grafana, refer to [the legacy Grafana alerts](/docs/grafana/v8.5/alerting/old-alerting/).
|
||||
|
||||
Reference in New Issue
Block a user