-
Notifications
You must be signed in to change notification settings - Fork 712
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
reverse resolutions for remote side of connections. #404
Conversation
if err == gcache.NotFoundKeyError { | ||
// we trigger a asynchronous reverse resolution when not cached, but we return | ||
// immediately so the client does not block... | ||
r.addresses <- address |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
b1852fc
to
917a48a
Compare
#411 is merged, so you should now be able to put the reverse dns lookups on pseudo nodes and plumb this all the way through to the UI. |
Addr: c.RemoteAddress.String(), | ||
}) | ||
} | ||
} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
We'll also need unit tests for the resolver. |
@@ -104,7 +104,8 @@ func main() { | |||
} | |||
|
|||
var ( | |||
endpointReporter = endpoint.NewReporter(hostID, hostName, *spyProcs, *useConntrack) | |||
revResolver = endpoint.NewReverseResolver(endpoint.RAddrCacheLen) | |||
endpointReporter = endpoint.NewReporter(hostID, hostName, *spyProcs, *useConntrack, revResolver) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Just waiting for the WIP prefix to go away, and those two checkboxes to be checked :) |
throttle := time.Tick(time.Second / 10) | ||
for address := range r.addresses { | ||
<-throttle // rate limit our DNS resolutions | ||
names, err := net.LookupAddr(address) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@tomwilkie what should I do with the reverse address in |
@inercia yes I'd try and replace IP addresses in the connections table, in connectionDetailsRows() https://github.com/weaveworks/scope/blob/master/render/detailed_node.go#L206 |
@tomwilkie the problem with doing a |
The UI will truncate them and offer tooltips (recent change just went in, you'll need to rebase). I wouldn't be too worries about it. |
for address := range r.addresses { | ||
<-throttle // rate limit our DNS resolutions | ||
_, err := r.cache.Get(address) // and check if the answer is already in the cache | ||
if err == nil { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
5509503
to
8c817d1
Compare
Add nodes for the remote side of connections iff we have a DNS reverse resolution for the IP. Unit test for the resolver
// we trigger a asynchronous reverse resolution when not cached | ||
select { | ||
case r.addresses <- request: | ||
if wait { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
I just put in a few small changes to address some of my own review feedback... |
func TestReverseResolver(t *testing.T) { | ||
tests := map[string]string{ | ||
"1.2.3.4": "test.domain.name", | ||
"4.3.2.1": "im.a.little.tea.pot", |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
LGTM! |
reverse resolutions for remote side of connections.
Async reverse dns lookups in probe that creates nodes for the remote side of connections.
It's part of the solution for #364
TODO: