[v10.0.x] Alerting: (Chore/Instrumentation) Add traceID to logs with contextual logger (#71333)

Alerting: (Chore/Instrumentation) Add traceID to logs with contextual logger (#71289)

Alerting: (Chore) Add traceID to logs with contextual logger
(cherry picked from commit f6a28cadbc)

Co-authored-by: Kyle Brandt <kyle@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot]
2023-07-11 12:11:47 +03:00
committed by GitHub
co-authored by Kyle Brandt
parent f767a3e27f
commit bc1e8a7c9e
+1 -1
View File
@@ -372,7 +372,7 @@ func (sch *schedule) ruleRoutine(grafanaCtx context.Context, key ngmodels.AlertR
}
evaluate := func(ctx context.Context, f fingerprint, attempt int64, e *evaluation, span tracing.Span) {
logger := logger.New("version", e.rule.Version, "fingerprint", f, "attempt", attempt, "now", e.scheduledAt)
logger := logger.New("version", e.rule.Version, "fingerprint", f, "attempt", attempt, "now", e.scheduledAt).FromContext(ctx)
start := sch.clock.Now()
evalCtx := eval.NewContext(ctx, SchedulerUserFor(e.rule.OrgID))