-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 LocalAddr to peer.Peer client side #6577
Comments
hi @ginayeh, I'd like to take a stab at this. Could you assign it to me? |
@mingdaoy -- sorry about that. seems like we already have had @prestonvasquez with a fix in flight for it #6702. Please use this filter to look for issues that are marked "Help wanted" and currently are unassigned. |
I've been playing with master now that #6716 has been merged and it's great to have access to the local address from server code, kudos @zasweq! However, there's also useful applications of retrieving the local port a client is using (e.g. to correlate it with prometheus metrics that we expose using the client address as a label). Not sure if this was intentional, but I noticed that #6702 exposed the Would it be possible to cherry-pick that one line from #6702? I modified the code locally and can confirm that's all that's needed for client code to retrieve local port through Thanks! |
Oh sure, we cna keep this open and try to add that. I will update the title accordingly. |
Awesome thanks @zasweq! Will you take care of the changes or want me to help in any way? |
@CarlosRDomin - if you don't mind sending a PR, that would be great, thanks! |
Use case(s) - what problem will this feature solve?
We want to be able to log the local address in addition to the remote address from our server-side interceptors to aid in debugging.
Proposed Solution
Add
LocalAddr net.Addr
topeer.Peer
.Alternatives Considered
This information could also be made available via some other context attribute. It doesn't really matter as long as there is a way to get it.
Additional Context
This was already added to the Java implementation several years ago. grpc/grpc-java#4906
The text was updated successfully, but these errors were encountered: