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