mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(alerting): fixed graphite log issue
This commit is contained in:
parent
0667d73660
commit
0d9c9526b9
@ -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…
Reference in New Issue
Block a user