Commit Graph

317 Commits

Author SHA1 Message Date
Risha Mars 07f27656f7
Reduce webpack bundle size: import d3 modules individually (#2030)
Previously, we were importing all of d3, but we don't need a lot of it. 
This branch switches our imports to only the things we need.
2019-01-03 14:10:14 -05:00
Risha Mars a609dd5894
Reduce webpack bundle size: import lodash by module (#2028)
Imports lodash function individually, eliminate 'import _ from lodash'

This branch replaces imports of all of lodash (import _ from 'lodash' with per
function imports e..g import _isNil from 'lodash/isNil'. This reduces the bundle
size from~520 kb to ~160kb.

I've also taken the opportunity to replace our use of lodash functions with
native js functions where it makes sense (e.g. some maps, concats, sizes).
2019-01-03 13:50:46 -05:00
Andrew Seigner 1c302182ef
Enable lint check for comments (#2023)
Commit 1: Enable lint check for comments

Part of #217. Follow up from #1982 and #2018.

A subsequent commit will fix the ci failure.

Commit 2: Address all comment-related linter errors.

This change addresses all comment-related linter errors by doing the
following:
- Add comments to exported symbols
- Make some exported symbols private
- Recommend via TODOs that some exported symbols should should move or
  be removed

This PR does not:
- Modify, move, or remove any code
- Modify existing comments

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2019-01-02 14:03:59 -08:00
Kevin Lingerfelt f1b0983f72
Add go linting to CI config (#2018)
* Add go linting to CI config
* Fix lint warnings
* Add note about bin/lint script in TEST.md

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-12-20 15:33:09 -08:00
Radu M 07cbfe2725 Fix most golint issues that are not comment related (#1982)
Signed-off-by: Radu Matei <radu@radu-matei.com>
2018-12-20 10:37:47 -08:00
Risha Mars d48a473985
Remove less and post-css from the project (#2002)
Since we've switched to using css-in-js styling with material, we have very
little need for additional css libraries so support our ~30 lines of css. I'm
removing them in favour of a simpler configuration and inline styles.
2018-12-19 16:34:04 -08:00
Risha Mars 5e7522b848
Fix update neighbors function not being passed in to top module (#2008) 2018-12-19 15:50:57 -08:00
Risha Mars 0318590c07
Start reducing webpack bundle size, fix minor bugs (#1995)
- Adds bundle analyzer so we can see the composition of our bundle. 
- Stop importing all the locales of moment.js 
- Use named imports for all places we use material-ui components
- Fix a bug where, due to the controller components being relabled
linkerd-, the service mesh page wasn't showing the correct statuses. 
- Fixes some eslint warnings on tests
2018-12-19 12:51:02 -08:00
Risha Mars 7c1a403d19
Update QueryToCliCmd to include the linkerd namespace if it is non-default (#1985)
Previously, the module assumed all linkerds were in the linkerd namespace. 
Include the --linkerd-namespace flag in the query if linkerd is not in the default ns.
2018-12-13 15:53:44 -08:00
Kevin Lingerfelt 86e95b7ad3
Disable serivce profiles in single-namespace mode (#1980)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-12-13 14:37:18 -08:00
Alejandro Pedraza 8c67bfbcc6 Add parameter to stats API to skip retrieving Prometheus stats (#1871)
* Add parameter to stats API to skip retrieving Prometheus stats

Used by the dashboard to populate list of resources.

Fixes #1022

Signed-off-by: Alejandro Pedraza <alejandro.pedraza@gmail.com>

* Prometheus queries check results were being ignored
* Refactor verifyPromQueries() to also test when no prometheus queries
should be generated

* Add test for SkipStats=true

Includes adding ability to public.GenStatSummaryResponse to not generate
basicStats

* Fix previous test
2018-12-10 16:48:12 -08:00
Risha Mars 6214c9a15d
Miscellaneous improvements to the Top Routes UX (#1963)
* Renames UNKNOWN in the tables to (default) which is less scary (#1946)
* adds a tooltip explaining what (default) is
* adds url props to the Top Routes page, so that they query can be populated by a url
* fixes a js error that occurs when switching pages
2018-12-10 10:40:24 -08:00
Kevin Lingerfelt 0f8bcc9159
Controller: wait for caches to sync before opening listeners (#1958)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-12-07 11:15:45 -08:00
Risha Mars 692c4ca75b
Add the create new service profile button by default at /routes (#1941)
* Show the call to action if all metric rows are UNKNOWN
* Also enable creating of a new service profile by default on the Top Routes page
* Fix bug in passing down props.classes from the Navigation component
* Adjust form appearance
2018-12-06 17:26:21 -08:00
Risha Mars 7ea867843b
Show Top Routes in sidebar, change forms to query all resources (#1937)
Now that #1921 has merged, we can query for top routes for any resource, 
not just services.

This PR adds a dropdown for all resources to the Top Routes query form.

It also adds a link to the Top Routes page in the sidebar.
2018-12-05 15:15:40 -08:00
Andrew Seigner bef9479f57
Add input validation for profile command (#1934)
Fixes #1878

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-12-05 15:13:10 -08:00
Risha Mars 442685674b
Add a Create Service Profile dialog (#1933)
Add the ability to create and download a service profile from the web UI.

This form will be displayed in the call to action if no route metrics are found.
2018-12-05 15:08:10 -08:00
Risha Mars 5b26508f7c
Add a tabbed view to the resource detail page for Top and Routes (#1918)
Adds the top routes metrics to the resource detail pages.

* Add a tabbed view to the resource detail page
Add the ability to query top routes from the detail tabs

* Move ConfigureProfilesMsg to its own module
2018-12-05 13:55:31 -08:00
Alex Leong 380ec52a39
Rework routes command to accept any resource (#1921)
We rework the routes command so that it can accept any Kubernetes resource, making it act much more similarly to the stat command.

Signed-off-by: Alex Leong <alex@buoyant.io>
2018-12-05 11:11:34 -08:00
Risha Mars 7949a3355c
s/Request Rate/RPS (#1927) 2018-12-04 17:29:31 -08:00
Kevin Lingerfelt 37ae423bb3
Add linkerd- prefix to all objects in linkerd install (#1920)
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-12-04 15:41:47 -08:00
Risha Mars 92d92d3f9b
Move the determining of display order into the cli query module (#1917)
[web UI] Previously, we were specifying the display order to display the cli flags in the
QueryToCliCmd module. But this order is pretty standard for each command, and
I'd like to avoid hardcoding that list everywhere.

Move the handling of order into the QueryToCliCmd module.
2018-12-04 10:08:59 -08:00
Risha Mars e8a39cd17e
Add ability to download a service profile template from the web UI (#1893)
Adds an endpoint, at /profiles/new that allows you to input a service name and
namespace, and download a service profile yaml template. 

This will enable future work, where we can add more of the yaml customization via 
a form in the dashboard, and use that data to help the user configure routes.
2018-12-03 16:48:43 -08:00
Oliver Gould 926395f616
tap: Include route labels in tap events (#1902)
This change alters the controller's Tap service to include route labels
when translating tap events, modifies the public API to include route
metadata in responses, and modifies the tap CLI command to include
rt_ labels in tap output (when -o wide is used).
2018-12-03 13:52:47 -08:00
Risha Mars dd44e10a58
Display the correct command name for the cli equivalent (#1907)
Previously, we were passing in "tap" as the command name for both the tap and
top forms, resulting in the equivalent CLI command always being linkerd tap
regardless of whether you were in the Tap or Top view.

Fix this to correctly pass in tap or top depending on the page.
2018-12-03 12:22:00 -08:00
Risha Mars c108cd260d
Upgrade to material-ui 3.6.1 (#1906) 2018-12-03 11:59:45 -08:00
Alex Leong f9d66cf4de
Add --open-api option to linkerd profiles command (#1867)
The `--open-api` flag is an alternative to the `--template` flag for the `linkerd profile` command.  It reads an OpenAPI specification file (also called a swagger file) and uses it to generate a corresponding service profile.

Signed-off-by: Alex Leong <alex@buoyant.io>
2018-11-30 09:25:19 -08:00
Risha Mars 7a2689ce4a
Improve the top routes request form and code structure. (#1886)
Separates out the querying and table display of route data, so that this module
can be easily placed in other places in the UI. 

Adds usability improvements to the routes query form at /routes:
- displays CLI equivalent 
- adds dropdown with populated options for service / namespace 

As part of this work, made TapQueryCliCmd more generic, so it can work
for other CLI commands besides tap/top.
2018-11-29 10:20:53 -08:00
Risha Mars d9539bcb37
Add the top routes feature to the dashboard UI (#1868)
Adds a (currently not displayed in sidebar, but available at /routes) page to
mirror the current functionality of `linkerd routes <service>`. So far, this is just a
barebones form and table, but it works.

Adds a /api/routes path and handler to the api to receive TopRoutes requests from the web.
2018-11-27 16:53:10 -08:00
Risha Mars f8583df4db
Add ListServices to controller public api (#1876)
Add a barebones ListServices endpoint, in support of autocomplete for services.
As we develop service profiles, this endpoint could probably be used to describe
more aspects of services (like, if there were some way to check whether a
service profile was enabled or not).

Accessible from the web UI via http://localhost:8084/api/services
2018-11-27 11:34:47 -08:00
Alex Leong 7a7f6b6ecb
Add TopRoutes method the the public api and route CLI command to consume it (#1860)
Add a routes command which displays per-route stats for services that have service profiles defined.

This change has three parts:
* A new public-api RPC called `TopRoutes` which serves per-route stat data about a service
* An implementation of TopRoutes in the public-api service.  This implementation reads per-route data from Prometheus.  This is very similar to how the StatSummaries RPC and much of the code was able to be refactored and shared.
* A new CLI command called `routes` which displays the per-route data in a tabular or json format.  This is very similar to the `stat` command and much of the code was able to be refactored and shared.

Note that as of the currently targeted proxy version, only outbound route stats are supported so the `--from` flag must be included in order to see data.  This restriction will be lifted in an upcoming change once we add support for inbound route stats as well.

Signed-off-by: Alex Leong <alex@buoyant.io>
2018-11-19 12:20:30 -08:00
Risha Mars 6d8911090d
Rewrite octopus arm code to be more parameterized and flexible. (#1834)
As a result, displays better in the material UI version of the dashboard.
Also adds Success rate to data displayed on neighbour nodes.

* Rewrite octopus arm code to be more parameterized and flexible.
As a result, displays better in the material UI version of the dashboard.
* Add Success rate to data displayed on neighbour nodes
* Fix variablilty in grid spacing by fixing the max and min widths of the chart,
and by scrolling the overflow
* Center the octopus graph so it looks better at full width
* Also add padding, so that the drop shadows aren't cut off
2018-11-01 12:30:19 -07:00
Andrew Seigner f777f87924
Fix grid alignment in tap query form (#1833)
Fixes #1789

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-10-31 14:10:16 -07:00
Andrew Seigner 1eb93b670a
Replace some sidebar icons with Font Awesome (#1830)
This replaces a couple of the MaterialUI icons introduced in #1776 with
their original counterparts in Font Awesome, but wrapped in a MaterialUI
`Icon` tag. Also fix Linkerd logo padding in sidebar.

Part of #1781.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-10-31 13:42:55 -07:00
Andrew Seigner 9a49f96a9a
Fix popovers to be reachable and clickable (#1831)
The popover on the src/dst column in the top and tap tables disappeared
before a use could click on it.

Modify the popovers to be reachable, also reimplement them as activated
by mouse clicks rather than mouse over events, allowing the src/dst
column to be both clickable and provide an icon for popover.

Fixes #1784

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-10-31 13:42:34 -07:00
Andrew Seigner 3cd13f2913
Fix sidebar not rendering to end of page (#1827)
Also make main content independently scrollable.

Part of #1781

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-10-30 11:18:42 -07:00
Risha Mars 1b2b02985b
Small tweaks to the metrics tables to make them denser (#1826)
Try to squish the metrics columns so that the data fits on the page without
having to scroll the table. This was mostly evident in the Tap and Top tables,
where a lot of the table content would be initially out of view.

This branch also includes an unrelated tiny fix for max error length, which had
been changed from 500 to 50 for testing, and had not been changed back
2018-10-29 18:27:02 -07:00
Alex Leong d8b5ebaa6d
Remove the proxy-api container (#1813)
A container called `proxy-api` runs in the Linkerd2 controller pod.  This container listens on port 8086 and serves the proxy-api but does nothing other than forward gRPC requests to the destination container which listens on port 8089.

We remove the proxy-api container altogether and change the destination container to listen on port 8086 instead of 8089.  The result is that clients still use the proxy-api by connecting to `proxy-api.<ns>.svc.cluster.local:8086` but the controller has one fewer containers.  This results in a simpler system that is easier to reason about.

Signed-off-by: Alex Leong <alex@buoyant.io>
2018-10-29 16:31:43 -07:00
Alex Leong 622185a4dd
Send metric labels in profile API (#1800)
* Send metric labels in profile API

Signed-off-by: Alex Leong <alex@buoyant.io>
2018-10-29 14:28:09 -07:00
Risha Mars f7ca589556
Upgrade material-ui to 3.3.2 (#1824)
* Upgrade material-ui to 3.3.2

* Re-add popover that was removed in #1814
2018-10-29 14:08:22 -07:00
Kevin Lingerfelt cf7a532e15
Re-add sortable column headers to tables in web UI (#1814)
* Re-add sortable column headers to tables in web UI
* Display sort icons on all sortable columns
* Disable src/dst popover in top table

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-10-26 14:58:01 -07:00
Risha Mars d2f847a484
Fix success rate not appearing in Top column (#1816)
* Fix success rate mini chart not appearing on Top event tables

* Fix success rates being left aligned
2018-10-26 14:40:27 -07:00
Andrew Seigner c661b00f8e
Re-implement sidebar resource selectors (#1810)
Signed-off-by: Andrew Seigner <siggy@buoyant.io>
2018-10-26 13:28:29 -07:00
Risha Mars 148d7bc608
Do some small alignment tweaks, fix Firefox rendering (#1809)
This branch:

- adds a "meshed" badge to the namespace overview page instead 
of a green checkmark (uses Chip)
- fixes aforementioned meshed indicator not showing up in firefox
- vertically centers the ( ! ) icons in the metrics tables
- vertically centers the dots in the metrics tables
2018-10-25 10:04:58 -07:00
Risha Mars 715e8ff2dc
Apply global theming to the dashboard using material-ui themes (#1799)
Try to standardize theming and colours throughout the app:

- Move Material UI theme definition into its own file
- Use theme colours in success rate charts
- Remove all colour definitions from styles.css
- Remove unused styles in styles.css
- Audit bare h tag usage throughout the app; replace with Typography
- Standardize the colours to the theme for Progress.jsx
- Use theme colour in Spinner
- Default to warning in meshed status table bar chart
2018-10-24 17:13:39 -07:00
Risha Mars ae23c43e0a
Upgrade dashboard js libraries (#1806)
* Upgrade moment to 2.22.2

* Upgrade material-ui/core to 3.3.1
2018-10-24 11:36:47 -07:00
Risha Mars 98ee36344e
Dashboard Table cleanups (#1793)
This branch includes some small appearance tweaks for tables in the app.

- Removes the restrictions on the MetricsTables for Authorities Grafana 
links (Authorities Grafana dashboards were added in #1772)
- Fixes the tables overflowing their containers on the Overview page
- Allows tables to be denser, allowing for more data on screen
- Fixes the colour of the meshed status bar in the ServiceMesh page
- Rixes the ErrorModal icon alignment and colour
- Small appearance tweaks to the things in the table e.g. icons
2018-10-24 11:13:28 -07:00
Risha Mars e69da1b8a8
Move the dashboard's component library from antd to material-ui (#1776)
Switch the dashboard's component library from antd to material-ui.

There are extensive changes to most of the frontend components in the app.

This branch changes all uses of antd components to their closest equivalent in
material. There is still a lot of polish that needs to go into the look of
individual components, but since the major component rewrites are done, I think
get this work in so that further work can be done in smaller branches.

Changes in this branch:

- add Material-UI 3.2.2 to the project
- replace all uses of antd with material-ui components
- remove antd from the project
- slight modifications of eslint rules 
- restructuring of app components to be rendered under the Navigation 
component 
- deleted most of our css (replaced with material's inline styles) 
- pinned package versions in package.json (mostly removing ^)
2018-10-19 11:23:43 -07:00
Kevin Lingerfelt e9874b9c3e
Improve docker layer caching for web image (#1757)
* Improve docker layer caching for web image
* Move all web files to /linkerd dir

Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
2018-10-16 11:10:52 -07:00
Risha Mars a82e2afefc
Switch to jest for assertions, remove mocha and chai (#1769)
Use jest for assertions, removing the need for mocha and chai

- Clean up test dependencies
- Move dev dependencies to devDependencies
- yarn remove chai remove sinon-chai mocha
2018-10-15 17:17:11 -07:00