Commit Graph
87 Commits
Author SHA1 Message Date
Paul Bellamy 3fa86fe6ce adding -version flag back into app and probe for the release script 2015-08-19 10:37:02 +01:00
David Kaltschmidt 0e82f6b856 static build of relative paths 2015-08-11 09:50:34 +00:00
Peter Bourgon 7d51f173ea Probes POST to apps
- App takes POST report on /api/report
- Probe publishes to configured target(s)
- Name resolution happens on probe-side
- There's no longer an xfer.ProbePort
- xfer.Collector responsibility is reduced
- Fixes to remaining experimental components.
- rm experimental/bridge: it's not being used, and by changing the
  app/probe comm model, it would require a complete refactor anyway. We
  can easily rebuild it when we need to. It will even be much simpler.
- rm experimental/graphviz: it's broken for some time anyway, and we
  don't really need to play around with it as a rendering option
  anymore.
- rm experimental/oneshot: we never use this anymore.
2015-08-07 15:45:15 +02:00
Tom Wilkie 5a29b1b9fe Merge pull request #343 from weaveworks/no-logging-options-please
app may only log to stderr, just like probe
2015-08-06 19:12:57 +01:00
Peter Bourgon 3fd5fbcf25 app may only log to stderr, just like probe 2015-08-06 19:30:58 +02:00
Peter Bourgon 0dafad763f Calculate rates in detailed nodes 2015-08-03 16:04:06 +02:00
Peter Bourgon e1f7752a34 Split PacketCount to Egress and Ingress
Also, 1 packet may be counted in N topologies, so you can't rely on the
sum of all packet counts across topologies having any relation to the
sampling data.
2015-08-03 14:58:41 +02:00
Peter Bourgon 0aadf6447b Revert to correct edge construction
Another implicit invariant in the data model is that edges are always of the
form (local -> remote). That is, the source of an edge must always be a node
that originates from within Scope's domain of visibility. This was evident by
the presence of ingress and egress fields in edge/aggregate metadata.

When building the sniffer, I accidentally and incorrectly violated this
invariant, by constructing distinct edges for (local -> remote) and (remote ->
local), and collapsing ingress and egress byte counts to a single scalar. I
experienced a variety of subtle undefined behavior as a result. See #339.

This change reverts to the old, correct methodology. Consequently the sniffer
needs to be able to find out which side of the sniffed packet is local v.
remote, and to do that it needs access to local networks. I moved the
discovery from the probe/host package into probe/main.go.

As part of that work I discovered that package report also maintains its own,
independent "cache" of local networks. Except it contains only the (optional)
Docker bridge network, if it's been populated by the probe, and it's only used
by the report.Make{Endpoint,Address}NodeID constructors to scope local
addresses. Normally, scoping happens during rendering, and only for pseudo
nodes -- see current LeafMap Render localNetworks. This is pretty convoluted
and should be either be made consistent or heavily commented.
2015-08-03 10:55:59 +02:00
Peter Bourgon b9afa67ad6 gopacket-based traffic sniffing 2015-08-03 10:55:59 +02:00
Peter Bourgon 3dd59c8b9b Fixes to NodeMetadata
NewNodeMetadata -> MakeNodeMetadata. It doesn't return a pointer, so
Make is more idiomatic.

Invoke MakeNodeMetadata when necessary. The zero value for a
NodeMetadata is no longer valid.

Split MakeNodeMetadata to two constructors. MakeNodeMetadata when you
don't have anything to prepopulate; MakeNodeMetadataWith when you do.

Also, a fix to the tests in app. We unmarshal a RenderableNode struct,
which has a JSON-ignored NodeMetadata field. The zero value is invalid,
so we need to fix that before performing comparisons.
2015-07-30 17:20:44 +02:00
Tom Wilkie c2065836e2 Make NodeMetadata a struct, move existing map[string]string to NodeMetadata.Metadata 2015-07-15 10:06:36 +00:00
Tom Wilkie 14470aa107 Use container name (minus version) as id in containers-by-image view.
Also:
- build a custom URL matcher to cope with container image names having a encoded forward slash in them.
- escape node ids in the UI when constructing URLs.
- add a test which fetches all the nodes of all topologies, and update report fixture to have slash in container image names.
2015-07-01 12:53:47 +00:00
Tom Wilkie eb250ecb7c Trim whitespace from process names
This causes detailed node lookups for the grouped-by-process-name view to fail.  Also, add a test for process walker trimmming whitespace, and a test the process-by-name view gives the right result.
2015-06-24 14:01:17 +00:00
Tom Wilkie 416f56c3cc Only have a single report fixture
- Move render.Rpt to test.Report
- Remove report/report_fixture_test.go; it was unused
- Remove report fixture in app/ and make tests use test.Report
- Move expected outputs into render/expected, so they can be reused
2015-06-24 09:51:29 +00:00
David Kaltschmidt 8d2e62b5c9 updated static.go 2015-06-23 17:24:57 +02:00
Tom Wilkie 626320d7f4 Move probe host topology code into its own module
- add tests
- use constants for NodeMetadata keys
- add host uptime and kernel version
2015-06-23 13:31:22 +00:00
Tom Wilkie 152774a812 Extract out rendered node id generation into a small set of functions. 2015-06-23 07:42:17 +00:00
Tom Wilkie 49dae07cca Make render module produce The Internet pseudo node. 2015-06-19 11:09:52 +00:00
Tom Wilkie f32d2b5a5e Remove report squash logic. 2015-06-18 17:20:20 +00:00
Tom Wilkie 25ca0c0eb7 Add ContainerImage topology and use it to build the Container By Image graph.
This makes container image details show the containers (and processes) correctly.

Also:
- introduces a 'test' package, moved Diff function there.
- adds some tests for this new rendered view.
2015-06-18 09:16:20 +00:00
Tom Wilkie f971ac12bf Move AggregateMetadata into render package. 2015-06-17 19:26:13 +00:00
Tom Wilkie 75b5e07482 Add test for ContainerRenderer and make tests in /app pass. 2015-06-17 17:23:26 +00:00
Tom Wilkie 546f336fef Add FilterUnconnected Renderer, wire up Process and ProcessName Renderers. 2015-06-17 17:23:21 +00:00
Tom Wilkie 16e2ccd2be Produce the container topology by way of the process topology. 2015-06-17 17:23:20 +00:00
Tom Wilkie a759db8931 Rename Map -> LeafMap, introduce Map (with tests) 2015-06-17 17:23:19 +00:00
Tom Wilkie 2a4a33f30a Move RenderableNode and DetailedNode into render/ 2015-06-16 15:37:08 +00:00
Tom Wilkie 4726b48f4e Move topology diff to render package. 2015-06-16 14:25:34 +00:00
Tom Wilkie ae9ea5c97f Move mapping functions and main render function in render package. 2015-06-16 14:23:56 +00:00
Tom Wilkie 1e92e7dcbd Introduce renderers; allow them to recurse. 2015-06-16 10:54:30 +00:00
Tom Wilkie 040f6af4c2 Squash merged reports as they come out of the LIFO, not individual reports as they come in. 2015-06-15 14:34:54 +00:00
Peter Bourgon c900c17ad5 app: fix tests 2015-06-15 14:51:19 +02:00
Tom Wilkie feb2cae406 Merge pull request #226 from tomwilkie/224-id
Seed random so different apps have different ids.
2015-06-15 13:13:59 +02:00
Tom Wilkie ab07b27f52 Seed random so different apps have different ids. 2015-06-15 11:12:57 +00:00
Peter Bourgon e726ee6fde make static 2015-06-15 12:54:27 +02:00
Peter Bourgon 3e8bdcc854 Sub-topolgies rendered in one place only 2015-06-15 10:26:22 +02:00
Peter Bourgon 086ff3b791 Change from grouped URL to sub-topologies 2015-06-12 13:23:25 +02:00
Tom Wilkie 53456179e4 All merging of RenderableNodes, such that we can merge multiple topologies. 2015-06-11 17:11:10 +00:00
Tom Wilkie 894439a449 Prevent multiple connections for the same app. 2015-06-11 10:02:54 +00:00
Tom Wilkie 616759200f Merge pull request #197 from tomwilkie/196-foo
Don't make adjacency edges into 'the internet' if they refer to valid nodes
2015-06-10 10:31:22 +01:00
Tom Wilkie 719f933c21 Refactor MakeAdjacencyID & ParseAdjacencyID; add ParseNodeID (which separates scope and the rest of node id) 2015-06-10 09:21:45 +00:00
Tom Wilkie 9808b57c53 Merge pull request #191 from tomwilkie/report-bugs
Add report issue link
2015-06-10 08:59:38 +01:00
Tom Wilkie cce2e3c0b5 Restore container details to their rightful position. 2015-06-10 07:53:57 +00:00
Peter Bourgon 667d8b8dd0 OriginHosts and OriginNodes become Origins
Another baby step towards #123, this change follows from #192 and merges
the two concepts of Origin in a renderable node. We also cut out a layer
of abstraction, and add an OriginTable method to Report, which directly
generates a table of info for the detail pane given any origin node ID.

Other changes from feedback:

- Assume origin IDs are unique and don't reflect.Dedupe
- Improve origin ID lookup
- Move OriginTable to detailed_node.go, as a free function
- rm app/detail_pane.go (empty)
2015-06-09 18:48:09 +02:00
Tom Wilkie e1092d2ac2 Add report issue link 2015-06-09 16:29:22 +00:00
Peter Bourgon aa0a754363 Improve test coverage; SquashRemote -> Squash
Also, remove some dead code.
2015-06-09 15:54:06 +02:00
Peter Bourgon d438261742 HostMetadata becomes Host Topology
- All HostMetadata information becomes NodeMetadata
- Significant change to mechanics, but same net effect
- LocalNets becomes "local_networks", space-separated list of CIDRs
- Load becomes simple single string
- Use MakeHostNodeID for indexing into Host topology
- (That changes the app /origin/{id} handler; will be removed later)
2015-06-09 15:38:08 +02:00
Peter Bourgon 1e0b83eb6d Merge branch report-fields (#190) 2015-06-09 14:25:54 +02:00
Peter Bourgon 7c56939e22 Update IDList
- MakeIDList rather than NewIDList
- Iterate on test coverage
- Drop Copy method, for now
2015-06-08 19:52:26 +02:00
Peter Bourgon 4832ee76f3 Add the various ID constructors
- Use constructors instead of ScopeDelim everywhere
- Use constructors instead of IDDelim everywhere
- IDDelim is renamed EdgeDelim, for clarity
- Partial import of the new test fixtures, to be completed later
2015-06-08 17:53:01 +02:00
Peter Bourgon d486d1074a Refactor process mappers to taggers
- Reduce tagger interface to operate on reports
- Remove cgroup tagger
2015-06-08 15:04:40 +02:00