mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Merge pull request #8603 from pracucci/add-tracing-span-to-eval
Added tracing span to evaluator.eval()
This commit is contained in:
commit
3c7d90c520
|
@ -19,6 +19,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
|
"reflect"
|
||||||
"regexp"
|
"regexp"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
|
@ -1125,6 +1126,10 @@ func (ev *evaluator) eval(expr parser.Expr) (parser.Value, storage.Warnings) {
|
||||||
}
|
}
|
||||||
numSteps := int((ev.endTimestamp-ev.startTimestamp)/ev.interval) + 1
|
numSteps := int((ev.endTimestamp-ev.startTimestamp)/ev.interval) + 1
|
||||||
|
|
||||||
|
// Create a new span to help investigate inner evaluation performances.
|
||||||
|
span, _ := opentracing.StartSpanFromContext(ev.ctx, stats.InnerEvalTime.SpanOperation()+" eval "+reflect.TypeOf(expr).String())
|
||||||
|
defer span.Finish()
|
||||||
|
|
||||||
switch e := expr.(type) {
|
switch e := expr.(type) {
|
||||||
case *parser.AggregateExpr:
|
case *parser.AggregateExpr:
|
||||||
unwrapParenExpr(&e.Param)
|
unwrapParenExpr(&e.Param)
|
||||||
|
|
Loading…
Reference in a new issue