grpcproc
Documentation

Web UI

A live view of the cluster in a browser: nodes and links, processes, supervision trees and events.

Starting it

go install github.com/floatdrop/grpcproc/tools/cmd/grpcprocctl@latest
grpcprocctl --plaintext --addr 10.0.0.5:9000 web   # http://localhost:9911

grpcprocctl web serves a page that reads the cluster through one node's Inspector and refreshes every second. The node must serve the Inspector; the connection flags are those of the command line.

grpcprocctl web: the cluster
The Cluster view: three nodes a, b and c, each with its process count, joined by arrows labelled with messages per second, above a table of the nodes with their uptime, processes, spawns and exits per second, dead letters and peers.The Cluster view: three nodes a, b and c, each with its process count, joined by arrows labelled with messages per second, above a table of the nodes with their uptime, processes, spawns and exits per second, dead letters and peers.

Views

ViewWhat it shows
ClusterEvery node, its address and metadata under its name (a long value shortened by its middle), with how many of its peers are up and those that are not, dead letters and queues, those in trouble first (a node that serves no Inspector is up, marked so, and not described), a hundred at a time, and up to 32 nodes a map of what goes between them, a line a pair, with messages per second on each. Grouped by a key of the nodes' metadata, a data center or a shard, it adds each group up and maps the groups, up to 24, each a circle that opens on a click to its nodes, up to 32 a group (the URL keeps which are open), and what goes between what it draws: by the nodes' links, or in a cluster too large for them, by each node's links added up by the group of the peer. A group in the table, or a filter by name or key=value, lists its nodes. What every name begins with, as the pods of one chart share yarco-moq-, is left off the map and the peers and dimmed wherever a node or a PID is named, on every page, and on the map so is what the pods of a deployment share, relay / zn57s: the rest tells the nodes apart. Pages share a walk over the cluster, which asks 32 nodes at a time: a large cluster is walked again once five times as long as the last walk took has passed, and at most 15 seconds. The node picker at the top filters as you type.
NodeOne node's counters and links, charted over the last minute; a row a peer with its link each way, those down or queued first, a hundred at a time, filtered by peer or grouped by a key of the peers' metadata as the node's Membership reports it.
ProcessesThe table grpcprocctl ps prints, with messages in and out per second and the share of each second each process was busy. The scope (name, label, state, mailbox) is sent to the node; search and order stay in the page.
Global namesWho holds each global name.
GroupsThe process groups scopes the node runs, as its copy has them: each group's members on every node and on this one, a group's members once picked, and the other nodes of the scope with their states.
SupervisionEach process under the one that started it, coloured by state, mailbox or activity; five or more of one label under one parent with none under them, as a topic a peer each, are a row that opens.
EventsSpawns, exits with their reasons, links and dead letters, streamed as they happen.
Cron, ElectionsEvery cron job and leader election on the nodes the cluster walk finds, asking 32 at a time; a node that cannot be asked is listed with why, and one that serves no Inspector is left out, but from an election whose electors name it. A cron process spawned with a label of its own is shown by grpcprocctl cron --node, not here.
SagasThe saga engines reachable from the node, and a saga's runs a page at a time, by status. A run opens beside them: why it is stuck, its timers and owner, its data when the engine shows it, and the signals waiting.

The address holds what is open, so a view can be shared as a link.

A process

Clicking a process opens it beside any view: its mailbox, messages per second and how busy it is charted, what it says about itself, and what it started. Asking a process what it says takes it a turn, so the page asks when told to, or on an interval you choose. Here ledger handles about 20 messages a second while more arrive, and its mailbox climbs:

grpcprocctl web: a backlog
The Processes view sorted by mailbox, ledger first with a deep mailbox, and ledger open beside it: running, receiving about 20 a second, its oldest message waiting tens of seconds, a chart of its mailbox climbing, and what it publishes about itself.The Processes view sorted by mailbox, ledger first with a deep mailbox, and ledger open beside it: running, receiving about 20 a second, its oldest message waiting tens of seconds, a chart of its mailbox climbing, and what it publishes about itself.

Changing things

The page is read-only unless started with --allow-writes. With it, the page can ask a process to exit, set its log level, enable, disable and remove cron jobs, move or cordon a leader, and resume a stuck saga run. Each change is confirmed first. An Inspector built with inspect.ReadOnly() refuses them whatever the page allows.

Where it listens

It listens on localhost:9911 unless --listen says otherwise. On a loopback address it answers only requests whose Host is localhost or a loopback address, so a page on another site cannot read it through your browser. On any other address, put it behind something that authenticates.

The API behind the page returns the objects grpcprocctl --json prints, /api/nodes with when the walk ended: /api/info, /api/nodes, /api/node, /api/processes, /api/process, /api/names, /api/crons, /api/elections, /api/sagas, /api/saga/runs, /api/saga/run, and /api/events as server-sent events.