Skip to content

Add LocalAddr to peer.Peer (#6577) #6702

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

Closed
wants to merge 3 commits into from

Conversation

prestonvasquez
Copy link

Resolves #6577 , requesting the ability to log the local address in addition to the remote address for server-side interceptors for debugging.

It isn't obvious to me if we want to also include the local address in the server handler, here . This would require parsing the information form the http request, likely using X-Forward-For .

There may be the necessity for a followup ticket to extend the binarylog package to include the local address in gRPC binary logging.

Hope this helps!

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 8, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

Merging #6702 (fb06e08) into master (59f57b1) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head fb06e08 differs from pull request most recent head e492cef. Consider uploading reports for the commit e492cef to get more accurate results

Additional details and impacted files

@zasweq zasweq self-requested a review October 13, 2023 22:44
@zasweq zasweq self-assigned this Oct 13, 2023
Comment on lines +2386 to +2389
pla := peer.LocalAddr.String()
if _, _, err := net.SplitHostPort(pla); err != nil {
t.Fatalf("Failed to parse local address from peer.")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please assert the actual local addr here? rather than just checking it split host port. Same in other test. (Listener, Conn or hardcoded)

@@ -161,14 +161,18 @@ func checkRoundRobinRPCs(ctx context.Context, client testgrpc.TestServiceClient,
gotAddrCount = make(map[string]int)
// Perform 3 iterations.
var iterations [][]string
var localIterations [][]string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this file. We don't need to add these assertions here.

@zasweq zasweq assigned prestonvasquez and unassigned zasweq Oct 17, 2023
@zasweq
Copy link
Contributor

zasweq commented Oct 24, 2023

Closing this because this is part of #6716.

@zasweq zasweq closed this Oct 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add LocalAddr to peer.Peer client side
2 participants