When I go looking at StackDriver traces that AppEngine generates automatically, there's a log link (that never brings up any more than one line of the log, but hopefully, they're working on fixing it.)
Is there a way to tell StackDriver, when I send a trace and set of spans, what request_id to associate the trace with?
It is supposed to be one log only since you are searching for log for one particular request. Clicking on the left side triangle will expand the log.
If you don't really need to go to logs viewer to view the log, you can use the "show logs" button on the trace detail page. By clicking on it, it will embed the log statement in between spans. The position of the log statement is determined by the log time, relative to start time of the spans.
Clicking on the log statement line will show the full details of the log statement on the right side panel. See example below. "show logs" button is in the circle.
To pair up the trace spans you created with the trace spans created by GAE, simply pass the trace context as HTTP header to the GAE app.
trace-id should be set to the same as the trace you generated. span-id should be set to the one that calls into GAE app. This is the parent span id of the GAE top span. o should be set to 1 if you want to trace, 0 if you don't.
Example: