Commit 519fd8b2 by bergquist

graphite: adds more traces for alerting

parent f1425489
...@@ -28,12 +28,9 @@ func NewGraphiteExecutor(datasource *models.DataSource) (tsdb.TsdbQueryEndpoint, ...@@ -28,12 +28,9 @@ func NewGraphiteExecutor(datasource *models.DataSource) (tsdb.TsdbQueryEndpoint,
return &GraphiteExecutor{}, nil return &GraphiteExecutor{}, nil
} }
var ( var glog = log.New("tsdb.graphite")
glog log.Logger
)
func init() { func init() {
glog = log.New("tsdb.graphite")
tsdb.RegisterTsdbQueryEndpoint("graphite", NewGraphiteExecutor) tsdb.RegisterTsdbQueryEndpoint("graphite", NewGraphiteExecutor)
} }
...@@ -52,6 +49,7 @@ func (e *GraphiteExecutor) Query(ctx context.Context, dsInfo *models.DataSource, ...@@ -52,6 +49,7 @@ func (e *GraphiteExecutor) Query(ctx context.Context, dsInfo *models.DataSource,
} }
for _, query := range tsdbQuery.Queries { for _, query := range tsdbQuery.Queries {
glog.Info("graphite", "query", query.Model)
if fullTarget, err := query.Model.Get("targetFull").String(); err == nil { if fullTarget, err := query.Model.Get("targetFull").String(); err == nil {
target = fixIntervalFormat(fullTarget) target = fixIntervalFormat(fullTarget)
} else { } else {
...@@ -79,6 +77,9 @@ func (e *GraphiteExecutor) Query(ctx context.Context, dsInfo *models.DataSource, ...@@ -79,6 +77,9 @@ func (e *GraphiteExecutor) Query(ctx context.Context, dsInfo *models.DataSource,
span.SetTag("target", target) span.SetTag("target", target)
span.SetTag("from", from) span.SetTag("from", from)
span.SetTag("until", until) span.SetTag("until", until)
span.SetTag("datasource_id", dsInfo.Id)
span.SetTag("org_id", dsInfo.OrgId)
defer span.Finish() defer span.Finish()
opentracing.GlobalTracer().Inject( opentracing.GlobalTracer().Inject(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment