Skip to content

Commit

Permalink
Merge branch 'master' into oncilla-patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
oncilla authored Sep 13, 2024
2 parents 7b7991d + 2663569 commit 92db9e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions private/tracing/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ func CtxWith(parentCtx context.Context, operationName string,
span, ctx := opentracing.StartSpanFromContext(parentCtx, operationName, opts...)
if spanCtx, ok := span.Context().(jaeger.SpanContext); ok {
id := spanCtx.TraceID()
return span, log.CtxWith(ctx, log.New("debug_id", id.String()[:8], "trace_id", id))
ctx, _ = log.WithLabels(ctx, "debug_id", id.String()[:8], "trace_id", id)
return span, ctx
}
return span, log.CtxWith(ctx, log.New("debug_id", log.NewDebugID()))
ctx, _ = log.WithLabels(ctx, "debug_id", log.NewDebugID())
return span, ctx
}

// LoggerWith attaches the trace ID if the context contains a span.
Expand Down

0 comments on commit 92db9e7

Please sign in to comment.