-
Notifications
You must be signed in to change notification settings - Fork 715
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
Move DNS name mapping from endpoint to report #3061
Conversation
1b2e83d
to
0c88e43
Compare
render/detailed/connections.go
Outdated
@@ -73,7 +73,7 @@ func newConnectionCounters() *connectionCounters { | |||
return &connectionCounters{counted: map[string]struct{}{}, counts: map[connection]int{}} | |||
} | |||
|
|||
func (c *connectionCounters) add(outgoing bool, localNode, remoteNode, localEndpoint, remoteEndpoint report.Node) { | |||
func (c *connectionCounters) add(rpt report.Report, outgoing bool, localNode, remoteNode, localEndpoint, remoteEndpoint report.Node) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
report/report.go
Outdated
@@ -469,6 +475,37 @@ func (r Report) upgradeNamespaces() Report { | |||
return r | |||
} | |||
|
|||
// Note in-place modification of Endpoint.Nodes |
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.
report/report.go
Outdated
reverseNames, foundR := endpoint.Sets.Lookup(ReverseDNSNames) | ||
if ok && (foundS || foundR) { | ||
// Add address and names to report-level data - we assume | ||
// all endpoints with the same address have equally good data |
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.
4116e73
to
f26030a
Compare
I made the requested changes and rebased. Also moved |
f26030a
to
b5cdcb9
Compare
Fixes #3058
If the probe sees many TCP sockets on a host, it will repeat the same address information on each endpoint. Moving it to report level saves all this repetition. Also
Sets
is an expensive data structure; for the DNS mapping I used a straightforwardmap
, similar toTopology.Nodes
.I see about a 6% reduction in JSON file size, on Weave Cloud production reports.
The mapping is used as a mapping from IP address to name, and the current implementation encodes it the same way, but to me it seems more logical to send it as a mapping from name to address. Probably that doesn't matter.
I considered movingDNSFirstMatch
fromrender
toreport
, to collect all the behaviour together. However the decisions made are somewhat related to rendering, so I left it.