mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Add trace ID to log lines emitted during rule evaluation
Signed-off-by: Charles Korn <charles.korn@grafana.com>
This commit is contained in:
parent
fc132a4557
commit
667a1efb04
|
@ -442,6 +442,10 @@ func (g *Group) Eval(ctx context.Context, ts time.Time) {
|
||||||
rule.SetEvaluationTimestamp(t)
|
rule.SetEvaluationTimestamp(t)
|
||||||
}(time.Now())
|
}(time.Now())
|
||||||
|
|
||||||
|
if sp.SpanContext().IsSampled() && sp.SpanContext().HasTraceID() {
|
||||||
|
logger = log.WithPrefix(g.logger, "traceID", sp.SpanContext().TraceID())
|
||||||
|
}
|
||||||
|
|
||||||
g.metrics.EvalTotal.WithLabelValues(GroupKey(g.File(), g.Name())).Inc()
|
g.metrics.EvalTotal.WithLabelValues(GroupKey(g.File(), g.Name())).Inc()
|
||||||
|
|
||||||
vector, err := rule.Eval(ctx, ts, g.opts.QueryFunc, g.opts.ExternalURL, g.Limit())
|
vector, err := rule.Eval(ctx, ts, g.opts.QueryFunc, g.opts.ExternalURL, g.Limit())
|
||||||
|
|
Loading…
Reference in a new issue