Commit Graph

2588 Commits

Author SHA1 Message Date
David Kaltschmidt
51bb6263bc Add support for table based controls
* if a node table has `controls` they will be rendered in a row
* controls need the to be of the same structure as node-level controls
* control errors are not shown
2016-08-18 22:28:01 +01:00
Alfonso Acosta
0f0c795416 Merge pull request #1816 from weaveworks/spelling-fixes
Fix spelling mistakes
2016-08-18 19:07:03 +01:00
Alfonso Acosta
c10c58459b Fix spelling mistakes 2016-08-18 17:48:45 +00:00
Tom Wilkie
38cc5aa29e On circle, report username as circle to wcould (#1815) 2016-08-18 12:06:49 +01:00
Matthias Radestock
bdd97c7591 Merge pull request #1807 from weaveworks/1806-restore-probe-compatibility
restore compatibility of old probes with new m/t app

Fixes #1806.
2016-08-17 12:09:33 +01:00
Matthias Radestock
6ba812e82f restore compatibility of old probes with new m/t app
This got broken in #1682
2016-08-16 23:53:07 +01:00
Mike Lang
21cfc83a56 Use image-tag from build-tools (#1785)
* Squashed 'tools/' changes from e9e7e6b..db5efc0

db5efc0 Merge pull request #28 from weaveworks/mike/add-image-tag
5312c40 Import image-tag script into build tools so it can be shared
7e850f8 Fix logs path
dda9785 Update deploy api
f2f4e5b Fix the wcloud client
3925eb6 Merge pull request #27 from weaveworks/wcloud-events
77355b9 Lint
d9a1c6c Add wcloud events, update flags and error nicely when there is no config

git-subtree-dir: tools
git-subtree-split: db5efc0537

* Remove ./image-tag and use ./tools/image-tag instead

image-tag is now shared code from the build-tools repo
2016-08-16 15:52:12 +01:00
Alfonso Acosta
b3b160ceb0 Merge pull request #1791 from weaveworks/release-0.17
Release 0.17.0
2016-08-16 15:04:29 +01:00
Alfonso Acosta
fc4bdf0a14 Merge pull request #1798 from weaveworks/1683-start-stats-idempotent
Make stats gathering idempotent
v0.17.0
2016-08-16 14:16:22 +01:00
Alfonso Acosta
8b97f12ab1 Make stats gathering idempotent 2016-08-16 12:50:22 +00:00
Paul Bellamy
6e2fe78cab Merge pull request #1682 from kinvolk/krnowak/plugin-controls
RFC: forwarding control requests to plugins
2016-08-16 13:44:42 +01:00
Matthias Radestock
33d5d3768a Merge pull request #1796 from weaveworks/fix-report-store-chaining
fix report store query chaining

Fixes weaveworks/service#769
2016-08-16 08:30:27 +01:00
Matthias Radestock
e6a474ead7 fix report store query chaining
We fell victim to variable shadowing here. Each store would be fed the
original list of report keys, instead of only the ones that weren't
found in the previous store. So if a single report was missing from the
in-process cache, we would then fetch all reports from memcache. And if
that in turn was missing a single report we would fetch all reports from
S3.

We chain report stores for a reason - to reduce latency and, in case of
the in-process cache, eliminate decoding costs. So this bug has a huge
impact on query service performance.

To make matters worse, we return *all* the reports - now possibly in
triplicate. Fortunately, the SmartMerger filters these out, so at least
we were not incurring extra merge costs.
2016-08-16 00:55:39 +01:00
Matthias Radestock
ed5463facd Merge pull request #1792 from weaveworks/more-accurate-memcache-hit-ratio
allow more accurate reporting of memcache hit ratio
2016-08-15 16:51:35 +01:00
Matthias Radestock
d6e5f0a154 allow more accurate reporting of memcache hit ratio
A lot of time could pass between recording the request count and hit
count pertaining to a particular report fetching batch, which skewed
calculations cache hit ratios.

Fix that by defering the request count recording to the end, which is
when we record the hit count.
2016-08-15 16:25:12 +01:00
Alfonso Acosta
a4d5eb3d54 Review feedback 2016-08-15 15:20:35 +00:00
Alfonso Acosta
8c0c7d3fe9 Fix spelling mistake 2016-08-15 14:42:59 +00:00
Alfonso Acosta
554bc7ecd2 Release 0.17.0 2016-08-15 14:23:29 +00:00
Matthias Radestock
1a1021caae Merge pull request #1788 from weaveworks/fix-memcache-client-miss-and-leak-on-corrupt
fix MemcacheClient.FetchReports miss & leak on corrupt report
2016-08-15 11:33:25 +01:00
Jonathan Lange
14d0e4edfe Merge pull request #1787 from weaveworks/1767-docker-client-leak
Bump github.com/fsouza/go-dockerclient
2016-08-15 11:02:35 +01:00
Matthias Radestock
9cf178f130 fix MemcacheClient.FetchReports miss & leak on corrupt report
Problem: Decoding a corrupt report grows the 'missing' list. Since we
are waiting for 'len(keys)-len(missing)' decoder go-routines, this
results in waiting for fewer go-routines than we should. The surplus
go-routines leak and we ignore their reports. And since the keys of the
ignored reports are not included in 'missing', we won't attempt to fetch
them from S3 either. Oops.

Fix: calculate the number of go-routines once, at the beginning.
2016-08-15 10:44:29 +01:00
Alfonso Acosta
c39b16ae9f Bump github.com/fsouza/go-dockerclient
To include https://github.com/fsouza/go-dockerclient/pull/562 , which
fixes https://github.com/weaveworks/scope/issues/1767
2016-08-15 09:34:18 +00:00
Simon
6f9912501d Merge pull request #1784 from weaveworks/1745-right-align-column-numbers
Right align numbers, left align strings.
2016-08-15 09:43:31 +02:00
Krzesimir Nowak
0ecb908c22 Ensure backward compatilibity in report's node controls
The new probe will convert all node's LatestControls to Controls, so
the old app can consume them. Also, the new app will convert all
node's Controls to LatestControl, so it can consume the reports from
old probes.
2016-08-12 17:15:43 +02:00
Krzesimir Nowak
2a0972653c Rewrite plugin readme
Give a bit more information about how to write a plugin.
2016-08-12 17:15:43 +02:00
Krzesimir Nowak
9e092f1a4a Switch to LatestMap-style node controls
This allows plugins to add controls to nodes that already have some
controls set by other plugin. Previously only the last plugin that
sets the controls in the node would have its controls visible. That
was because of NodeControls' Merge function that actually weren't
merging data from two inputs, but rather returning data that was newer
and discarding the older one.
2016-08-12 17:15:43 +02:00
Krzesimir Nowak
5fdb8a5362 Add a concrete version of LatestMap for node controls
This LatestMap will hold a struct that has more information about the
state of the node control.
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
7f46b90e27 Make LatestMap "generic"
This commit makes the LatestMap type a sort of a base class, that
should not be used directly. This also adds a generator for LatestMap
"concrete" types with a specific data type in the LatestEntry.
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
0116b963e3 Extend the node control rewriting test
Just to make sure that all the node controls are rewritten, even those
that don't have a counterpart in topology controls.
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
1f5dbb776f Add shortcut reports for plugins.
Plugins are queried for reports two times in a second. That's often
enough to get the shortcut reports. The reports are sent together with
the response.
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
cecf70ecd5 Marshal structs in the plugins registry tests
This is better than writing JSON strings by hand, which is
error-prone.
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
f17a995892 Marshal structs in the iowait example plugin
This is better than writing JSON strings by hand, which is
error-prone.
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
69368af796 Make the iowait example plugin a controller too
It exposes a button that allows switching between showing an iowait
statistics and an idle statistics. When the button is pressed it
should be replaced with other button. The button is shown in the host
node.

This is a rather nasty case as it shows several problems:

- Button control races
  - The way the NodeControl currently works creates races between
    plugins adding buttons to the same node. This is because
    NodeControls are not really merged, but rather one of the two are
    chosen based on a NodeControls' timestamps, so the older one is
    thrown away entirely. In the end GUI can switch randomly between
    showing controls from one plugin or from another.

- Showing outdated statistics
  - When pressing the button to switch to show the other statistics,
    the old ones are still shown for several seconds.

- Slowness of the updates in GUI
  - Pressing the button yields no immediate reaction. Changes happen
    after several seconds. Probably related to the previous point.
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
27e0550bd5 Run docker with sudo if necessary in iowait makefile
The solution is taken from the toplevel Makefile.
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
0e06423a37 Forward control requests to plugins
Thanks to that, plugins can react to requests from controls they
exposed.

To make it work, plugins registry modifies each plugin's report by
prepending the plugin ID to the control name the plugin has exposed
before sending it to the app. Then the registry installs the control
request handler for this faked control name, which forwards the
request to the correct plugin.

This adds a new API endpoint to plugins next to "/report" - a
"/control" entry. The body of the request is the JSON-encoded
xfer.Request instance.
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
41193b428e Make control handlers registry an object and extend its functionality
It is not a singleton anymore. Instead it is an object with a registry
backend. The default registry backend is provided, which is equivalent
to what used to be before. Custom backend can be provided for testing
purposes.

The registry also supports batch operations to remove and add handlers
as an atomic step.
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
c6b5d98699 Test the case when a plugin reports more than one plugin 2016-08-12 17:03:42 +02:00
Krzesimir Nowak
993eebeea9 Remove impossible case of an empty plugin ID
Plugin ID must be non-empty when the plugin is created and the
followup reports cannot change it.
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
9d48fdc32c Restrict the set of allowed characters in plugin IDs
We will want to put plugin id in a control id, which is sent to an app
and then to GUI. When we get a control request from GUI, we will want
to extract the plugin ID from the control name. To do it unambiguously
we need some separator made of chars that are not allowed in a plugin
name. This is to avoid the situation when there are two plugins:
"Plugin" and "PluginFoo". "Plugin" exposes a control named
"FooControl" and "PluginFoo" exposes a control named "Control". Faking
the control names which will be sent to the app would result in two
"PluginFooControl".

One possible option for plugin ID and control name separator would be
"/", but that won't work, since the request sent from GUI to the app
to <probe>/<node>/<control> would actually be
<probe>/<node>/<plugin>/<control> and as such wouldn't match the URL
template in RegisterControlRoutes().
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
c797e7ab0e Use consistent plugin ID in the http-requests plugin
The socket has the "http_requests.sock" filename, so ID should be
"http_requests", not "http-requests".
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
ccd26fe69d Ban the possibility of changing plugin's ID
Changing plugin's ID only complicates control handling in plugins so
let's ban it.
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
1f222b9156 Make dumper a bit more verbose
So it displays differences behind interface that would otherwise go
unnoticed (like string vs []byte).
2016-08-12 17:03:42 +02:00
Krzesimir Nowak
0f1cb82084 Allow testing only a subset of directories
This can be done by calling TESTDIRS="./report ./probe" make tests
2016-08-12 17:03:42 +02:00
Simon Howe
3851d9c662 Right align numbers, left align strings.
ala excel/spreadsheets etc.
2016-08-12 15:18:39 +02:00
Matthias Radestock
6334836f69 Merge pull request #1768 from weaveworks/1202-silence-abnormal-close
silence abnormal websocket close

Fixes #1202.
2016-08-12 13:53:51 +01:00
Matthias Radestock
21c188d600 Merge pull request #1739 from weaveworks/1730-no-node-copy
Remove and optimize more Copy()s
2016-08-12 12:30:54 +01:00
Alfonso Acosta
cfb686b546 Merge pull request #1774 from weaveworks/1759-remove-k8s-id-col
Remove kubernetes_id column from the grid view.
2016-08-11 17:43:21 +01:00
Alfonso Acosta
22434616fa Merge pull request #1782 from weaveworks/1779-elide-service-token
Elide service-token when logging commandline arguments
2016-08-11 17:12:27 +01:00
Alfonso Acosta
04349cc86d Merge pull request #1783 from weaveworks/1777-do-not-bitch-on-stop
Don't complain when stopping Scope if it wasn't running
2016-08-11 16:57:05 +01:00
Alfonso Acosta
0c3235ae3d Review feedback 2016-08-11 15:41:07 +00:00