grafana-ruler: add new alert query fields (#104933)

This commit is contained in:
Tito Lins
2025-05-07 09:30:34 +02:00
committed by GitHub
parent 8d0d48f2a8
commit a7fe77cdbf
2 changed files with 7 additions and 1 deletions

View File

@ -96,6 +96,12 @@ type AlertQuery struct {
// JSON is the raw JSON query and includes the above properties as well as custom properties.
Model json.RawMessage `json:"model"`
// DatasourceType is the type of the data source.
DatasourceType string `json:"-"`
// IsMTQuery ...
IsMTQuery bool `json:"-"`
modelProps map[string]any
}

View File

@ -469,7 +469,7 @@ func (alertRule *AlertRule) Diff(rule *AlertRule, ignore ...string) cmputil.Diff
ops = append(
ops,
cmp.Reporter(&reporter),
cmpopts.IgnoreFields(AlertQuery{}, "modelProps"),
cmpopts.IgnoreFields(AlertQuery{}, "modelProps", "DatasourceType", "IsMTQuery"),
jsonCmp,
cmpopts.EquateEmpty(),
)