65 Commits

Author SHA1 Message Date
Filip Barl
97fdcdc525 Option to censor raw reports by command line args and env vars. 2019-02-15 17:31:08 +01:00
Bryan Boreham
2ec58da1cf Don't report dead processes
If the state is reported as dead or zombie, return an error so the
process will be skipped.
2018-10-09 14:32:02 +00:00
meghalidhoble
625998b91e Change made to the listed files, to enable weaveworks-scope on Power(ppc64le)
1)backend/Dockerfile 2) probe/endpoint/dns_snooper.go
3) client/Dockerfile 4) docker/Dockerfile.cloud-agent
5) probe/process/walker_linux_test.go & 6) tools/lint

1)'backend/Dockerfile' : Conditional added so that the cross-compiling should
   be done on amd64. Also removed support for sh-lint for ppc64le for now.
   As the version for shfmt mentioned in the dockerfile is not available for
   ppc64le and the later version does't work fine with existing application.
2)'probe/endpoint/dns_snooper.go' : Renamed this file so as to reuse for ppc64le
   and added a build-constraint. Now this file will be build for amd64 on linux
   and ppc64le on linux.
3)'client/Dockerfile' : Modified the version of the base image for node from
   8.4.0 to 8.11, as this version supports multiarch.
4)'docker/Dockerfile.cloud-agent' : Modified the version of the base image for
   golang from 1.10.2-strech to 1.10.2, which supports multiarch.
5) 'probe/process/walker_linux_test.go' : Test fixed to run for ppc64le,
    modified the code to accept RSSBytes based on pageSize value per
    architecture, instead of hard-coded values.
6)'tools/lint' : Modified the file to skip the sh-lint implementation for ppc64le.

PR #3231
2018-08-13 12:45:25 +05:30
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
c06429b92a Remove unused process tree function GetChildren() 2018-02-26 08:54:31 +00:00
Bryan Boreham
b742846835 Optimise processTopology() (#3074)
* Add a benchmark for processprocessTopology()

* Shortcut merging with an empty set

* Use more efficient apis to create process node
2018-02-19 10:13:58 +00:00
Matthias Radestock
1f2247a8c4 move node metadata keys into report package
Both the probe and the app (for rendering) need to know about them.
2017-12-11 20:26:08 +00:00
Filip Barl
320b9e240f Abstracted the report data types. 2017-11-03 10:43:41 +01:00
Alban Crequy
d715ccc391 ebpf: handle fd_install events from tcptracer-bpf
Since https://github.com/weaveworks/tcptracer-bpf/pull/39, tcptracer-bpf
can generate "fd_install" events when a process installs a new file
descriptor in its fd table. Those events must be requested explicitely
on a per-pid basis with tracer.AddFdInstallWatcher(pid).

This is useful to know about "accept" events that would otherwise be
missed because kretprobes are not triggered for functions that were
called before the installation of the kretprobe.

This patch find all the processes that are currently blocked on an
accept() syscall during the EbpfTracker initialization.
feedInitialConnections() will use tracer.AddFdInstallWatcher() to
subscribe to fd_install  events. When a fd_install event is received,
synthesise an accept event with the connection tuple and the network
namespace (from /proc).
2017-05-19 14:49:38 +02:00
Alban Crequy
598c6a0238 proc walker: cache limits and cmdline/name after parsing 2017-05-05 13:05:08 +02:00
Alban Crequy
3a8a09a606 proc walker: optimize readLimits 2017-05-05 13:05:08 +02:00
Alban Crequy
bdb09f5f9d proc walker: optimize readStats 2017-05-05 13:05:08 +02:00
Alban Crequy
640b240469 proc walker: optimize open file counter
Golang's ReadDirNames is expensive and better avoided when we don't care
about the names.
2017-05-02 14:45:12 +02:00
Matthias Radestock
245c2e9149 fall back to /proc/<pid>/comm for process name
when proc/<pid>/cmdline is empty, which is the case for some system
and defunct processes.

Fixes #2315
2017-03-09 14:02:32 +00:00
Alfonso Acosta
8bf753a51b Revert "Revert "Add options to hide args and env vars (#2306)"" (#2311)
* Revert "Revert "Add options to hide args and env vars (#2306)""

* Make linter happy
2017-03-08 02:16:42 -08:00
Alfonso Acosta
dcc7389127 Revert "Add options to hide args and env vars (#2306)"
This reverts commit 764afb6301.
2017-03-07 17:51:27 +01:00
Mike Bryant
764afb6301 Add options to hide args and env vars (#2306)
* Add options to hide args and env vars

To allow for use of weave-scope in an unauthenticated environment,
add options to the probe to hide comand line arguments and
environment variables, which might contain secret data.

Fixes #2222

* Change docker.NewRegistry arguments to be a struct

* Remove redundant declarations of default values

* Move registry options outside to improve readability
2017-03-07 08:51:18 -08:00
Jonathan Lange
1020fc5f85 Use test.Diff from common 2016-12-07 11:22:40 +00:00
Jonathan Lange
b5c750ddea Move test & fs 2016-12-07 11:22:39 +00:00
Jonathan Lange
e8085b01b6 Use 'common' library 2016-12-07 11:22:38 +00:00
Simon Howe
3851d9c662 Right align numbers, left align strings.
ala excel/spreadsheets etc.
2016-08-12 15:18:39 +02: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
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
Paul Bellamy
1edeb8d190 Removing report.Node.WithID (#1315)
* removing usage of report.Node.WithID

* report.Topology.AddNode can use the node's ID field
2016-04-19 16:48:03 +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
Paul Bellamy
c075939379 Forgot debug println 2016-04-07 12:33:34 +01:00
Paul Bellamy
b970b0561b Set the memory and open files maximums
process memory limit is not cgroup-aware
2016-04-06 13:07:55 +01:00
Paul Bellamy
44dada25f2 Review Feedback 2016-02-16 10:37:25 +00:00
Paul Bellamy
5bb3d49297 gather file descriptors as process metric 2016-02-12 17:13:27 +00:00
Tom Wilkie
6b56475766 Use ps.Map for Counters and Sets, remove Metadata in favour of Latest.
Also
- Add more complicated report.json for benchmark
- Break up report/topology.go
- Implement our own DeepEqual for ps.Map
2016-01-22 15:10:32 -08:00
Paul Bellamy
bf57aeb8d9 Rename the various metric keys so they don't accidentally overlap 2016-01-20 16:14:32 +00:00
Tom Wilkie
e9e152b9a3 Use argv[0] for process name to be more like ps. 2016-01-06 11:55:34 +00:00
Tom Wilkie
2faa58aa41 Merge pull request #776 from weaveworks/tracer
Tracer!
2015-12-17 13:55:10 +00:00
Tom Wilkie
13a82bc9a8 Make it lint and compile after rebase. 2015-12-16 15:30:53 +00:00
Tom Wilkie
3e4b3ad0eb Trace all processes in a container. 2015-12-16 15:21:34 +00:00
Tom Wilkie
8efa0d147b Review feedback 2015-12-16 14:38:22 +00:00
Tom Wilkie
caff695f96 Gather per-process CPU and memory metrics. 2015-12-16 14:38:21 +00:00
Tom Wilkie
cde5920f9a Cache the contents of some files in /proc
Also cache contents of /proc/foo/stat, but only for 10s.
2015-12-11 10:27:15 +00:00
Tom Wilkie
1fcd079563 Use Readdirnames to reduce number of stats we're doing. 2015-12-10 14:43:40 +00:00
Tom Wilkie
cc5935a89d Review feedback 2015-12-10 14:10:36 +00:00
Tom Wilkie
ed6c4088fa Fix up tests. 2015-12-10 14:00:43 +00:00
Tom Wilkie
9142325d54 Instruments probe runtime to find slow reporter. 2015-11-12 17:01:52 +00:00
Tom Wilkie
76d34330a9 Add Control plumbing. 2015-11-06 17:39:48 +00:00
Tom Wilkie
925851169e Use AddNode when adding nodes to the topology, such that the get merged with any existing node that might be there. 2015-09-15 10:02:58 +00:00
Tom Wilkie
7d6b5a540e Revert "Merge pull request #450 from weaveworks/scope-284"
This reverts commit 46345e3bdb, reversing
changes made to bf3e9a1601.

Conflicts:
	probe/process/walker_darwin.go
2015-09-15 03:14:39 +00:00
Alvaro Saurin
2f9f54688f Keep a cache of open files, reducing the number of open/close cycles in the /proc dir 2015-09-14 10:59:23 +02:00
Alvaro Saurin
14dc6a5391 Cache processes and connections when reading from the /proc
Code cleanups
2015-09-14 10:53:24 +02:00
Alvaro Saurin
4331fb1c79 Drop all the dependencies we had on procspy by moving some code to probe. 2015-09-14 10:44:53 +02:00
Tom Wilkie
b7c22b7a8f Only fetch weave status report once per tick. 2015-09-09 15:08:43 +00:00
Tom Wilkie
57f7b4f2e6 Rename NodeMetadata -> Node 2015-09-03 16:18:54 +00:00