-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 request_context flag to utilize (*http.Request).Context() in handlers #265
Conversation
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
@kokaz can you comment here to pass the cla bot? |
I agreed to the CLA @googlebot |
Thanks @kokaz -- I want one more LGTM from another contributor before merging. ping @yugui @kazegusuri @achew22 @t-yuki |
Is there a strategy for making this the default in the future or will it remain an optional feature? Should we have a generated example with this turned on? |
I think this should become the default once we're okay with degrading 1.6 support. |
@tmc Is there any progress on that? |
Any chance on getting this merged sometime soon? It'd be very helpful with stuff such as routing tracing through the grpc-gateway to the backend grpc service. |
@tmc what information are you trying to get out of the HTTP request context that isn't available now? |
@achew22 i think a pretty good use-case is tracing (opentracing or google cloud trace) |
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
Tracing is what my usecase is for this PR. It's easier to thread the nessary tracing information through a http middleware instead of a grpc serverinterceptor, and more clean, I feel. It'd also allow middleware to do whatever other context manupulation it wants. |
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.
LGTM with a comment -- I expect that this behavior will be enabled by default at some point because I did not do this just because req
did not have Context()
.
I really love this PR and I believe this is the direction we should take.
b24dce7
to
44ee51f
Compare
…lers (grpc-ecosystem#265) * Add usage of http.Request's Context * add request_context flag Contribution by @kokaz, @tmc and @yugui
This is a simplification of #251.
This PR adds the request_context flag which when true will utilize the incoming *http.Request's context when invoking grpc methods.