Alerting: Add more clear error to migration when rule cannot be parsed (#72374)

This commit is contained in:
Yuri Tseretyan 2023-07-27 09:47:04 -04:00 committed by GitHub
parent 758d9884bc
commit 143683bd05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,8 @@ func (m *migration) slurpDashAlerts() ([]dashAlert, error) {
for i := range dashAlerts {
err = json.Unmarshal(dashAlerts[i].Settings, &dashAlerts[i].ParsedSettings)
if err != nil {
return nil, err
da := dashAlerts[i]
return nil, fmt.Errorf("failed to parse alert rule ID:%d, name:'%s', orgID:%d: %w", da.Id, da.Name, da.OrgId, err)
}
}