Commit Graph

41 Commits

Author SHA1 Message Date
Jonathan Lange
848574eced Make expiration a flag 2016-07-04 14:20:14 +01:00
Jonathan Lange
7dd2c6371e Parametrize window rather than assuming default 2016-07-04 13:50:54 +01:00
Jonathan Lange
c1dab17fb3 Make expiration a Duration 2016-07-04 13:30:23 +01:00
Jonathan Lange
f7bdedc149 Config struct for memcache client 2016-07-04 13:25:45 +01:00
Jonathan Lange
96520d7a46 Fixes to memcache support (#1628)
* Fix errors discovered in dev

* Log an error rather than aborting when memcache doesn't resolve
* Initialize map correctly

* Review tweaks
2016-07-04 11:00:11 +01:00
Jonathan Lange
9e0f0c51b9 Configuration type for AWS collector 2016-06-30 17:01:58 +01:00
Jonathan Lange
baacaa8cc5 Rename dynamoCollector to awsCollector 2016-06-30 16:44:43 +01:00
Jonathan Lange
6520f8f5f3 Pass in memcache client 2016-06-30 09:59:55 +01:00
Jonathan Lange
abec257c59 Just pass in the s3 client 2016-06-30 09:57:49 +01:00
Julius Volz
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
Tom Wilkie
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
Jonathan Lange
47fcb52354 Optional memcached between probes and S3
If given settings for memcached, services will store & fetch reports
from memcache after checking their in-process cache but before fetching
from S3.
2016-06-22 18:40:50 +01:00
Tom Wilkie
a7b34f1601 Use NATS for shortcut reports in the service. (#1568)
* Vendor nats-io/nats

* Use NATS for shortcut reports.

* Review feedback.

* Rejig shortcut subscriptions, so they work.

* Review feedback
2016-06-09 12:48:41 +01:00
Tom Wilkie
982189161b If we don't get a path name from the router, make one up from the url. (#1570)
* If we don't get a path name from the router, make one up from the url.

* Think about route naming a little more and add a comment to show it.
2016-06-09 12:48:22 +01:00
Tom Wilkie
12f281654d Put reports in S3; add in process caching (#1545)
* Add in-process caching to dynamodb collector

* Add metrics for dynamodb consumed capacity and report size

* Log and return errors during report collection

* Increase compression to the max

* Put reports in S3 and just use DynamoDB as an index.

* Review feedback
2016-05-31 15:40:15 +01:00
Tom Wilkie
c8828826ae Allow user to specify table name and queue prefix. (#1538)
* Allow user to specify table name and queue prefix.

* Trim leading slash, catch missed queue prefix

* Comment out publish step until devwww is fixed.
2016-05-25 10:09:32 +01:00
Tom Wilkie
3335361ae9 Include label in prom metric to distinguish ws connection latencies. 2016-05-23 15:02:41 +01:00
Tom Wilkie
901f46c5fc Report if newer version are availible in /api (#1366)
* Report if newer version are availible in /api

* Render version update hint in UI, next to version

* Fix lint
2016-04-22 10:25:00 +01:00
Tom Wilkie
cb0901e8e1 Move all the flag parsing to main.go; implement scope help 2016-04-20 15:48:43 +01:00
Tom Wilkie
da53aac25d Tests & vartious fixes for consul pipe router.
Fix a few bugs in the consul pipe router:
- Don't share a pointer
- Write nil to pipe when closing a bridge connection to ensure the connection shutdown.
- Ensure we shutdown bridge connections correctly
2016-04-12 14:28:10 +01:00
Tom Wilkie
734a01d603 Review feedback, lint & fix tests. 2016-04-06 15:59:02 +01:00
Tom Wilkie
727553962b Insturment the app with prometheus. 2016-04-06 14:58:28 +01:00
Tom Wilkie
5d7604cc21 Print command line when launching the app. 2016-04-06 14:58:23 +01:00
Tom Wilkie
fd368e5e5f Unhack dealing with slashed in node names. 2016-04-06 14:47:14 +01:00
Tom Wilkie
a8f0d64b3c Add middleware for logging each request to the app. 2016-04-06 14:47:08 +01:00
Tom Wilkie
9610e95ed9 Break out factories for app backends, and encode everything in urls. 2016-03-23 15:41:37 +00:00
Tom Wilkie
ac638d17dd Review feedback 2016-03-23 15:41:37 +00:00
Tom Wilkie
9885706402 Multi-tenant backends for app.
Add DynamoDB based collector
    - Store compressed reports in dynamodb

    Add SQS based control router.
    - Uses a queue per probe and a queue per UI for control requests & responses.

    Add Consul-based, horizontally-scalable, multi-tenant pipe router.
    - Uses consul to coordinate each end of pipe connections replicas of a pipe service.
2016-03-23 15:41:37 +00:00
Tom Wilkie
5886dae974 Don't read from app.Version before we initialise it, otherwise we report 'dev' back to the checkpoint service. 2016-03-12 11:01:52 +00:00
Tom Wilkie
0c2617debf Check error in checkpoint callback. 2016-03-04 10:01:11 +00:00
Tom Wilkie
425013bdd9 Update go-checkpoint library and add link to README. 2016-02-29 11:15:14 +00:00
Tom Wilkie
5f7f74bf1b Refactor app for multitenancy
- Add interfaces to allow for alternative implementations for Collector, ControlRouter
  and PipeRouter.
- Pass contexts on http handlers to these interfaces.  Although not used by the current
  (local, in-memory) implementations, the idea is this will be used to pass headers to
  implementations which support multitenancy (by, for instance, putting an authenticating
  reverse proxy in form of the app, and then inspecting the headers of the request for
  a used id).
2016-02-22 14:54:04 +00:00
Tom Wilkie
d4e58b9e33 Decouple Scope lifecycle from Weave lifecycle
- Run the Weave integrations regardless of if weave is detected.
- Make everything backoff and not spam the logs.
- Add miekg dns to vendor.
- Have the app periodically register with weaveDNS, and the probe do lookups there.
- Decide what the local networks are at runtime, not once at startup.
- Correctly resolve app ids, fixes #825
2016-02-09 14:24:57 +00:00
Alfonso Acosta
3d94082b07 Add debug logging 2016-02-05 16:58:40 +00:00
Tom Wilkie
34ca87c98e Review feedback. 2016-02-04 15:48:17 +00:00
Tom Wilkie
2e9aa9314d Periodically check for newer versions of scope. 2016-02-04 15:22:01 +00:00
Tom Wilkie
123c40028f Less hacky fix for /%2F bug 2016-01-14 07:10:31 -08:00
Tom Wilkie
ffa955a21b Split and move xfer package. 2016-01-06 14:01:39 +00:00
Tom Wilkie
667dd0f1de Rationalise version handling 2015-12-11 12:23:01 +00:00
Tom Wilkie
ac9c011475 Pipe plumbing
- Add store of pipes in the app
- Add pipe type, handling impedance mismatch, used in app and probe.
- App <-> Probe pipes have their own websockets.
- Add pipe websocket endpoint in app.
- Pipe IDs are strings, lose the request/response IDs, and give the json encoder lowercase field names.
- Add simple golang ws client, for testing.
- Pipe lifecycle plumbing.
- Ref count and timeout both ends of pipes in the app
- Deal with POST /api/pipe/:pid?_method=delete
- Add end-to-end unit test for pipes.
- Add test for timing out pipes.
- Update go-docker client to tomwilkie/go-dockerclient
- Backend work for non-raw ttys
- Close pipes when they close themselves in the probe
- Ensure all http connections are done before returning from client.Stop()
2015-12-10 12:51:17 +00:00
Tom Wilkie
949ae6f807 Review feedback 2015-12-09 12:45:13 +00:00