Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we show containers without any connections in the container topology? #115

Closed
tomwilkie opened this issue May 27, 2015 · 13 comments
Closed

Comments

@tomwilkie
Copy link
Contributor

Its make sense to ignore processes without connections, but it feels like ignoring containers without any connections is wrong.

@peterbourgon
Copy link
Contributor

The frontend Applications and Containers topologies are built from the report Process topology, whose nodes are endpoints. The concept or entity of a container is emergent from the metadata on those nodes, it's not represented at a low level.

To report containers, processes, or any other emergent entities as first-order objects, i.e. to still show them even if they don't have connections, we would need to add them to the report as a new field. We should be careful to make their unique IDs (keys) exactly the same as the unique IDs produced by MapFuncs.

@tomwilkie
Copy link
Contributor Author

For sure I understand why it is like it is, and how we might achieve it. Question is should we do it? Do you think its something users will expect?

Given containers have no ui (in general) and no persistent storage (in general), surfacing containers that are not doing any network IO seems useful to me.

@peterbourgon
Copy link
Contributor

I think psuedo nodes should be the same "kind" as the topology we're injecting them into

I like this angle, and agree. Pseudonodes as they exist today probably do expose too much of the underlying data topology, which can be confusing. As a rule I think we should always find a way to keep pseudonodes in the UI, through some kind of intelligent merging and/or labeling, and potentially including visual differentiation.

So in general 👍

@peterbourgon
Copy link
Contributor

I would propose to merge this with #114 and take it as my next issue. Can you think of anything else higher on the list that you don't already claim?

@tomwilkie
Copy link
Contributor Author

I think #114 was more about grabbing extra stuff to put on the new container report topology. I think making a container report topology using the existing docker process mapper would be pretty straight forward.

How do you intend to merge the process/connection topology with the container topology, to get a container/connection topology?

I think you working on this next would be AWESOME.

@tomwilkie
Copy link
Contributor Author

Oh feel free to work on #111 if you like!

@peterbourgon
Copy link
Contributor

Neither the work here nor in #114 would result in a new Topolgy in the Report struct. Rather, the work here would require changing the Report struct to something like..

type Report struct {
    Process Topology
    Network Topology
    EntityMetadatas 
}

type EntityMetadatas map[EntityType]EntityMetadata

type EntityMetadata map[string]string

const (
    Origin    EntityType = "origin" // host
    Container            = "container"
    Process              = "process"
)

(Not exactly that, as we need to preserve merge semantics, but you get the idea.)

With this in place, we can get metadata for these emergent entities directly in the probe, and propagate it up to the UI. And with that, we can scrape per-process stats like CPU and mem usage. Make sense?

@tomwilkie
Copy link
Contributor Author

Hmm I see. Is there a layer of indirection missing in EntityMetadatas? is right now its EntityMetadatas[type][key] = value, but should it be EntityMetadatas[type][node id][key] = value?

And given the topology contains a NodeMetadatas, how is this EntityMetadatas any different from a topology without any edges? Are you proposing we put process and host node NodeMetadatas in EntityMetadatas?

@peterbourgon
Copy link
Contributor

Is there a layer of indirection missing in EntityMetadatas?

Yes, it would need to be EntityMetadatas["container"]["a0b1c2d..."]["description"]["foo bar"]. Good catch.

Are you proposing we put process and host node NodeMetadatas in EntityMetadatas?

Yes. Right now we don't have any per-process metadata in the Report; Report.Process.NodeMetadatas is actually per-endpoint metadata. And host metadata is already separate, in HostMetadatas.

But maybe it's moot, as...

And given the topology contains a NodeMetadatas, how is this EntityMetadatas any different from a topology without any edges?

...I guess it is like a topology without edges, sure. We could make it like that explicitly.

type Report struct {
    Process       Topology // should rename to Endpoint
    Network       Topology // should rename to Interface or Address
    Container     Topology // contains only nodes, no edges (at this stage)
    ActualProcess Topology // likewise
    Host          Topology // will initially contain only 1 host node, merge to more
}

This would have the added benefit of making merging easier. Nice. I think :)

@tomwilkie
Copy link
Contributor Author

Yes. Right now we don't have any process metadata in the Report; Report.Process.NodeMetadatas is actually per-endpoint metadata.

does Report.Process.NodeMetadatas not also contain the data from process mappers?

And host metadata is already separate, in HostMetadatas.

Yeah this seems weird; why is it not part of the network topology?

But in general, I like this approach. As you say, if you apply the container map fun to process and then merge with containers, you get exactly what we want. Similarly, one could do the same for hosts.

@peterbourgon
Copy link
Contributor

does Report.Process.NodeMetadatas not also contain the data from process mappers?

Yes, but indirectly. The process mapper output is attached to the Report.Process.NodeMetadata, but the key there is an endpoint ID. So if one process has 10 connections, the same set of process metadata is duplicated 10 times in Report.Process.

Why is it not part of the network topology?

Because it's fundamentally not the same thing — Report.Network is keyed on IPs which are many-to-1 with a probe; host metadata is about the host the probe is running on which is 1-to-1 with a probe.

But in general, I like this approach.

Great! I'll create a new issue with all of this a bit more concrete, merge #114 and #115 (this issue) into it, and take it from there.

@tomwilkie
Copy link
Contributor Author

SGTM

@peterbourgon
Copy link
Contributor

Merged to #120

bboreham added a commit that referenced this issue Aug 10, 2018
2bbc9a08 Merge pull request #140 from weaveworks/sched-http-retry
c3726dea Add retries to sched util http calls
2cc7b5ac Merge pull request #139 from meghalidhoble/master
fd9b0a72 Change : Modified the lint tools to skip the shfmt check if not installed. Why the change : For ppc64le the specific version of shfmt is not available, hence skipped completely the installation of shfmt tool. Thus this change made.
bc645c70 Merge pull request #138 from dholbach/add-license-file
a642e022 license: add Apache 2.0 license text
9bf59568 Merge pull request #109 from hallum/master
d971d821 Merge pull request #134 from weaveworks/2018-07-03-gcloud-regepx
32e7aa2d Merge pull request #137 from weaveworks/gcp-fw-allow-kube-apiserver
bbb6735e Allow CI to access k8s API server on GCP instances
764d46ca Merge pull request #135 from weaveworks/2018-07-04-docker-ansible-playbook
ecc2a4e3 Merge pull request #136 from weaveworks/2018-07-05-gcp-private-ips
209b7fb6 tools: Add private_ips to the terraform output
369a655f tools: Add an ansible playbook that just installs docker
a643e270 tools: Use --filter instead of --regexp with gcloud
b8eca887 Merge pull request #128 from weaveworks/actually-say-whats-wrong
379ce2bb Merge pull request #133 from weaveworks/fix-decrypt
3b906b54 Fix incompatibility with recent versions of OpenSSL
f091ab43 Merge pull request #132 from weaveworks/add-opencontainers-labels-to-dockerfiles
248def1b Inject git revision in Dockerfiles
64f2c280 Add org.opencontainers.image.* labels to Dockerfiles
ea96d8ed add information about how to get help (#129)
f066ccdd Make yapf diff failure look like an error
34d81d70 Merge pull request #127 from weaveworks/golang-1.10.0-stretch
89a0b4f8 Use golang:1.10.0-stretch image.
ca69607f Merge pull request #126 from weaveworks/disable-apt-daily-test
f5dc5d54 Create "setup-apt" role
7fab4413 Rename bazel to bazel-rules (#125)
ccc83168 Revert "Gocyclo should return error code if issues detected" (#124)
1fe184f1 Bazel rules for building gogo protobufs (#123)
b917bb89 Merge pull request #122 from weaveworks/fix-scope-gc
c029ce01 Add regex to match scope VMs
0d4824b1 Merge pull request #121 from weaveworks/provisioning-readme-terraform
5a82d64c Move terraform instructions to tf section
d285d78d Merge pull request #120 from weaveworks/gocyclo-return-value
76b94a47 Do not spawn subshell when reading cyclo output
93b3c0d5 Use golang:1.9.2-stretch image
d40728f6 Gocyclo should return error code if issues detected
c4ac1c3f Merge pull request #114 from weaveworks/tune-spell-check
89806560 Only check files
12ebc73a Don't spell-check pki files
578904ab Special-case spell-check the same way we do code checks
e772ed59 Special-case on mime type and extension using just patterns
ae82b50c Merge pull request #117 from weaveworks/test-verbose
89434738 Propagate verbose flag to 'go test'.
7c79b43c Merge pull request #113 from weaveworks/update-shfmt-instructions
258ef015 Merge pull request #115 from weaveworks/extra-linting
e690202b Use tools in built image to lint itself
126eb561 Add shellcheck to bring linting in line with scope
63ad68f0 Don't run lint on files under .git
51d908a3 Update shfmt instructions
e91cb0d3 Merge pull request #112 from weaveworks/add-python-lint-tools
0c87554d Add yapf and flake8 to golang build image
35679ee5 Merge pull request #110 from weaveworks/parallel-push-errors
3ae41b6f Remove unneeded if block
51ff31a5 Exit on first error
0faad9f7 Check for errors when pushing images in parallel
d87cd026 Add arg flag override for destination socks host:port in pacfile.

git-subtree-dir: tools
git-subtree-split: 2bbc9a08a7f672eae62cfe110d7f536c6cc53ce3
leth pushed a commit that referenced this issue Aug 28, 2018
Changes:
- Default diff-printer to hide details (#103) - da4c3ff
- Improve logging of http errors (#115) - f5a1710
- Update httpgrpc to match cortexproject/cortex#910 (#117) - 80ff076
- Expose the HTTP server from the server struct. (#118) - 1a7a6b3
- Add HTTP tracing middleware (#119) - d442d08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants