-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
contrib/google.golang.org/grpc: fix client stream context propagation #919
Conversation
Fix the client stream context returned by method Context() on the traced client stream. It now correctly returns the context containing the grpc.client span instead of its parent context. This was leading to misconnected or orphan grpc.message spans.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Julio-Guerra
I have some nitpicks and questions.
defer rig.Close() | ||
client := rig.client | ||
|
||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for this block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as explained above
|
||
var serverSpan, clientSpan mocktracer.Span | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for putting this in a block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following rootSpan
type is tracer.Span
and then come the assertions with the tracer mockup spans which have different types. So I created a new separate scope to avoid having two types of spans in the function scope.
Happy to put it in a separate function if you prefer.
Fix the client stream context returned by method Context() on the traced
client stream. It now correctly returns the context containing the
grpc.client span instead of its parent context.
This was leading to misconnected or orphan grpc.message spans.
Fixes APMS-5154.