-
Notifications
You must be signed in to change notification settings - Fork 24
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
csdsclient: add visualization #15
Conversation
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
ClientStatusRequest Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
solved some format issue Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
make it reusable Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
mode together Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
/cc @htuch @dschaller |
I really like this feature. I'm a little unclear on the details though. What questions is the visualization intended to solve? Can you describe the rules used to build the graphviz markup? Does color represent sync status? perhaps a key section would be useful... |
@therealmitchconnors Sorry for my unclear expression. The detailed config in response is always so long that users cannot figure out the relationships between each xDS easily. The visualization feature is used to give users a clear view of the relationships by going through the detailed config, storing relationships between xDS in maps, drawing a graph by marking xDS as nodes and relationships as edges. Different colors represent different xDS types, such as LDS, RDS, CDS, and EDS. Maybe you can take a look at this sample graph to get clearer to what this feature would be like. The user scenario may be like this: the user sees the graph and finds that there are two RDSs here and both of them are related to the CDS0. If the user want to see the detailed config of one of the RDS, he can just hovers the mouse over the specific RDS node and its real name will shows. Then the user can find the config of this RDS easily by searching this real name in the detailed config. |
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
Signed-off-by: Yutong Li <[email protected]>
@@ -10,7 +10,7 @@ For now, this initial version of this CSDS client only supports GCP's [Traffic D | |||
# Running | |||
* run with `./bin/csds <flag>`, e.g. <br/><br/> | |||
* auto authentication mode | |||
``` | |||
```bash | |||
./bin/csds \ | |||
-service_uri <uri> \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe consider change this to csds-client?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've modified the Makefile to run go install
to build the binary under GOPATH/bin
. In this way, the binary will be renamed as csds-client
and we can just run it with csds-client <flag>
rds := make(map[string]string) | ||
cds := make(map[string]string) | ||
ldsToRds := make(map[string]*treeset.Set) | ||
rdsToCds := make(map[string]*treeset.Set) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also handle cds to eds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about adding handler for cds to eds in the v3 PR? Since for v2, there should not be eds in the detailed config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SG.
Signed-off-by: Yutong Li <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments. And it can be cleaned up in the next iteration.
"bytes" | ||
"encoding/json" | ||
"fmt" | ||
"io" | ||
"io/ioutil" | ||
"os" | ||
"os/exec" | ||
"path/filepath" | ||
"runtime" | ||
"strconv" | ||
|
||
"github.com/awalterschulze/gographviz" | ||
"github.com/emirpasic/gods/sets/treeset" | ||
envoy_api_v2 "github.com/envoyproxy/go-control-plane/envoy/api/v2" | ||
envoy_config_filter_http_router_v2 "github.com/envoyproxy/go-control-plane/envoy/config/filter/http/router/v2" | ||
envoy_config_filter_network_http_connection_manager_v2 "github.com/envoyproxy/go-control-plane/envoy/config/filter/network/http_connection_manager/v2" | ||
csdspb "github.com/envoyproxy/go-control-plane/envoy/service/status/v2" | ||
envoy_type_matcher "github.com/envoyproxy/go-control-plane/envoy/type/matcher" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll enable a linter soon. So hopefully sorting this import will be "standardized".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Thanks a lot!
if err != nil { | ||
t.Errorf("Generate graph failure:%v", err) | ||
} | ||
want := "digraph G {\nrankdir=LR;\n\\\"test_lds_0\\\"->\\\"test_rds_0\\\"[ arrowsize=0.3, penwidth=0.3 ];\n\\\"test_lds_0\\\"->\\\"test_rds_1\\\"[ arrowsize=0.3, penwidth=0.3 ];\n\\\"test_rds_0\\\"->\\\"test_cds_0\\\"[ arrowsize=0.3, penwidth=0.3 ];\n\\\"test_rds_0\\\"->\\\"test_cds_1\\\"[ arrowsize=0.3, penwidth=0.3 ];\n\\\"test_rds_1\\\"->\\\"test_cds_1\\\"[ arrowsize=0.3, penwidth=0.3 ];\n\\\"test_cds_0\\\" [ color=\\\"#34A853\\\", fillcolor=\\\"#34A853\\\", fontcolor=white, fontname=Roboto, label=CDS0, shape=box, style=\\\"\"filled,rounded\"\\\" ];\n\\\"test_cds_1\\\" [ color=\\\"#34A853\\\", fillcolor=\\\"#34A853\\\", fontcolor=white, fontname=Roboto, label=CDS1, shape=box, style=\\\"\"filled,rounded\"\\\" ];\n\\\"test_lds_0\\\" [ color=\\\"#4285F4\\\", fillcolor=\\\"#4285F4\\\", fontcolor=white, fontname=Roboto, label=LDS0, shape=box, style=\\\"\"filled,rounded\"\\\" ];\n\\\"test_rds_0\\\" [ color=\\\"#FBBC04\\\", fillcolor=\\\"#FBBC04\\\", fontcolor=white, fontname=Roboto, label=RDS0, shape=box, style=\\\"\"filled,rounded\"\\\" ];\n\\\"test_rds_1\\\" [ color=\\\"#FBBC04\\\", fillcolor=\\\"#FBBC04\\\", fontcolor=white, fontname=Roboto, label=RDS1, shape=box, style=\\\"\"filled,rounded\"\\\" ];\n\n}\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a comment to "manually" review this? A link to that viewer site with this data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified this test to open two windows in the browser to show the expected graph and the generated graph. Does this make sense?
Signed-off-by: Yutong Li <[email protected]>
printoutResponse() to info Signed-off-by: Yutong Li <[email protected]>
Seems like you need to merge master. |
@dio Sorry about that. I've just merged. |
This PR includes adding flag
-visualization
to show the relationship between xDS in the config in response.Details:
Added flag
-visualization
and added support to itSolved conflicts between
-visualization
and-monitor_interval
Added test for visualization
Signed-off-by: Yutong Li [email protected]
/cc @fuqianggao @alexburnos