Alerting: Allow selection of recording rule write target on per-rule basis. (#101778)

* Alerting: Allow selection of recording rule write target on per-rule basis.

Introduces a new feature flag (`grafanaManagedRecordingRulesDatasources`),
disabled by default, to enable the ability to write recording rules data using
data source settings, and selecting the data source to use on a per-rule basis.

To cope with the scenario of users upgrading, a configuration file option
allows setting the default data source to use, if none is specified in the rule,
emulating the behaviour of recording rules without the flag enabled.

* Lint

* Update conf/sample.ini

Co-authored-by: Alexander Akhmetov <me@alx.cx>

---------

Co-authored-by: Alexander Akhmetov <me@alx.cx>
This commit is contained in:
Steve Simpson
2025-03-07 14:30:40 +01:00
committed by GitHub
co-authored by Alexander Akhmetov
parent 5917ed8227
commit 14ebec527c
9 changed files with 76 additions and 14 deletions
+7
View File
@@ -1505,6 +1505,13 @@ basic_auth_password =
# Request timeout for recording rule writes.
timeout = 30s
# Default data source UID to write to if not specified in the rule definition.
# Only has effect if the grafanaManagedRecordRulesDatasources feature toggle is enabled.
default_datasource_uid =
# Suffix to apply to the data source URL for remote write requests.
remote_write_path_suffix = /push
# Optional custom headers to include in recording rule write requests.
[recording_rules.custom_headers]
# exampleHeader = exampleValue