mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 11:12:58 +08:00
feat(alerting): avoid double logging
This commit is contained in:
@ -3,6 +3,8 @@ package alerting
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"fmt"
|
||||
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
"github.com/grafana/grafana/pkg/log"
|
||||
@ -104,8 +106,8 @@ func (e *DashAlertExtractor) GetAlerts() ([]*m.Alert, error) {
|
||||
panelQuery := findPanelQueryByRefId(panel, queryRefId)
|
||||
|
||||
if panelQuery == nil {
|
||||
e.log.Error("Query not found", "panel", alert.PanelId, "queryRefId", queryRefId)
|
||||
return nil, ValidationError{Reason: "Alert refers to query that cannot be found"}
|
||||
reason := fmt.Sprintf("Alert on PanelId: %v refers to query(%s) that cannot be found", alert.PanelId, queryRefId)
|
||||
return nil, ValidationError{Reason: reason}
|
||||
}
|
||||
|
||||
dsName := ""
|
||||
|
Reference in New Issue
Block a user