Commit c138b04c by bergquist

feat(alerting): avoid double logging

parent ff5d4e8e
...@@ -3,6 +3,8 @@ package alerting ...@@ -3,6 +3,8 @@ package alerting
import ( import (
"errors" "errors"
"fmt"
"github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/log" "github.com/grafana/grafana/pkg/log"
...@@ -104,8 +106,8 @@ func (e *DashAlertExtractor) GetAlerts() ([]*m.Alert, error) { ...@@ -104,8 +106,8 @@ func (e *DashAlertExtractor) GetAlerts() ([]*m.Alert, error) {
panelQuery := findPanelQueryByRefId(panel, queryRefId) panelQuery := findPanelQueryByRefId(panel, queryRefId)
if panelQuery == nil { if panelQuery == nil {
e.log.Error("Query not found", "panel", alert.PanelId, "queryRefId", queryRefId) reason := fmt.Sprintf("Alert on PanelId: %v refers to query(%s) that cannot be found", alert.PanelId, queryRefId)
return nil, ValidationError{Reason: "Alert refers to query that cannot be found"} return nil, ValidationError{Reason: reason}
} }
dsName := "" dsName := ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment