Commit Graph
910 Commits
Author SHA1 Message Date
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 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 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 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 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
Simon Howe 3851d9c662 Right align numbers, left align strings.
ala excel/spreadsheets etc.
2016-08-12 15:18:39 +02:00
Matthias RadestockandGitHub 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 RadestockandGitHub 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 AcostaandGitHub 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 166bdf13f3 Remove redundant kubernetes ID 2016-08-10 16:01:28 +00:00
Alfonso AcostaandGitHub 9320b10a2e Merge pull request #1780 from weaveworks/1733-scope-loopback-connections
Handle loopback addresses correctly when tracking connections
2016-08-10 14:52:44 +01:00
Alfonso Acosta 3892273096 Append namespace to endpoint scope for loopback connections 2016-08-10 10:43:04 +00:00
Alfonso Acosta b64686ffc3 Identify kubernetes pause containers more broadly 2016-08-08 14:16:07 +00:00
Matthias Radestock 7480654aaf don't complain about closed websockets in pipe connections 2016-08-06 00:06:34 +01:00
Matthias Radestock 4d746a6cf4 log container id in attach/exec errors 2016-08-05 19:23:54 +01:00
Matthias Radestock 3af45583e5 don't log attach/exec close
since we don't log the start either
2016-08-05 19:19:09 +01:00
Matthias RadestockandAlfonso Acosta 1091225bf6 get rid of Node.Copy()
A shallow copy is sufficient. Which we get for free in most cases
since Node is passed around by value.
2016-08-02 12:42:39 +00:00
Alfonso Acosta 8a950a59d6 Remove Metric Add() method
* Helps reduce garbage (MakeMetric() now takes a slice and there's a shorter version MakeSingletonMetric())
* Fixes bug computing Max (Min) in samples since using MakeMetric()
  was causing a default Max/Min of zero.
* Simplifies code a bit
2016-08-01 16:58:11 +00:00
Alfonso Acosta 3e000662f4 Restore custom encoders/decoders for backwards compatibility 2016-08-01 11:07:03 +00:00
Alfonso Acosta b8bf60c6f1 Use slices instead of linked lists for Metric
Also:

* Remove Gob encoder/decoder
* Stop using custom encoders/decoders for Timestamps (both ugorji and the Golang JSON codecs use nanosecond precision).
* Use idiomatic way to check for existence in metric.LastSample()
2016-08-01 10:21:57 +00:00
Matthias Radestock b3874e6e6f show names of stopped containers
This got broken in b78c503

Fixes #1691
2016-07-21 11:01:53 +01:00
Matthias Radestock 34cb6d5a84 reduce container stats log noise
Don't complain about net.errClosing, which we typically get instead of
io.EOF when the container stops.
2016-07-16 20:33:15 +01:00
Matthias Radestock 30a5a9e64b reduce container stats log noise
reduce log level
2016-07-16 20:32:36 +01:00
Matthias Radestock b38913e5c9 tiny improvement: log container id in stats collection loop 2016-07-16 20:12:19 +01:00
Jonathan Lange 2bfd6d7eb7 Parametrize compression level 2016-07-15 11:24:36 +01:00
Alfonso Acosta 26c6249516 Review comments 2016-07-07 16:18:18 +00:00
Alfonso Acosta c843d24f6f Do not infer short-lived connections for host-networking containers 2016-07-07 15:44:13 +00:00
Alfonso Acosta 6175880725 Review feedback 2016-07-05 10:47:57 +00:00
Alfonso Acosta c0a672c02a Review feedback 2016-07-01 16:51:57 +00:00
Alfonso Acosta 6f1e52cd0d Allow disabling controls in probes 2016-07-01 15:06:06 +00:00
Julius VolzandTom Wilkie 4fa40e22b2 Rework Scope metrics according to Prometheus conventions. (#1615)
* Rework Scope metrics according to Prometheus conventions.

- counters should end with _total
- elaborated and added units to help strings
- recommended for cache hit/miss metrics: track only the total and the
  hits and in separate metrics, since the most common query will be
  "hits / total"
- track all times in seconds (base units), which has become the standard
  recommendation
- other small changes

There could be more changes that would require more thinking (what
dimensions to use, summaries vs. histograms, etc.), but this is probably
enough controversial material already :)

* Use timeRequestStatus() in sqs_control_router.go.
2016-06-30 09:12:25 +01:00
Alfonso AcostaandGitHub 05e6193e63 Merge pull request #1607 from weaveworks/1577-print-dns-errors
Print DNS errors
2016-06-28 01:58:54 +02:00
Alfonso Acosta d33358ec63 Review feedback 2016-06-27 16:59:42 +00:00
Tom WilkieandGitHub ab3d34be01 Make it easier to disable weave integrations (#1610)
* Make it easier to disable weave integrations

* Review feedback

* Make test pass
2016-06-27 16:11:57 +01:00
Alfonso Acosta cab948887d Print DNS errors 2016-06-23 10:44:43 +00:00
Jonathan Lange 13269e8110 Helper for reading & writing from binary 2016-06-17 15:24:33 +01:00
Alfonso Acosta e1afe22a22 Add all docker subnets to overlay topology 2016-06-15 21:22:29 +00:00
Alfonso Acosta 0587c6a967 Fix master after merging conflicting PRs #1531 and #1584
They both passed tests separately and were no source-line conflicts ... but shit happens.
2016-06-15 20:23:13 +00:00
Alfonso AcostaandGitHub 5d07b99e69 Merge pull request #1584 from weaveworks/1563-read-docker-networks
Add docker networks to the Overlay Topology
2016-06-15 19:08:30 +01:00
Tom WilkieandGitHub fba555c985 Use image name without version as id. (#1531)
* Use image name without version as id.

* Review feedback
2016-06-15 16:14:51 +01:00
Tom WilkieandGitHub d888509865 Ignore IPv6 addresses in Docker reporter (#1552) 2016-06-15 16:05:12 +01:00
Alfonso Acosta 7fb40c802a Review feedback 2016-06-14 16:53:23 +00:00
Alfonso Acosta 6f0a31d1cd Add docker networks to the Overlay Topology 2016-06-14 14:58:43 +00:00