mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-05 03:01:11 +00:00
Don't show shortlived connections in the host view.
This commit is contained in:
@@ -176,6 +176,12 @@ func (r *Reporter) addConnection(rpt *report.Report, localAddr, remoteAddr strin
|
||||
})
|
||||
}
|
||||
|
||||
if extraLocalNode != nil {
|
||||
localNode = localNode.Merge(*extraLocalNode)
|
||||
}
|
||||
if extraRemoteNode != nil {
|
||||
remoteNode = remoteNode.Merge(*extraRemoteNode)
|
||||
}
|
||||
rpt.Address = rpt.Address.AddNode(localAddressNodeID, localNode)
|
||||
rpt.Address = rpt.Address.AddNode(remoteAddressNodeID, remoteNode)
|
||||
}
|
||||
|
||||
@@ -180,9 +180,17 @@ func MapAddressIdentity(m RenderableNode, local report.Networks) RenderableNodes
|
||||
return RenderableNodes{}
|
||||
}
|
||||
|
||||
// Conntracked connections don't have a host id unless
|
||||
// they were merged with a procspied connection. Filter
|
||||
// out those that weren't.
|
||||
_, hasHostID := m.Metadata[report.HostNodeID]
|
||||
_, conntracked := m.Metadata[endpoint.Conntracked]
|
||||
if !hasHostID && conntracked {
|
||||
return RenderableNodes{}
|
||||
}
|
||||
|
||||
// Nodes without a hostid are treated as psuedo nodes
|
||||
_, ok = m.Metadata[report.HostNodeID]
|
||||
if !ok {
|
||||
if !hasHostID {
|
||||
// If the addr is not in a network local to this report, we emit an
|
||||
// internet node
|
||||
if !local.Contains(net.ParseIP(addr)) {
|
||||
|
||||
Reference in New Issue
Block a user