Alerting: Extend recording rule definitions/interfaces with data source. (#101678)

Extend the recording rule definition to include the target data source, allowing
configuration of where the output of the recording rule is written to. Also
extends the relevant interfaces in preparation for the next set of changes.
This commit is contained in:
Steve Simpson
2025-03-06 14:09:17 +01:00
committed by GitHub
parent 13cf67de53
commit b7dcfcedcb
9 changed files with 57 additions and 9 deletions
@@ -533,6 +533,10 @@ type Record struct {
// required: true
// example: A
From string `json:"from" yaml:"from"`
// Which data source should be used to write the output of the recording rule, specified by UID.
// required: false
// example: my-prom
TargetDatasourceUID string `json:"target_datasource_uid,omitempty" yaml:"target_datasource_uid,omitempty"`
}
// swagger:model
@@ -308,6 +308,7 @@ type AlertRuleNotificationSettingsExport struct {
// Record is the provisioned export of models.Record.
type AlertRuleRecordExport struct {
Metric string `json:"metric" yaml:"metric" hcl:"metric"`
From string `json:"from" yaml:"from" hcl:"from"`
Metric string `json:"metric" yaml:"metric" hcl:"metric"`
From string `json:"from" yaml:"from" hcl:"from"`
TargetDatasourceUID *string `json:"targetDatasourceUid,omitempty" yaml:"targetDatasourceUid,omitempty" hcl:"target_datasource_uid,optional"`
}