diff --git a/ctxtrace.go b/ctxtrace.go index 29e00c3..51ca50a 100644 --- a/ctxtrace.go +++ b/ctxtrace.go @@ -181,3 +181,8 @@ func packCallerMetadata(m *metadata.MD, data TraceData) { m.Set(headerRequestID, data.RequestID) } } + +// WithValue Creates context with TraceData values +func WithValue(ctx context.Context, traceData TraceData) context.Context { + return context.WithValue(ctx, traceCtxMarker{}, traceData) +}