feat(alerting): fixed graphite log issue

pull/5622/head
Torkel Ödegaard 10 years ago
parent 0667d73660
commit 0d9c9526b9
  1. 2
      pkg/services/alerting/engine.go
  2. 7
      pkg/tsdb/graphite/graphite.go

@ -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
}
}

@ -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
}

Loading…
Cancel
Save