diff --git a/conf/defaults.ini b/conf/defaults.ini index 4457cee9dba..f21b0ea8ee9 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -1299,6 +1299,17 @@ loki_basic_auth_password = # ex. # mylabelkey = mylabelvalue +[unified_alerting.state_history.annotations] +# Controls retention of annotations automatically created while evaluating alert rules. +# Alert state history backend must be configured to be annotations (see setting [unified_alerting.state_history].backend). + +# Configures how long alert annotations are stored for. Default is 0, which keeps them forever. +# This setting should be expressed as a duration. Ex 6h (hours), 10d (days), 2w (weeks), 1M (month). +max_age = + +# Configures max number of alert annotations that Grafana stores. Default value is 0, which keeps all alert annotations. +max_annotations_to_keep = + [unified_alerting.upgrade] # If 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 @@ -1360,9 +1371,11 @@ min_interval_seconds = 1 # Configures for how long alert annotations are stored. Default is 0, which keeps them forever. # This setting should be expressed as an duration. Ex 6h (hours), 10d (days), 2w (weeks), 1M (month). +# Deprecated, use [annotations.alerting].max_age instead max_annotation_age = # Configures max number of alert annotations that Grafana stores. Default value is 0, which keeps all alert annotations. +# Deprecated, use [annotations.alerting].max_annotations_to_keep instead max_annotations_to_keep = #################################### Annotations ######################### diff --git a/conf/sample.ini b/conf/sample.ini index ad4f8569fd6..e153c17c2ac 100644 --- a/conf/sample.ini +++ b/conf/sample.ini @@ -1194,6 +1194,17 @@ # Any number of label key-value-pairs can be provided. ; mylabelkey = mylabelvalue +[unified_alerting.state_history.annotations] +# This section controls retention of annotations automatically created while evaluating alert rules +# when alerting state history backend is configured to be annotations (a setting [unified_alerting.state_history].backend + +# Configures for how long alert annotations are stored. Default is 0, which keeps them forever. +# This setting should be expressed as an duration. Ex 6h (hours), 10d (days), 2w (weeks), 1M (month). +max_age = + +# Configures max number of alert annotations that Grafana stores. Default value is 0, which keeps all alert annotations. +max_annotations_to_keep = + [unified_alerting.upgrade] # If 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 @@ -1233,9 +1244,11 @@ # Configures for how long alert annotations are stored. Default is 0, which keeps them forever. # This setting should be expressed as a duration. Examples: 6h (hours), 10d (days), 2w (weeks), 1M (month). +# Deprecated, use [annotations.alerting].max_age instead ;max_annotation_age = # Configures max number of alert annotations that Grafana stores. Default value is 0, which keeps all alert annotations. +# Deprecated, use [annotations.alerting].max_annotations_to_keep instead ;max_annotations_to_keep = #################################### Annotations ######################### diff --git a/docs/sources/setup-grafana/configure-grafana/_index.md b/docs/sources/setup-grafana/configure-grafana/_index.md index 30a55bf5abf..a7ddce0e8ca 100644 --- a/docs/sources/setup-grafana/configure-grafana/_index.md +++ b/docs/sources/setup-grafana/configure-grafana/_index.md @@ -1654,6 +1654,20 @@ For example: `disabled_labels=grafana_folder`