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

Add new Servicegraph visualization. #3318

Merged
merged 2 commits into from
Feb 9, 2018

Conversation

jeffmendoza
Copy link
Contributor

Adds a new viz under /force/forcegraph.html. New serialization needed
in d3graph.go. Update README.

Adds a new viz under /force/forcegraph.html. New serialization needed
in d3graph.go. Update README.
@istio-testing
Copy link
Collaborator

Hi @jeffmendoza. Thanks for your PR.

I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Contributor

@douglas-reid douglas-reid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into making servicegraph prettier and more useful.

A few suggestions.

## Services
- `/force/forcegraph.html` is an interactive
[D3.js](https://d3js.org/) visualization. This graph only displays
services that are currently receiving traffic.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to use a time_horizon argument on this visualization? It is a bit strange to have a graph disappear dynamically when playing around with it simply because traffic stopped for a bit (this is especially true for testing).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the js code queries the backend with those parameters. The default I chose is time_horizon=10s&filter_empty=true, as this leads to good demos of adding services and/or changing route rules.

My idea was to have UI elements to toggle those things, but I don't have those now. I think some js to pass those parameters through would be an easy interim solution.

All endpoints also take an optional arugment of `filter_empty=true`, which will
restrict the nodes and edges shown to only those that reflect non-zero traffic
levels during the specified `time_horizon`.
- `/d3graph` provides a JSON serialization for D3 visualization.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder: do we need two JSON serializations for the same graph?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was more comfortable doing the transformation in Go. I think the core Static/Dynamic graph structure is better for internal representation than the one that D3 wants, so I didn't want to change that. The /graph endpoint could be removed, as it is not used, but It is trivial to keep it, and someone might find a way to use it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. fair enough.


## Query Parameters

All endpoints except for `/force/forcegraph.html` take these query parameters:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above: it would be really nice if there wasn't a behavior difference here.

stroke: black;
stroke-width: 1.5px;
cursor: move;
fill: #466BB0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is way way down in the weeds, but I think we might want to consider a different color (non-red). would using istio blue make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is Istio blue now, I had it as "lightcoral" before.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha. ok. i need to learn hex colors ;).

<link rel="stylesheet" href="forcegraph.css">
</head>
<body>
<div id="total">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some text to this page that describes what it is and how to use (a la "click on nodes to see metrics")?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will Do.

Copy link
Contributor

@kyessenov kyessenov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine. can't wait to see it live :)

@jeffmendoza
Copy link
Contributor Author

@douglas-reid Comments addressed.

@douglas-reid
Copy link
Contributor

/lgtm

@istio-merge-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: douglas-reid

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@istio-merge-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@istio-merge-robot
Copy link

Automatic merge from submit-queue.

@istio-merge-robot istio-merge-robot merged commit b48a6b4 into istio:master Feb 9, 2018
@ldemailly
Copy link
Member

in the future any chance to move those large js files to contrib/ or use CDN urls ?

@jeffmendoza
Copy link
Contributor Author

No plans at the moment, I think it is better to serve them from the container.

I do think all of addons/ should be moved out to the contrib repo at some point. Right now build/release uses only istio/istio, and it's best to keep the addons versioned and released with the rest of Istio for now.

I imagine the release process will grow to encompass more repos again at some point.

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

Successfully merging this pull request may close these issues.

7 participants