Commit Graph

4618 Commits

Author SHA1 Message Date
Matthias Radestock
5dad27cf7e permit setting probe.kubernetes.interval to 0
...which is useful if we want to disable periodic fetching of all
objects.

Previously the interval was also used to set the initial backoff of
the reconnect logic. A zero value there would result in _no_
backoff. So instead we now just use the default, which is 10s which
also happens to be the default probe.kubernetes.interval, so there is
no change in behaviour for the stock settings.
2018-01-03 00:38:17 +00:00
Roberto Bruggemann
f9f0487fdc Fix erroneous comments 2018-01-02 18:02:08 +00:00
Matthias Radestock
5404d4c2af Merge pull request #3009 from weaveworks/991-show-unconnected-processes
show unconnected processes

Fixes #991.
2018-01-02 17:26:46 +00:00
Matthias Radestock
d1bb4aa45e refactor: remove APITopologyDesc.filter
It's always set to render.FilterUnconnectedPseudo, so we can simply
use that constant in the one function (RendererForTopology) that
looked at that value.
2018-01-02 10:33:57 +00:00
Matthias Radestock
dd41956d60 refactor: remove support for non-linkable connections
Connections have always been linkable, so this is dead code.
2018-01-02 10:20:01 +00:00
Matthias Radestock
9754bf2385 refactor: remove support for non-linkable nodes
since they are now always linkable.
2018-01-02 10:19:22 +00:00
Matthias Radestock
3582c221fe processes are now always linkable 2018-01-02 09:47:15 +00:00
Matthias Radestock
ec7c468758 make it possible for users to see unconnected processes
We prevented this because rendering them was expensive. It still is,
but less so and actually works well, especially in table mode.
2018-01-02 09:40:18 +00:00
Matthias Radestock
74c72945ef optimisation: no need to prune adjacencies in filterUnconnected
since, by definition, unconnected nodes do not appear in adjacencies
of other nodes
2018-01-02 06:41:19 +00:00
Matthias Radestock
915535e0a2 Merge pull request #3007 from weaveworks/less-derived-node-metadata
remove unnecessary metadata propagation
2017-12-29 15:10:48 +00:00
Matthias Radestock
c8ea7ba49e refactor: simplify joinResults.add*
After dropping extra metadata in the rest of this PR, our usage of
joinResults.add* only ever ends creating minimal nodes, from just an
id and topology. Hence joinResults.add* can be invoked with simply an
id and topology instead of a generic node creation function.
2017-12-29 14:40:18 +00:00
Matthias Radestock
a7b6bb09a1 refactor: lift closures and extract constants 2017-12-29 14:40:18 +00:00
Matthias Radestock
2d6badba79 cope with processes that have no HostNodeID metadata
Some process nodes may not have a HostNodeID metadata, e.g. when an
endpoint references a pid that we know nothing about. When mapping
processes to containers, we therefore shouldn't rely on
HostNodeID. Instead we can obtain the hostID from the process node ID.

This has been broken for a while, possibly forever.
2017-12-29 14:40:16 +00:00
Matthias Radestock
ff03d7d86e Merge pull request #3008 from weaveworks/propagate-single-metrics-renderer
refactor: make PropagateSingleMetrics a renderer
2017-12-29 14:18:09 +00:00
Matthias Radestock
ecf1cf43f6 Merge pull request #3005 from weaveworks/move-rendercontext
refactor: move RenderContext where it belongs
2017-12-29 14:16:59 +00:00
Matthias Radestock
4984da6f04 fly-by optimisation
save a few allocations
2017-12-28 20:04:01 +00:00
Matthias Radestock
30bef738c0 refactor: make PropagateSingleMetrics a renderer
instead of a Map, since it's not really a map as it just updates the
given node.

This is more efficient and also matches what we do in similar
situations elsewhere, e.g. in ContainerWithImageNameRenderer and
ProcessWithContainerNameRenderer.
2017-12-28 20:04:01 +00:00
Matthias Radestock
4c1d5640ae don't propagate IsConnectedMark in MapProcess2Container
...when creating Uncontained pseudo nodes. IsConnectedMark only
affects summarisation of genuine process nodes.
2017-12-28 12:56:52 +00:00
Matthias Radestock
5d06f90f10 don't propagate HostNodeID in MapProcess2Container
...when creating Uncontained pseudo nodes. Summarisation of
Uncontained/Umanaged only looks at the ID, which includes the
HostNodeID.

We adjust the promotion of Uncontained to Unmanaged, to operate on the
ID instead of (re)extracting the hostID from the HostNodeID
metadata. With that, nothing looks at the HostNodeID metadata of
Uncontained/Unmanaged nodes.
2017-12-28 12:54:21 +00:00
Matthias Radestock
7ce160d492 don't propagate ImageID in MapContainer2ContainerImage
The ImageID is already the id of the node we are creation, and that's
what summarisation renders in the event we fail to join this node with
a node from the ContainerImage topology that has more metadata.
Nothing is looking at the ImageID metadata field.
2017-12-28 12:50:11 +00:00
Matthias Radestock
9034296209 don't propagate ImageID in MapContainerImage2Name
This was building a set of all the image ids represented by the same
unversioned image. Well, it was doing that until I broke it with a
silly mistake in #1739 - instead of extracting the imageID from the
original node ID, it's extracting it from the updated ID, which is the
unversioned image. Even if it was working though, it's pointless
since nothing is looking at that info.
2017-12-28 12:50:11 +00:00
Matthias Radestock
a46b9c9c24 don't propagate ContainerHostname in MapContainer2Hostname
The container hostname is already the id of the node, and that's what
summarisation renders. Nothing looks at the docker.ContainerHostname
metadata of nodes in the ContainerHostname group topology.
2017-12-28 12:50:11 +00:00
Matthias Radestock
bbd6c5fe47 don't propagate HostNodeID in endpoints2Hosts
The HostNodeID is already the id of host nodes (as the name suggests),
and that's what summarisation renders. Nothing looks at the HostNodeID
metadata of host nodes.
2017-12-28 12:50:11 +00:00
Matthias Radestock
a3ba3a5a55 don't propagate Name in processes2Names
The name is already the id of the node, and that's what summarisation
renders. Nothing looks at process.Name.
2017-12-28 12:50:11 +00:00
Matthias Radestock
d7e90303a6 don't propagate PID in endpoints2Processes
The 'create' function passed to addChild is only ever invoked when we
cannot find a matching process in the process topology. In these cases
the host and pid will be _all_ the info we are ever going to have,
both of which are incorporated in the id. Node summarisation renders
that as best it can; adding the PID as metadata does not make a
difference but for a line with that info in the detail panel, which
adds nothing since the PID is already included in the label.
2017-12-28 12:50:11 +00:00
Matthias Radestock
27c2f3a5d2 refactor: use propagateLatest
instead of the equivalent long-hand code.
2017-12-28 12:50:11 +00:00
Matthias Radestock
e69c8209fb remove redundant operation
We were setting the very same k/v that we just looked up.
2017-12-28 12:50:11 +00:00
Matthias Radestock
c2b0e568c3 Merge branch 'master' of github.com:weaveworks/scope 2017-12-28 12:48:59 +00:00
Matthias Radestock
a8ad7f8898 refactor: simplify summarisation of internet nodes 2017-12-28 12:48:13 +00:00
Matthias Radestock
3d1a44aae0 extract label from id when summarising un[contained,managed]
I missed this in #2998.
2017-12-28 12:48:12 +00:00
Matthias Radestock
0c6b5b3a25 refactor: simplify summarisation of internet nodes 2017-12-28 10:28:33 +00:00
Matthias Radestock
569ccb7124 extract label from id when summarising un[contained,managed]
I missed this in #2998.
2017-12-28 10:18:23 +00:00
Matthias Radestock
5a6a6dfd58 remove from cruft from Makefile
This was left over from #1345.
2017-12-27 16:34:00 +00:00
Matthias Radestock
286453b9a9 refactor: move RenderContext where it belongs
It shouldn't be in 'report' because that is shared between the probe
and the app, and RenderContext, as the name suggests, is only needed
in the app.
2017-12-27 16:22:52 +00:00
Matthias Radestock
36c0d854bf Merge pull request #2998 from weaveworks/node-label-fallbacks
render sensible labels for nodes with little/no metadata
2017-12-27 14:59:33 +00:00
Matthias Radestock
0b4512bd9b refactor: clarify and comment on summarisation logic 2017-12-27 13:54:30 +00:00
Matthias Radestock
705c6d159d sensible defaults/fallback for label and shape 2017-12-27 13:54:30 +00:00
Matthias Radestock
4206760021 refactor: lift some code out of inner loop 2017-12-27 13:54:30 +00:00
Matthias Radestock
7c5e9339bb render parents which we cannot resolve
The id and topology are enough to get some basic info for rendering.

This isn't just a fall-through for exceptional cases.
ContainerwithImageNameRenderer produces parent references using the
image name without version as the ID, and containers-by-image topology
uses that for grouping. By contrast, the container-image topology in
the report is keyed on docker image IDs.
2017-12-27 13:54:30 +00:00
Matthias Radestock
b88a2e4509 render sensible labels for parent nodes with little/no metadata
We eliminate the custom parent renderer, which was a very partial
implementation MakeBasicNodeSummary.

We also ensure that parents are always rendered in the same, sensible
order. Previously the order was an alphabetic sort of the parent
topology IDs. Now lower level topologies come before higher level
topologies.
2017-12-27 13:54:30 +00:00
Matthias Radestock
8cf65ea8b6 use BasicNodeSummary for rendering links in connection table
instead of the full NodeSummary
2017-12-27 13:54:30 +00:00
Matthias Radestock
0237b13916 refactor: extract BasicNodeSummary
This is sufficient for rendering links to nodes, and is cheaper to
compute that the full NodeSummary.
2017-12-27 13:54:30 +00:00
Matthias Radestock
367f2db003 always render metric urls
Fixes an omission.
2017-12-27 13:54:29 +00:00
Matthias Radestock
d1149dc29e add a basic test for rendering nodes with little/no metadata 2017-12-27 13:54:29 +00:00
Matthias Radestock
a9b8ced0a7 refactor: drop superfluous return value
Now that summary renderers always produce something, they no longer
need to indicate whether they did.
2017-12-27 13:54:29 +00:00
Matthias Radestock
da11655659 render sensible labels for group nodes with little/no metadata
The node ID of group nodes is in fact the same value as we get from
looking up the metadata key contained in the group topology id. So
just use that since a) we always have it, and b) we save a LatestMap
lookup.
2017-12-27 13:54:29 +00:00
Matthias Radestock
15881cd7fd render sensible labels for weave peer nodes with little/no metadata
We fall back to using the peerName as the label, which we always have.
2017-12-27 13:54:29 +00:00
Matthias Radestock
5e099640eb render sensible labels for swarm service nodes with little/no metadata
We fall back to using the service ID as the label.
2017-12-27 13:54:29 +00:00
Matthias Radestock
9aed0792ac render sensible labels for ecs task nodes with little/no metadata
We fall back to using the ARN as the label.
2017-12-27 13:54:29 +00:00
Matthias Radestock
289226707d render sensible labels for k8s nodes with little/no metadata
We fall back to using the object id as the label.
2017-12-27 13:54:29 +00:00