Commit Graph

96 Commits

Author SHA1 Message Date
Bryan Boreham
63d6a72727 feature: allow user to disable plugins via command-line flag 2019-10-06 17:35:26 +00:00
Bryan Boreham
395282b043 help: add note on constraint to -full-report-every argument 2019-09-18 11:09:49 +00: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
Roland Schilter
f8412c3204 Rename :orgId to :instanceId in metrics graph url
- Renames placeholders `:orgId` to `:instanceId` in
  `--app.metrics-graph`
- Adjusts frontend client to use the provided instanceId by its host
  application (Weave Cloud)
2018-12-17 17:57:00 -08:00
Bryan Boreham
62d55596c6 Merge pull request #3393 from ycao56/basic-auth
Add http Basic Auth
2018-11-07 14:32:03 +00:00
Bryan Boreham
ee0ce7b087 Merge pull request #3384 from weaveworks/drop-big-topologies
In multitenant app, drop all nodes for big topologies
2018-11-01 17:21:55 +00:00
Yu Cao
b2a664c27b fix build 2018-10-18 15:09:17 -04:00
Yu Cao
12f64701a2 adjust env overrides logic 2018-10-17 21:44:07 -04:00
Yu Cao
49aaaef61b fix log 2018-10-17 19:33:58 -04:00
Yu Cao
5327fe197a fix typo 2018-10-17 19:33:30 -04:00
Yu Cao
10b74a4333 change env name 2018-10-17 19:32:51 -04:00
Yu Cao
fcdd217057 use env to override basic auth settings 2018-10-17 19:25:41 -04:00
Yu Cao
b5190d45cd basic auth 2018-10-17 19:25:12 -04:00
Bryan Boreham
78eaf93c21 Make flag names easier to understand
Now you specify a role instead of controlling the internal behaviour
2018-10-12 08:06:32 +00:00
Bryan Boreham
98d52bd480 Allow kubelet port to be disabled 2018-10-11 17:54:29 +00:00
Bryan Boreham
88049b0817 Add option for Kubernetes tagging when kubernetes probing disabled
This enables us to run Kubernetes probing on one node for the whole cluster.
2018-10-11 17:54:28 +00:00
Bryan Boreham
05b350850f Drop topologies which are way too big 2018-10-11 17:20:16 +00:00
Marcus Cobden
02ebac68e4 Add a CLI flag to configure the service name 2018-08-09 14:06:57 +01:00
Lili Cosic
b971bea426 Disable CRI probe by default
This was enabled by default but we want it to be disabled instead, just
like with the docker probe.
2018-08-08 09:58:33 +02:00
Lili Cosic
e6d9bcc1cb Add CRI probe
When the probe.cri is enabled the CRI probe will be used to gather
the container information via the CRI API. For now only the basic
information is included in the generated report, those that we can get
via the CRI ListContainersRequest.
2018-07-26 10:51:59 +01: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
80dbd3443c probe: Add -probe.publish.stdout option for debugging
This option gives a crude way to view the raw probe data as json in
the container logs, so that you can check exactly what it would have
sent.

We stub out the PipeClient interface with a dummy implementation in
this mode.
2018-06-19 22:59:01 +00:00
Marcus Cobden
ba81924278 Add CLI flag for SQS RPC timeout 2018-05-04 10:11:25 +01:00
Matthias Radestock
24672ed046 do not truncate tables
Limiting env vars, docker&k8s labels, and weave net connection entries
to 20 is problematic because

- the truncation is arbitrary - there is a good chance that if you
care about a specific entry it won't be there

- the truncation is not consistent - different entries get truncated
at different times

- some of the rendering logic depends on specific labels, for example
namespace filtering of containers depends on the
`io.kubernetes.pod.namespace` label.

In practice, there should never be a huge number of labels, or Weave
Net connection entries. So there is no need to truncate them.

That leaves env vars. These are of limited use, so we now omit them by
default. If they are included they are included in full, so they are
actually useful.

Fixes #3127
2018-04-12 17:13:58 +01:00
Bryan Boreham
1de6d9755a Remove -probe.kubernetes.interval flag entirely 2018-02-22 15:05:20 +00:00
Bryan Boreham
43eda261ee Disable polling of Kubernetes by default
We set up a "watch" on everything we need so there is no reason to
poll repeatedly.
2018-02-20 17:39:10 +00:00
Bryan Boreham
04002f3287 Fix doc string for -probe.kubernetes 2018-02-19 17:41:32 +00:00
Bryan Boreham
dc1b768e73 Allow Kubernetes node-name to be set from env var
If we have the node-name then we can save work requesting the list of
local pods from kubelet.  And the best way to get the node name is via
the "downwards api", i.e. put this in the Daemonset Yaml:

        - name: KUBERNETES_NODENAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
2018-02-19 17:31:04 +00:00
Bruno Galindro da Costa
cd21bafa2e Adds ECS Cluster Region option 2017-09-18 20:14:44 -03: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
Matthias Radestock
1f87e3dc0a simplify probe.token/service-token usage
Addresses part of #2304.
2017-08-14 12:50:03 +01:00
Matthias Radestock
9cc6cdbd5f increase default conntrack buffer size
The figure is based on our experience of running scope probes in
production systems. Below this we see a lot of "conntrack
stderr:WARNING: We have hit ENOBUFS! We are losing events."
2017-07-24 12:28:56 +01:00
Bryan Boreham
3e9eb83d12 Use Kubernetes node name to filter pods if possible 2017-07-13 16:24:17 +00:00
Roland Schilter
651e52b5a5 Honor DOCKER_* env variables in probe and app
Changed default for flag `-app.docker` to use the DOCKER_* env variables
instead of hardcoded /var/run/docker.sock; uses docker's default if
no DOCKER_HOST defined, for both probe and app.

Fixes #1975
2017-06-27 17:14:49 +02:00
Roland Schilter
11355bbf4b Elide token-only credentials in cli arguments
Follow-up of #2568
2017-06-13 13:14:09 +02:00
Roland Schilter
2e4f4a3771 Elide url passwords in cli arguments (#2568)
Closes #2365
2017-06-07 10:18:18 +01:00
Alfonso Acosta
7ca8749b18 Enable eBPF tracking by default 2017-05-31 10:04:52 +00:00
Matthias Radestock
bf02eb0cc7 fix typos in usage info 2017-05-16 09:15:42 +01:00
Matthias Radestock
413dbc7f0c allow disabling of weaveDNS advertising/lookup
...while keeping other weave integrations, by setting
--weave.hostname=

Addresses a suggestion in #1550.
2017-04-15 00:02:07 +01:00
Paul Bellamy
e68ffd467e Add app/multitenant/billing_emitter to emit billing events 2017-03-22 10:41:34 +00:00
Iago López Galeiras
9920c4ea48 Add eBPF connection tracking without dependencies on kernel headers
Based on work from Lorenzo, updated by Iago, Alban, Alessandro and
Michael.

This PR adds connection tracking using eBPF. This feature is not enabled by default.
For now, you can enable it by launching scope with the following command:

```
sudo ./scope launch --probe.ebpf.connections=true
```

This patch allows scope to get notified of every connection event,
without relying on the parsing of /proc/$pid/net/tcp{,6} and
/proc/$pid/fd/*, and therefore improve performance.

We vendor https://github.com/iovisor/gobpf in Scope to load the
pre-compiled ebpf program and https://github.com/weaveworks/tcptracer-bpf
to guess the offsets of the structures we need in the kernel. In this
way we don't need a different pre-compiled ebpf object file per kernel.
The pre-compiled ebpf program is included in the vendoring of
tcptracer-bpf.

The ebpf program uses kprobes/kretprobes on the following kernel functions:
- tcp_v4_connect
- tcp_v6_connect
- tcp_set_state
- inet_csk_accept
- tcp_close

It generates "connect", "accept" and "close" events containing the
connection tuple but also pid and netns.
Note: the IPv6 events are not supported in Scope and thus not passed on.

probe/endpoint/ebpf.go maintains the list of connections. Similarly to
conntrack, it also keeps the dead connections for one iteration in order
to report short-lived connections.

The code for parsing /proc/$pid/net/tcp{,6} and /proc/$pid/fd/* is still
there and still used at start-up because eBPF only brings us the events
and not the initial state. However, the /proc parsing for the initial
state is now done in foreground instead of background, via
newForegroundReader().

NAT resolution on connections from eBPF works in the same way as it did
on connections from /proc: by using conntrack. One of the two conntrack
instances is only started to get the initial state and then it is
stopped since eBPF detects short-lived connections.

The Scope Docker image size comparison:
- weaveworks/scope in current master:  22 MB (compressed),  68 MB
  (uncompressed)
- weaveworks/scope with this patchset: 23 MB (compressed), 69 MB
  (uncompressed)

Fixes #1168 (walking /proc to obtain connections is very expensive)

Fixes #1260 (Short-lived connections not tracked for containers in
shared networking namespaces)

Fixes #1962 (Port ebpf tracker to Go)

Fixes #1961 (Remove runtime kernel header dependency from ebpf tracker)
2017-03-08 22:11:12 +01:00
Alfonso Acosta
052ff39bf1 Merge pull request #2309 from weaveworks/2258-fix-kubelet-access
Fix kubelet failure fallback and make port configurable
2017-03-08 10:15:21 -08: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
Alfonso Acosta
c1fa5bb665 Fix kubelet failure fallback and make port configurable 2017-03-07 13:29:02 +00:00
Matthias Radestock
a391ae8a3d Merge pull request #2301 from weaveworks/report-playback
report playback
2017-03-05 13:03:53 +00:00
Matthias Radestock
289b4c63af report playback
Now you can launch the scope app with something like

./prog/scope --mode=app --weave=false --app.collector=file:///tmp/reports

and if the specified dir contains reports with filenames in the form
<timestamp>.{msgpack|json}[.gz],
e.g. "1488557088545489008.msgpack.gz", then these reports are replayed
in a loop at a sequence and speed determined by the timestamps.
2017-03-04 22:04:50 +00:00
Matthias Radestock
df41a808c2 parse probe-only flag as intended 2017-03-04 11:22:00 +00:00
Mike Lang
dee274e438 Merge pull request #2065 from weaveworks/mike/ecs/caching
ECS reporter: Minimize API calls by caching task and service data
2017-01-24 11:03:51 -08:00