WithRequestID gets a new context with RequestID set.
(ctx context.Context, requestID string)
| 147 | |
| 148 | // WithRequestID gets a new context with RequestID set. |
| 149 | func WithRequestID(ctx context.Context, requestID string) context.Context { |
| 150 | return metadata.AppendToOutgoingContext(context.WithValue(ctx, RequestIDKey, requestID), RequestIDKey.String(), requestID) |
| 151 | } |
| 152 | |
| 153 | // WithGoroutineLabel gets a new context with Go Routine label key set and a label assigned to the context using |
| 154 | // pprof.Labels. |