-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add gRPC-OpenTracing interceptors for Go #3
Conversation
cc: @dominikh per our conversation on Gitter about this I would like to include more information about the peer (via tags/etc), but unfortunately I'm not sure where to access that given what's (not) exported in gRPC. |
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
Per the google CLA thing: "I did it" |
CLAs look good, thanks! |
Everything looks good to me, although I would recommend adding an |
md = metadata.New(nil) | ||
} | ||
mdWriter := metadataReaderWriter{md} | ||
tracer.Inject(clientSpan.Context(), opentracing.TextMap, mdWriter) |
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.
There's an error to handle, or a comment explaining why not.
👍 |
} | ||
mdWriter := metadataReaderWriter{md} | ||
err = tracer.Inject(clientSpan.Context(), opentracing.TextMap, mdWriter) | ||
// We have no better place to record an error than the Span itself :-/ |
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.
@jmacd this is how I dealt with Inject errors...
It gets the job done. Registering an error handler as an Option
seemed like overkill.
Comments addressed... merging. |
See the
README.md
for usage examples, etc.This is possible thanks to grpc/grpc-go#867.