223 Commits

Author SHA1 Message Date
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
c2b17f2bbc Add TopologyTagger in all modes
It is essential for rendering many node types, so lift it out of the
condition on Kubernetes cluster mode.
2018-11-26 11:57:21 +00: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
71972c302a Disable host and endpoint reporting in Kubernetes cluster mode
When the probe is run with --probe.kubernetes.role=cluster, disable
host reporting and endpoint reporting since it duplicates what is
being done by the per-host probe.
2018-11-05 21:59:29 +00:00
Yu Cao
308f923e48 use github.com/goji/httpauth instead 2018-11-01 17:51:24 -04: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
fb96fe0024 Turn everything else off in Kubernetes cluster probe 2018-10-12 11:52:34 +00: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
38ea862bfd Check if dockerBridge is nonblank before using it
This gives us the option of disabling the function
2018-10-11 17:54:28 +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
dd21a55a1e Refactor: implement kubernetes tagger in separate struct 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
67b887cb5d Add middleware to detect trace context on HTTP 2018-08-28 13:32:29 +01:00
Marcus Cobden
02ebac68e4 Add a CLI flag to configure the service name 2018-08-09 14:06:57 +01:00
Marcus Cobden
00f311c50a Add Jaeger initialisation for distributed tracing 2018-08-09 13:18:13 +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é
10f6aaf9b7 Pass logger to middleware.Log
Should fix:
```
2018/07/23 20:29:49 http: panic serving 10.244.204.241:34716: runtime error: invalid memory address or nil pointer dereference
goroutine 1169 [running]:
net/http.(*conn).serve.func1(0xc420739a40)
/usr/local/go/src/net/http/server.go:1726 +0xd0
panic(0x17d5200, 0x2a7f5e0)
/usr/local/go/src/runtime/panic.go:502 +0x229
github.com/weaveworks/scope/vendor/github.com/weaveworks/common/middleware.Log.Wrap.func1(0x1dc60e0, 0xc4215e7a40, 0xc4202cee00)
/go/src/github.com/weaveworks/scope/vendor/github.com/weaveworks/common/middleware/logging.go:40 +0x3c7
[...]
```
2018-07-23 22:42:54 +02:00
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é
e07b093b1c Scope now uses signals.SignalHandlerLoop instead of common.*
This fixes:
```
prog/app.go:310:2: undefined: "github.com/weaveworks/scope/vendor/github.com/weaveworks/weave/common".SignalHandlerLoop
prog/probe.go:309:2: undefined: "github.com/weaveworks/scope/vendor/github.com/weaveworks/weave/common".SignalHandlerLoop
```
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
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
Bryan Boreham
31490e4dcb probe: Refactor: Move Weave resolver up to where other apps are added
This makes the next code change easier to see.
2018-06-19 22:59:01 +00:00
Bryan Boreham
dcdd398b60 Probe: fix message to name the correct flag 2018-06-06 12:28:37 +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
Damien Lespiau
f1727232cb probe: Use an absolute FQDN for cloud.weave.works by default
This can save a few DNS queries here and there!
2017-12-08 16:51:15 +00:00
Elena Morozova
c5d38f5c46 Fix golint if/else
if block ends with a return statement, so drop this else and outdent its block
2017-10-13 16:18:17 -07:00
Bruno Galindro da Costa
cd21bafa2e Adds ECS Cluster Region option 2017-09-18 20:14:44 -03:00
Bryan Boreham
fd35ac055d Use the aws config routine from weaveworks/common
so it will allow multiple keep-alive connections to the same
destination
2017-09-15 10:47:38 +00: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
1f95e3efd4 obtain historic_reports capability from Reporter 2017-07-31 09:58:31 +01:00
Matthias Radestock
160ba8efa0 rename 'report_persistence' capability to 'historic_reports'
since that better captures the intent - the UI doesn't care about
reports get stored, but what reports it can retrieve.
2017-07-31 09:31:46 +01:00
Matthias Radestock
6c4efbb944 refactor: reduce number of args 2017-07-26 20:41:29 +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