diff --git a/pkg/cmd/grafana-server/main.go b/pkg/cmd/grafana-server/main.go index 4551860a680..3a863cee50d 100644 --- a/pkg/cmd/grafana-server/main.go +++ b/pkg/cmd/grafana-server/main.go @@ -25,6 +25,7 @@ import ( _ "github.com/grafana/grafana/pkg/tsdb/mqe" _ "github.com/grafana/grafana/pkg/tsdb/mysql" _ "github.com/grafana/grafana/pkg/tsdb/opentsdb" + _ "github.com/grafana/grafana/pkg/tsdb/prometheus" _ "github.com/grafana/grafana/pkg/tsdb/testdata" ) diff --git a/pkg/services/alerting/engine.go b/pkg/services/alerting/engine.go index adaafd776ef..b1fc8fe2519 100644 --- a/pkg/services/alerting/engine.go +++ b/pkg/services/alerting/engine.go @@ -132,6 +132,15 @@ func (e *Engine) processJob(grafanaCtx context.Context, job *Job) error { span.SetTag("alertId", evalContext.Rule.Id) span.SetTag("dashboardId", evalContext.Rule.DashboardId) span.SetTag("firing", evalContext.Firing) + span.SetTag("no_data", evalContext.NoDataFound) + if evalContext.Error != nil { + ext.Error.Set(span, true) + span.LogFields( + tlog.Error(evalContext.Error), + tlog.String("message", "alerting execution failed"), + ) + } + span.Finish() close(done) }()