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

Alerting: (Chore) Add traceID to logs with contextual logger
This commit is contained in:
Kyle Brandt
2023-07-11 04:59:52 -04:00
committed by GitHub
parent aa115afbaa
commit f6a28cadbc

View File

@@ -369,7 +369,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))