Commit e1283100 by bergquist

use tags instead of logs

parent 89c86c7a
......@@ -5,7 +5,6 @@ import (
"time"
"github.com/opentracing/opentracing-go"
tlog "github.com/opentracing/opentracing-go/log"
"github.com/benbjohnson/clock"
"github.com/grafana/grafana/pkg/log"
......@@ -122,11 +121,10 @@ func (e *Engine) processJob(grafanaCtx context.Context, job *Job) error {
e.evalHandler.Eval(evalContext)
e.resultHandler.Handle(evalContext)
span.LogFields(
tlog.Int64("alertId", evalContext.Rule.Id),
tlog.Int64("dashboardId", evalContext.Rule.DashboardId),
tlog.Bool("firing", evalContext.Firing),
)
span.SetTag("alertId", evalContext.Rule.Id)
span.SetTag("dashboardId", evalContext.Rule.DashboardId)
span.SetTag("firing", evalContext.Firing)
close(done)
span.Finish()
......
......@@ -18,7 +18,6 @@ import (
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb"
opentracing "github.com/opentracing/opentracing-go"
tlog "github.com/opentracing/opentracing-go/log"
)
type GraphiteExecutor struct {
......@@ -83,11 +82,9 @@ func (e *GraphiteExecutor) Execute(ctx context.Context, queries tsdb.QuerySlice,
}
span, ctx := opentracing.StartSpanFromContext(ctx, "alerting.graphite")
span.LogFields(
tlog.String("target", target),
tlog.String("from", from),
tlog.String("until", until),
)
span.SetTag("target", target)
span.SetTag("from", from)
span.SetTag("until", until)
defer span.Finish()
opentracing.GlobalTracer().Inject(
......
......@@ -20,7 +20,6 @@ import (
"github.com/prometheus/common/model"
//api "github.com/prometheus/client_golang/api"
//apiv1 "github.com/prometheus/client_golang/api/prometheus/v1"
tlog "github.com/opentracing/opentracing-go/log"
)
type PrometheusExecutor struct {
......@@ -105,11 +104,9 @@ func (e *PrometheusExecutor) Execute(ctx context.Context, queries tsdb.QuerySlic
}
span, ctx := opentracing.StartSpanFromContext(ctx, "alerting.prometheus")
span.LogFields(
tlog.String("expr", query.Expr),
tlog.Int64("start_unixnano", int64(query.Start.UnixNano())),
tlog.Int64("stop_unixnano", int64(query.End.UnixNano())),
)
span.SetTag("expr", query.Expr)
span.SetTag("start_unixnano", int64(query.Start.UnixNano()))
span.SetTag("stop_unixnano", int64(query.End.UnixNano()))
defer span.Finish()
value, err := client.QueryRange(ctx, query.Expr, timeRange)
......
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