Merge branch 'master' into alert_state
This commit is contained in:
@@ -21,6 +21,7 @@ type WebdavUploader struct {
|
||||
}
|
||||
|
||||
var netTransport = &http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
Dial: (&net.Dialer{
|
||||
Timeout: 60 * time.Second,
|
||||
}).Dial,
|
||||
|
||||
@@ -69,6 +69,11 @@ func (this *EmailNotifier) Notify(evalContext *alerting.EvalContext) error {
|
||||
return err
|
||||
}
|
||||
|
||||
error := ""
|
||||
if evalContext.Error != nil {
|
||||
error = evalContext.Error.Error()
|
||||
}
|
||||
|
||||
cmd := &m.SendEmailCommandSync{
|
||||
SendEmailCommand: m.SendEmailCommand{
|
||||
Subject: evalContext.GetNotificationTitle(),
|
||||
@@ -78,6 +83,7 @@ func (this *EmailNotifier) Notify(evalContext *alerting.EvalContext) error {
|
||||
"Name": evalContext.Rule.Name,
|
||||
"StateModel": evalContext.GetStateModel(),
|
||||
"Message": evalContext.Rule.Message,
|
||||
"Error": error,
|
||||
"RuleUrl": ruleUrl,
|
||||
"ImageLink": "",
|
||||
"EmbededImage": "",
|
||||
|
||||
@@ -2,6 +2,7 @@ package alerting
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
"github.com/grafana/grafana/pkg/components/null"
|
||||
@@ -56,7 +57,7 @@ func createTestEvalContext(cmd *NotificationTestCommand) *EvalContext {
|
||||
}
|
||||
ctx.IsTestRun = true
|
||||
ctx.Firing = true
|
||||
ctx.Error = nil
|
||||
ctx.Error = fmt.Errorf("This is only a test")
|
||||
ctx.EvalMatches = evalMatchesBasedOnState()
|
||||
|
||||
return ctx
|
||||
|
||||
@@ -194,6 +194,8 @@ func (e MysqlExecutor) getTypedRowData(types []*sql.ColumnType, rows *core.Rows)
|
||||
values[i] = new(string)
|
||||
case mysql.FieldTypeNameVarChar:
|
||||
values[i] = new(string)
|
||||
case mysql.FieldTypeNameLong:
|
||||
values[i] = new(int)
|
||||
case mysql.FieldTypeNameLongLong:
|
||||
values[i] = new(int64)
|
||||
case mysql.FieldTypeNameDouble:
|
||||
|
||||
Reference in New Issue
Block a user