117 Commits

Author SHA1 Message Date
Bryan Boreham
33acfa1e59 Log part-merged nodes dropped to tracing
So we have more idea what happened, in case of issue.
2021-04-23 10:51:24 +00:00
Bryan Boreham
4dbf908cde Remove partially merged nodes from deltas
Scope probes send full reports and deltas. If a node is eliminated
between two full reports, then the app might only have a delta of its
last state. Remove all such nodes before rendering.
2021-04-23 09:38:45 +00:00
Bryan Boreham
5264b61951 improvement: stop rendering if Context is cancelled
Typically this means the http caller has closed the connection,
so no point responding to them.

Also check at the point we send a response back, and log to OpenTracing.
2020-06-11 11:13:38 +00:00
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
Akash Srivastava
81a682893f Add kubernetes volume snapshot support
- Add a new client in probe/kubernetes/client.go
  which will be used to fetch details of Snapshot CRD
- Visualize VolumeSnapshot and VolumeSnapshotData
- Add adjacency between PV and VolumeSnapshot
- Add adjacency between VolumeSnapshot and VolumeSnapshotData
- Add snapshot filter to hide and show snapshots

Signed-off-by: Akash Srivastava <akash.srivastava@openebs.io>
2018-10-16 01:04:44 +05:30
Marc Carré
2ba50b8b3d Update golang.org/x/net/context to latest
```
$ gvt delete golang.org/x/net/context
$ gvt fetch golang.org/x/net/context
2018/07/23 18:03:49 Fetching: golang.org/x/net/context
$ git grep -l "golang.org/x/net/context" | grep -v vendor | xargs sed -i '' 's:golang.org/x/net/context:context:g'
$ git grep -l "context/ctxhttp" | grep -v vendor | xargs sed -i '' 's:context/ctxhttp:golang.org/x/net/context/ctxhttp:g'
$ gofmt -s -w app
$ gofmt -s -w common
$ gofmt -s -w probe
$ gofmt -s -w prog
$ gofmt -s -w tools
```
fixed a bunch of:
```
cannot use func literal (type func("github.com/weaveworks/scope/vendor/golang.org/x/net/context".Context) error) as type func("context".Context) error
```
2018-07-23 20:10:18 +02:00
Marc Carré
d46c2266ce Change Sirupsen/logrus to sirupsen/logrus
```
$ git grep -l Sirupsen | grep -v vendor | xargs sed -i '' 's:github.com/Sirupsen/logrus:github.com/sirupsen/logrus:g'
$ gofmt -s -w app
$ gofmt -s -w common
$ gofmt -s -w probe
$ gofmt -s -w prog
$ gofmt -s -w tools
```
2018-07-23 20:10:14 +02:00
Alfonso Acosta
0a5fb7aad3 Remove ProcessWithContainerNameRenderer, it wasn't working (#3263) 2018-07-13 13:34:37 +02: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
d9bd17af8a Refactor edge frontend code and reporter
- Refactor dotted edge logic.
- Change Storage view to show storage components as well as all
  the pods.
- Sentence case storage related variables.

Signed-off-by: Satyam Zode <satyam.zode@openebs.io>
2018-06-08 16:37:48 +05:30
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
Satyam Zode
23210a6a77 Add Kubernetes volumes support in Weave Scope
This will

- Add Kubernetes volume resources such as PV, PVC.
- Add shapes for Kubernetes PV and PVC
- Add `Cylinder` shape for PV and `Dotted Cylinder` shape for PVC.

Signed-off-by: Satyam Zode <satyam.zode@openebs.io>
2018-06-07 17:01:29 +05:30
Simon
4647ce1901 Merge pull request #3165 from weaveworks/default-filter
Use the default value for a TopologyOption if omitted
2018-05-28 14:36:25 +02:00
Roland Schilter
f012c23ca1 Sentence cased text everywhere (#3166)
* Sentence cased text everywhere

Follows Weave Cloud's direction of sentence case on most things.

* More space between sorter caret and label

* Use full topology name for table header
2018-05-17 17:30:38 -07:00
Bryan Boreham
a64db66010 Use the default value for an APITopologyOption if omitted 2018-05-09 19:21:03 +00:00
Bryan Boreham
7da7183a37 Refactor: simplify default type of option 2018-05-09 19:07:38 +00:00
Roberto Bruggemann
d3c53bacd6 'updateKubeFilters` returns early if there are no namespaces
This change makes sure an empty `APITopologyOptionGroup` struct is not created for namespaces, if there are no namespaces to report.
2018-01-08 17:37:49 +00:00
Roberto Bruggemann
1fb23dd8f9 Extract namespaces from report.Namespace
This avoids unnecessary loops.
2018-01-03 13:55:27 +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
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
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
9dca7627b6 filter unconnected nodes after applying user-specified filters
...rather than before. That way, nodes which become unconnected during
filtering are removed, which is what we want. ATM we are depending on
some 'unconnected' filtering inside every filter, which is expensive
and largely redundant. We should soon be able to remove that.

downside: 'unconnected' filtering is no longer memoised.
2017-11-28 06:54:15 +00:00
Matthias Radestock
2d964b669a refactor: separate filtering from rendering in topology description
This is a step towards filtering unconnected nodes after all custom
filters have been applied.
2017-11-28 06:54:15 +00:00
Matthias Radestock
7bbded9e84 refactor(ish): introduce Tranformers
so we can generalise the filter step in render.Render et al. That will
allow us to apply whole-topology filters in that step.
2017-11-28 06:54:15 +00:00
Matthias Radestock
8c4ae0577d Merge pull request #2947 from weaveworks/simplify-decoration
Decorators, begone!
2017-11-21 20:49:45 +00:00
Matthias Radestock
a12d707d9b refactor: rename decorateWithStats to computeStats
to de-decorate
2017-11-21 20:17:00 +00:00
Matthias Radestock
88e8b52d66 Decorators, begone!
Decorators were just a complicated way of constructing filters.
2017-11-21 20:16:30 +00:00
Matthias Radestock
a82d245e93 simplify render decoration
Decoration is in fact quite a simple process that is applied on entry
to rendering: we take a base renderer, transform it with a decorator,
and then render a report with it. The new render.Decorate() function
does exactly that.

There is one exception. When rendering an individual node, e.g. for
showing its details panel in the UI, we must not lose the node during
decoration. That requires some special logic, which previously resided
in the PreciousNodeRenderer, and now lives in handleNode.
2017-11-18 18:04:52 +00:00
Matthias Radestock
4e4c3b25c4 Expand the app's k8s namespace calculation
to include recently added k8s types.

This is all rather inefficient. See #2945.
2017-11-18 17:35:57 +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
0b9bab255c memoise top-level rendering
This deals with browsers requesting the same rendering for the same
timespan when no new reports have been received for that timespan.
2017-11-04 22:24:46 +00:00
Roland Schilter
0d381a34d6 Link scope-ui graphs clickable to prometheus queries (#2664)
scope-app:
* Adds `-app.metrics-graph` cli flag for configuring the base url to
use for graph links; supports :orgID and :query placeholders
* Assigns query URLs to existing metrics and appends empty metrics if missing

scope-ui:
* Extends <CloudFeature /> with option alwaysShow
* Adds <CloudLink /> to simplify routing when in cloud vs not in cloud
* Links metric graphs in the ui's node details view for all k8s
toplogies and containers so far
* Tracks metric graph click in mixpanel `scope.node.metric.click`
* Uses percentages and MB for CPU/Memory urls
* Passes timetravel timestamp to cortex in deeplink
2017-08-15 18:56:23 +01:00
Mike Lang
c521b50bc6 Remove type filter in controllers view
This was always temporary until we could search for type via the search box instead,
since it resulted in too much clutter / didn't seem a useful use-case.

As it turns out, searching like this was already possible.
2017-06-29 16:03:53 -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
Matthias Radestock
3209d65d52 filter out unconnected pseudo nodes on the outside
The change is necessitated by the removal of procspied/ebpf endpoint
filtering in the renderers, as a result of which the odd
conntracked-only, unconnected pseudo node can sneak through.

This new way of doing things also makes renderers more composable and
robust, and more directly reflects the objective:
- in the process topologies, filter out all unconnected nodes
- in all other topologies, filter out unconnected pseudo nodes
2017-06-27 20:28:30 +01: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
d0cbf47c1c Add an option group to Combined view to select group type (daemonset or deployment)
This is a union set, so it will be suitable even as we continue to add more node types to this view.
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
Mike Lang
0e54b27e81 Don't omitempty for option group default value
The value "" is meaningful, and the UI does not behave correctly if it's not present.
2017-06-21 15:17:07 -07:00
Mike Lang
383ace4d7e Replace 'none' id for the none option in union types with ''
In union option groups, the list of selected ids is encoded as a comma-delimited string.
For example, if 'foo' and 'bar' are selected, the value 'foo,bar' is sent, ie ["foo", "bar"] -> "foo,bar"
Under this scheme, with nothing selected, the empty string should be sent, ie. [] -> ""

Before this change, the frontend code called the "none option" by id 'none'.
There were several issues with this:
* The frontend would send 'none' when nothing was selected, not ''. The backend ignored this as it ignores
  junk values in the options, treating them as though they hadn't been given.
* The backend would attempt to set the default value of an option to "nothing selected", ie. [], by sending ''.
  The frontend would interpret this as nothing selected, *not even the 'none' option*, which caused a visual bug.
* Everything would break if one of the legitimate options had the id 'none', which could easily happen eg.
  if a user had a 'none' k8s namespace. This is perhaps an unusual name, but our code shouldn't break when
  a particular arbitary string is used as an input.

With this change, the none option is called '', which fixes all the above problems:
* The frontend encodes [''] as ''
* The frontend decodes '' as [''], and therefore shows the '' option as selected
* The string '' is not a valid k8s namespace name and is a reasonable "prohibited value" for all other use cases.
  The backend already couldn't handle a value with this id correctly prior to this change anyway.
2017-06-21 15:03:18 -07:00
Filip Barl
eb64d3f09b Make API calls with time travel timestamp (#2600)
* Node details fetching reports at proper timestamp.

* Corrected all the relevant timestamps in the UI.

* Renamed some state variables.

* Time travel works for topologies list.

* Added a whole screen overlay for time travel.

* Polished the backend.

* Make time travel work also with the Resource View.

* Fixed the jest tests.

* Fixed the empty view message for resource view.

* Some naming polishing.

* Addressed the comments.
2017-06-20 12:31:22 +02:00
Filip Barl
b6dfe25499 Time travel control (#2524)
* Hacky working prototype.

* Operate with time.Duration offset instead of fixed timestamp.

* Polished the backend code.

* Made a nicer UI component.

* Small refactorings of the websockets code.

* Fixed the backend tests.

* Better websocketing and smoother transitions

* Small styling refactoring.

* Detecting empty topologies.

* Improved error messaging.

* Addressed some of David's comments.

* Moved nodesDeltaBuffer to a global state to fix the paused status rendering bug.

* Small styling changes

* Changed the websocket global state variables a bit.

* Polishing & refactoring.

* More polishing.

* Final refactoring.

* Addressed a couple of bugs.

* Hidden the timeline control behind Cloud context and a feature flag.

* Addressed most of @davkal's comments.

* Added mixpanel tracking.
2017-06-12 11:22:17 +02:00
Mike Lang
3aa4a676dd Add new view for daemonsets 2017-05-19 15:06:53 -07:00
Matthias Radestock
f7bba52979 show all namespaces by default
There is nothing special about the "default" namespace, and selecting
it by default means we only show a partial view of the system, which
is hard to spot, especially for novice users.
2017-05-16 09:54:28 +01:00
Mike Lang
e9788459e4 api_topologies: Don't put namespace filters on containers-by-dns/image
This should never have been added. The IsNamespace filter will always return false for these nodes.
It isn't even clear what this filter would mean, even if implemented, since those nodes don't map to a single
container and therefore not to a single namespace.
2017-05-08 13:14:19 -07:00
Mike Lang
51999529a7 Add docker swarm Stack selector ala k8s namespace selector
We have to introduce the kinda hacky concept of a 'No Stack' stack
to reconcile it with the idea of a 'default' k8s namespace. This is important
because swarm services without a stack don't have the same docker labels as ones that do.
Curiously, they still have what appears to be a stack name 'prefix' on their names,
but I can't isolate that name anywhere easily so they'll just have to make do.

I basically copy-pasted updateFilters to make this work, todo go back and refactor
to not duplicate 90% of the code.
2017-04-18 09:08:22 -07:00
Mike Lang
2b208580ab Add new topology view for Docker Swarm services 2017-04-14 17:18:06 -07:00
Mike Lang
9e1666cb49 api_topologies: Change semantics of blank or omitted option values
Instead of value being "" or omitted meaning "use group.Default", we now allow the empty value
to go through. This was done to allow multi-value options to be able to encode 'no options selected'.
This is important as the alternative is very confusing, as 'nothing selected' would generally mean
'match everything', not 'select default' (which in the k8s namespace example, means the "default" namespace).

Since the UI is the only user of this API, and it already sends the default value always, this does not affect
any existing usage.

Since the UI still wants to show a 'match all' button to prevent confusion, but it's not a normal option
(if it were a normal option, it could be combined with others, which isn't meaningful), we add a new key
NoneLabel that indicates the name that should be displayed on this extra button.

Finally, we implement these changes for the k8s namespace button, ie.
- Get rid of All Namespaces option
- Add "All Namespaces" as the NoneLabel
- Default to "" when "default" namespace not present, which is equivalent to the old "all" option.
2017-03-27 10:06:56 -07:00
Mike Lang
bfb68a54a9 api_topologies: Allow selecting multiple k8s namespace filters
This is the first usage of the new 'union' selectType.
Note that we're still sending 'all' for now. There's currently no easy
way to specify this meaning, and arguably it should be done entirely clientside.
But for now it just means some UI weirdness where 'all' is one of the options and having it on
means anything else you select doesn't matter.
2017-03-27 10:06:56 -07:00