Commit Graph

31 Commits

Author SHA1 Message Date
Bryan Boreham
07287c6ac0 Move timestamp up from 'Latest' string map to Report level
We never merge multiple string values in a single node from different
sources, so it's sufficient to take the value from the latest report.
2019-10-19 15:00:55 +00:00
Bryan Boreham
71a359e1d7 Merge pull request #3679 from weaveworks/probe-unsafe-merge
perf(probe): reduce copying of nodes
2019-09-18 15:56:06 +01:00
Bryan Boreham
b6d5594f9f perf(probe): publish delta reports to reduce data size
Similar to video compression which uses key-frames and differences
between them: every N publishes we send a full report, but inbetween
we only send what has changed.

Fairly simple approach in the probe - hold on to the last full report,
and for the deltas remove anything that would be merged in from the
full report.

On the receiving side in the app it already merges a set of reports
together to produce the final output for rendering, so provided N is
smaller than that set we don't need to do anything different.

Deltas don't need to represent nodes that have disappeared - an
earlier full node will have that node so it would be merged into the
final output anyway.
2019-09-18 08:00:28 +00:00
Bryan Boreham
eff5a1f9f7 Refactor: pull Publish() call up to publishLoop() 2019-09-18 08:00:28 +00:00
Bryan Boreham
2f9c9913c4 perf(probe): reduce copying of nodes
Where we know we are merging several reports into the one, we can call
UnsafeMerge() and skip the copy that Merge() will do.
2019-09-15 15:40:28 +00:00
Bryan Boreham
5cba126c12 Merge pull request #3600 from weaveworks/expose-probe-metrics
Expose probe metrics to Prometheus
2019-08-20 14:35:06 +01:00
Bryan Boreham
609d9a7506 Merge pull request #3363 from princerachit/format-error-log
refactor(logs): Add reporter name to error logs.
2019-07-31 14:51:30 +01:00
Bryan Boreham
ab7a7dcb16 Expose probe metrics to Prometheus
We are already timing all report, tag and tick operations.
If Prometheus is in use, expose those metrics that way.

Adjust metrics naming to fit with Prometheus norms.

The previous way these metrics were exposed was via SIGUSR1, and we
can only have one "sink", so make it either-or.

Signed-off-by: Bryan Boreham <bryan@weave.works>
2019-07-09 12:34:05 +00:00
Bryan Boreham
195c4e030e Raise report publishing rate to 30ms default 2018-10-14 12:10:27 +00:00
Bryan Boreham
64197d15be Rate limit report publishing
So that, if many shortcut reports are produced in quick succession,
they will tend to get merged together.

Expand the queue size for shortcut reports, to avoid holding up the
producer so much.
2018-10-13 14:18:52 +00:00
Prince Rachit Sinha
a097b7a590 refactor(logs): Add reporter name to error logs.
1. Adding reporter name to logs improves tracing of error.
2. Capitalize first letter of error log.

Fixes https://github.com/weaveworks/scope/issues/3306

Signed-off-by: Prince Rachit Sinha <prince.rachit@mayadata.io>
2018-09-30 11:29:40 +05:30
Marc Carré
bcbc462842 Fix probe & app's shutdown to please signals.SignalHandlerLoop
Fixes:
```
not enough arguments in call to signals.SignalHandlerLoop
	have ()
	want (logging.Interface, ...signals.SignalReceiver)
```
2018-07-23 20:10:19 +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
Bryan Boreham
56137211b5 probe: Eliminate appclient.reportPublisher
Simplification: move the 'noControls' functionality into the probe, as
we don't need a whole struct to do that.

The ReportPublisher interface also moves into probe where it belongs:
"the consumer should define the interface" - Dave Cheney
2018-06-19 22:59:01 +00:00
Bryan Boreham
96f51c47af probe: Eliminate Publisher interface from app_client
Simplification: everything now implements Publish(Report), and we do
away with writing/reading/writing in the MultiAppClient.
2018-06-19 22:51:25 +00:00
Bryan Boreham
009af5be0c Probe: remove backwards-compatibility code when publishing reports
Removed to reduce CPU and memory usage in probes.

This code was added in August 2016 so that newer probes could be used
with older apps. Since then we have adopted the stance that new apps
will accept reports from old probes but not vice-versa, on a version
change.
2018-06-05 16:47:23 +00: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
Alfonso Acosta
6f1e52cd0d Allow disabling controls in probes 2016-07-01 15:06:06 +00:00
Alban Crequy
42ad3aa12b Scope slow: improve error messages for debugging (#1534)
* alpine: dl-4.alpinelinux.org is dead, use another server

* increase buffer for docker stats

Attempt to avoid the following message:
docker container: dropping stats.

* probe: better timeout error messages

The logs contains the following messages:

Process reporter took longer than 1s
K8s reporter took longer than 1s
Docker reporter took longer than 1s
Endpoint reporter took longer than 1s

This patch prints how long it takes.
2016-05-22 18:21:55 +01:00
Tom Wilkie
b05ef74552 Report hostname and version in probe struct, and version in host node. 2016-04-26 09:25:15 +01:00
Paul Bellamy
f211d48cda Merge pull request #1126 from weaveworks/plugins
Plugins
2016-04-12 18:03:26 +01:00
Paul Bellamy
7632e0b3c5 Adding support for plugins, with basic example of iowait, and ebpf
Squash of:
* Include plugins in the report
* show plugin list in the UI
* moving metric and metadata templates into the probe reports
* update js for prime -> priority
* added retry to plugin handshake
* added iowait plugin
* review feedback
* plugin documentation
2016-04-12 17:22:14 +01:00
Tom Wilkie
281ba58845 Add /api/probes endpoint 2016-04-12 17:17:18 +01:00
Tom Wilkie
4fd680f3b1 Tag shortcut reports. 2016-03-03 16:09:26 +00:00
Paul Bellamy
6c16beb1d4 log a warning when reporters or taggers take too long to generate 2016-02-08 15:27:28 +00:00
Alfonso Acosta
3d94082b07 Add debug logging 2016-02-05 16:58:40 +00:00
Tom Wilkie
ffa955a21b Split and move xfer package. 2016-01-06 14:01:39 +00:00
Tom Wilkie
9142325d54 Instruments probe runtime to find slow reporter. 2015-11-12 17:01:52 +00:00
Tom Wilkie
c610bf0ea1 Review feedback. 2015-11-11 11:42:28 +00:00
Tom Wilkie
92b24793f1 Push mini-reports when container's state changes. 2015-11-10 13:46:57 +00:00
Paul Bellamy
92ec7d9397 Move probe main.go to prog/probe/, break out a probe struct with appropriate responsibilities.
Also adds test for probe 'engine'
2015-11-09 16:25:28 +00:00