62 Commits

Author SHA1 Message Date
Bryan Boreham
dc14bd04df Exit joinResults.result() if context cancelled
These can be long-running operations, and if the client retries we get
the cancelled one running in parallel with the retry, slowing both down
and making it likely the next one will time out too.
2021-04-22 10:53:06 +00:00
Bryan Boreham
871751873b Stop render package depending on probe
This dependency makes it harder to see the structure of the program,
and sometimes complicates compilation.

Mostly just changing the source of strings that are already exported
from the report package.  A few new strings have to be moved there,
plus the function `IsPauseImageName()`.
2019-09-15 17:03:04 +00:00
Satyam Zode
36361d6b7d Add Kubernetes Job support to Weave Scope
This covers:
- Implementation of the job resource in probe
- Reporter changes for the job
- Add Describe Control to the job
- Pass job object to the kube controller renderer

ToDo:
- Need to decide the shape for the Job.

Signed-off-by: Satyam Zode <satyamzode@gmail.com>
2019-05-19 02:36:45 +05:30
Bryan Boreham
3be8cf71dd Add more Opentracing detail to the app (#3383)
* Pass Go context down to Renderers

This is useful for cancellation or tracing.

* Add tracing spans to app

Also log things like number of nodes in Map, total number of reports.
2018-10-26 11:21:33 +05:30
Bryan Boreham
0c394e689a Fix pod host propagation 2018-10-12 13:47:39 +00:00
Bryan Boreham
1279a02b7d Stop tagging pods with host ID
So they can be reported centrally, find the pod host ID from the child
containers.
2018-10-11 17:54:29 +00:00
Bryan Boreham
183396ed54 Merge pull request #3201 from weaveworks/dont-map-pod-blank-ip
Don't return blank addresses for pods
2018-06-20 10:39:18 +01:00
Bryan Boreham
8c18a785e7 Merge pull request #3132 from openebs/add-pv-pvc-support
Add Kubernetes Storage (pv and pvc) support in Weave Scope
2018-06-08 12:41:21 +01:00
Satyam Zode
24741bec2a Simplify volume rendering code in render
- Remove the complex volume rendering code.
- Remove volume specific code from Transform.
- Rename filtering methods
- Remove extra params from PV, PVC nodes to make table view look good.

Signed-off-by: Satyam Zode <satyam.zode@openebs.io>
2018-06-08 16:37:42 +05:30
Satyam Zode
d26b2c3805 Add Kubernetes storage class resource to weave scope
This will:

- Add StorageClass resource. Storage classes are mentioned
in the PVC spec. We're using storage class name from PVC spec to
add adjacency to the PVC node.
- Add square sheet shape for StorageClass.
- Add storage filter in the PODS topology.
Storage Filter will allow user to see distinct view of
stateful applications.
- Add visually distinct edge to show storage adjacency.

Signed-off-by: Satyam Zode <satyam.zode@openebs.io>
2018-06-08 16:36:29 +05:30
Bryan Boreham
fe28febbe1 render: Don't return blank addresses for pods
A small performance improvement - instead of creating an entry in a
map which doesn't match anything, just skip a pod with a blank IP.
2018-05-29 15:30:15 +00:00
Bryan Boreham
ced27b298c Turn Map2Parent into a Renderer
This is the last MapFunc which returns multiple Nodes, so by turning
it into a Renderer we open the door to simplifing every other MapFunc.
2018-04-09 13:16:40 +00:00
Matthias Radestock
feae4f4fcf don't show Failed pods
these are not alive, and Scope generally only shows the living, not
the dead.
2018-04-02 11:03:25 +01:00
Matthias Radestock
fd5fa7a962 refactor: extract common code in endpoint mapping
This isn't quite as neat as we'd want to make it, because two of the
three call sites still require a closure, but it's still an
improvement.

Note that every instance of MapEndpoints only ever maps to one
topology, which, furthermore, is a core report topology. Hence we can
just parameterise MapEndpoints with that topology, and then the map
functions can return just the node ids.
2018-01-07 08:20:06 +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
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
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
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
0c894e9446 refactor: drop networks from render.MapFunc
All the MapFuncs that needed networks have been elevated to Renderers.
2017-12-17 00:18:12 +00:00
Roberto Bruggemann
c08d39f8bd report.Upgrade() add deployments to pods as parent
This was previously done selectPodsWithDeployments.Render().
2017-12-11 14:50:41 +00:00
Matthias Radestock
ae153e57f5 refactor: remove Decorator from render.Renderer.Render() signature 2017-11-18 18:04:52 +00:00
Matthias Radestock
9bd8bd825b remove now superfluous Renderer.Stats method
step 2 (and final step) in producing stats as part of Rendering
2017-11-08 07:15:28 +00:00
Matthias Radestock
8f7e00f46a Stats are easily produced as part of Rendering
...so there is no need for a separate Stats method.

step 1: return stats from Render
2017-11-08 07:15:28 +00:00
Matthias Radestock
7b0a08ae9d memoise renderer passed to ConnectionJoin
We do this here rather than in ConnectionJoin since that way it is
obvious that the renderer isn't memoised already.
2017-11-05 11:05:28 +00:00
Matthias Radestock
b793a9efa8 memoise shared top-level renderers
and add a comment indicating non-memoisation of other, not shared
top-level renderers.

This memoisation is effective when the browser requests multiple
topologies for the same report.
2017-11-04 23:05:52 +00:00
Mike Lang
17fffb32e1 Add stateful sets and cronjobs to Controllers renderer
Since renderKubernetesTopologies was getting unweildy, refactored into a form
which was a bit clearer, if a bit more verbose.
2017-07-18 11:35:50 -07:00
Matthias Radestock
c7f94d8a74 join with original renderer in ConnectionJoin
This guarantees that the output won't contain bare nodes containing
just an id and topology, as produced by ipToNode. Previously this was
ensured by calling convention, now it's ensured by construction.
2017-07-13 16:28:02 +01:00
Matthias Radestock
387a68a3c7 tiny refactor: swap ConnectionJoin arg order
to match the style of other render HoFs, which take their inputs last.
2017-07-13 14:23:46 +01:00
Mike Lang
399cca026c render/pod: Fix a typo in Map2Parent where UnmanagedID will always be used for noParentsPseudoID
Thankfully we only ever set it to UnmanagedID right now, so no user-facing bug.
2017-07-05 11:33:06 -07:00
Mike Lang
73b7641d9f render/pod: Remove unused code and options 2017-07-03 13:50:56 -07:00
Mike Lang
b7e24e82b5 render/pod: Remove redundant deployment mapping
This map function isn't actually needed.
Children are only populated from mapping to parents during rendering,
so there's no pre-existing replicasets to map.
Simply having the Map2Parent function map pods to deployments has it do the right thing.
2017-07-03 11:49:31 -07:00
Mike Lang
ef2b6f6c55 Remove replica sets
Use a special kind of selector renderer to elide replica sets from pod nodes
and directly reference deployment parents instead.
Do the inverse (replace replica sets with pods) during the mapping from pod to deployment.

Note we can no longer use renderParents since we're using a non-standard Selector
2017-06-29 10:13:15 -07:00
Mike Lang
f7913ab550 Rewrite renderers for k8s/ecs/swarm to abstract common parts
Since all the renderers were doing almost-exactly the same thing, we abstract that out into a common function.
2017-06-27 10:19:04 -07:00
Mike Lang
f101f83c3d controllers topology: Map metrics for single nodes
* Maps metrics if there is a single pod in the controller, as per all other views.
* Also added heavy commenting on the increasingly-complex render chain
2017-06-27 10:19:04 -07:00
Mike Lang
8eb72cf276 Remove deployment and daemonset views, change combined to controllers and remove bare pods and replica sets
Since we still need to map through replica sets to find matching deployments, we simply filter them out as a post-step.
2017-06-27 10:19:04 -07:00
Mike Lang
13b2ed69bd Improve renderer for combined view by refactoring Map2Parent
The existing technique of "reducing" the two rendered graphs for daemonsets and deployments
had a glaring issue that no connections would ever be made between nodes of different types,
since that information would've been discarded earlier in the process.
It also makes it hard to identify "parentless" pods.

This commit extends the Map2Parent function, teaching it:
	* To check multiple topologies for parents
	* To pass through nodes with no parents found without modification

Since we already had two 'modes' for what to do with nodes without parents,
and it would've been clunky to try to encode the third option into the existing PseudoNodeID
arg in some way, we instead split it into two args, with the first being an enum specifying
either the old pseudo node behaviour, the old drop behaviour, or the new keep behaviour.

We then use the new Map2Parent to map pods to:
	* A replica set, if it has one
	* A daemonset, if it has one
	* Itself, if neither of the above
and then map again from the results to any deployment, leaving as-is any nodes that
don't map to a deployment. Hence we are left with:
	* Deployments
	* Daemonsets
	* Replica sets, but only if they map to no deployment
	* Pods, but only if they map to none of the above
and connections between all these will be calculated correctly.
2017-06-27 10:19:04 -07:00
Mike Lang
6dae014352 Add new view for 'combined' daemonset/deployment view
The idea is that this view shows all 'pods or groups of pods' at 'the highest level of abstraction'.
For now, we just show daemonsets and deployments.
2017-06-27 10:19:04 -07:00
Matthias Radestock
8c6a171553 refactor: extract a couple of heavily used constants 2017-06-21 21:12:55 +01:00
Mike Lang
f403d01885 Forgot to include daemonsets in renderKubernetesTopologies
Yay, needing to remember 10 different obscure places to add a new topology every time.
2017-06-12 10:13:54 -07:00
Matthias Radestock
ebcf9dcf10 refactor: rename ShortLivedConnectionJoin to ConnectionJoin
since it's dealing with *all* connections, not just short-lived ones.
2017-06-04 16:10:21 +01:00
Mike Lang
3aa4a676dd Add new view for daemonsets 2017-05-19 15:06:53 -07:00
Mike Lang
3656965ae7 Refactor Map2Parent and family into one function
This greatly improves code reuse while keeping the behaviour flexible
2017-04-10 14:30:53 -07:00
Alfonso Acosta
806b27e785 Exclude pause containers when rendering k8s topologies 2017-03-16 12:18:28 +00:00
Filip Barl
2e9255b190 Addressed the comments and fixed the tests. 2017-02-20 11:40:40 +01:00
Alfonso Acosta
529759b603 Discard short-lived connections to/from Pods in the host net 2016-10-21 14:42:44 +00:00
Tom Wilkie
73e2effb9f Join pod topology directly with short lived connections (#1597)
* Join pod topology directly with short lived connections

* Review feedback
2016-06-16 19:05:15 +01:00
Paul Bellamy
85aee27ef6 If k8s objects only have one container, show that container's metrics on them (#1473) 2016-06-04 08:03:51 +01:00
Tom Wilkie
5f995ae2f9 Propagate the pod counter from replicasets for deployments. 2016-05-19 13:41:52 +01:00
Tom Wilkie
8f772a696d Add flag to disable reporting of processes (and procspied endpoints) 2016-05-17 17:29:09 +01:00
Tom Wilkie
bbe56d854d Don't filter out Services etc which don't have pods - we don't do our filtering like that anymore. 2016-05-10 12:32:35 +02:00