grpc-experiments/grpc-zpages
Spencer Fang 3f23f88257 Update remaining pkgs in packages.json 2018-06-07 17:03:18 -07:00
..
buildscripts Add zpages gateway and webapp 2018-06-07 12:58:52 -07:00
cli Add zpages gateway and webapp 2018-06-07 12:58:52 -07:00
github/screenshots Add zpages gateway and webapp 2018-06-07 12:58:52 -07:00
web/channelzui Update remaining pkgs in packages.json 2018-06-07 17:03:18 -07:00
LICENSE Add zpages gateway and webapp 2018-06-07 12:58:52 -07:00
README.md Add zpages gateway and webapp 2018-06-07 12:58:52 -07:00

README.md

Experimental warning

This tool is a proof of concept, but feedback is welcome.

Description

gRPC provides debug stats in the form of an RPC service. For example, channelz is a service that provides channel level debug information. This repo contains a tool that connects to a remote gRPC channelz service and displays the data as a web page using a local golang web server. The goal is to provide a single CLI tool that can display all gRPC debug pages.

A screenshot of servers page: image

A screenshot of a detailed socket page: image

Design

The tool has two components: an Angular web app and a CLI tool. The web app is responsible for the core GUI logic, and the CLI acts as a proxy that transforms the Angular app's web requests to gRPC requests. The goal is to do the heavy lifting in the web browser in a backend agnostic way. Other translation gateways can be created easily created to suit different operating environments, e.g. as a shared service or on a web server co-located on the gRPC host. The complete set of web requests is defined in:

web/channelzui/src/app/channelz.service.ts

Running the tool

This example shows how to connect the tool to a gRPC service runnning channelz at 127.0.0.1:5001. The local web server runs on port 8080.

Tip: The GOPATH environment variable determines where go get downloads its packages. This is useful if you would like the CLI tool's dependencies to go to a specific directory.

$ cd cli
$ go get -u github.com/golang/protobuf/protoc-gen-go
$ go get -u google.golang.org/grpc
$ go run gateway.go -serverAddr=127.0.0.1:50051 -port=8080

Compile instructions for the web app

Normally, rebuilding the web app is not necessary. The compiled javascript and HTML files are already present in the repo.

npm is required to be on your PATH. This code has been verified to work with version 5.8.0 of npm.

To rebuild and copy the distributable files:

$ buildscripts/update_angular.sh