feat(alerting): fixed graphite log issue

This commit is contained in:
Torkel Ödegaard 2016-06-07 13:47:22 +02:00
parent 0667d73660
commit 0d9c9526b9
2 changed files with 6 additions and 3 deletions

View File

@ -92,7 +92,7 @@ func (e *Engine) executeJob(job *AlertJob) {
case result := <-resultChan:
result.Duration = float64(time.Since(now).Nanoseconds()) / float64(1000000)
e.log.Debug("Job Execution done", "time_taken", result.Duration, "ruleId", job.Rule.Id)
e.log.Debug("Job Execution done", "timeTakenMs", result.Duration, "ruleId", job.Rule.Id)
e.resultQueue <- result
}
}

View File

@ -7,8 +7,8 @@ import (
"net/url"
"time"
"github.com/Unknwon/log"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/tsdb"
)
@ -20,7 +20,10 @@ func NewGraphiteExecutor(dsInfo *tsdb.DataSourceInfo) tsdb.Executor {
return &GraphiteExecutor{dsInfo}
}
var glog log.Logger
func init() {
glog = log.New("tsdb.graphite")
tsdb.RegisterExecutor("graphite", NewGraphiteExecutor)
}
@ -57,7 +60,7 @@ func (e *GraphiteExecutor) Execute(queries tsdb.QuerySlice, context *tsdb.QueryC
var data []TargetResponseDTO
err = json.Unmarshal(body, &data)
if err != nil {
log.Info("Error: %v", string(body))
glog.Info("Failed to unmarshal graphite response", "error", err)
result.Error = err
return result
}