grpcproc
Documentation

Inspector

A gRPC service on each node that serves its processes, links and events, and forwards requests to the other nodes.

The Inspector serves the Go API that Observability describes over gRPC, on the node's own server, and forwards to every other node's, so one endpoint reaches the whole cluster.

Serving

grpcproc/inspect is part of the core module. It registers a second service, grpcproc.inspect.v1.Inspector, next to the node's own:

node.Register(grpcServer)
insp := inspect.New(node) // reaches other nodes' Inspectors as the node reaches the nodes
insp.Register(grpcServer)
defer insp.Close()

Every request names a node. One that is not this node is forwarded to that node's Inspector, which the server dials as the node dials its peers, node.Dial, through the node's own resolver and dial options: one connection per peer, closed by Close. WithResolver takes another resolver or other dial options, for Inspectors served elsewhere than on the port the nodes link through, and WithPeers any other way of reaching a peer's Inspector; WithPeers(nil) keeps a server to its own node. A process targeted by PID routes to the PID's node when the request names none.

inspect.ReadOnly() refuses the four writes: Send, Call, Exit and SetLogLevel. It allows Query, which only a process spawned with grpcproc.WithQuery answers, and which changes nothing. inspect.NoQueries() refuses it too. Anything finer is the job of the interceptors and transport credentials that guard your other services. The tutorial's platform serves the Inspector read-only because it shares the node's port and nothing there authenticates.

Read-only is not private. Whoever reaches the Inspector sees every node's processes, their names and what they publish, and through Query what a saga engine reads from its store: its runs, their state and errors, and with the engine's Config.InspectData their data. A node's Admit does not cover it, since it is another service on the port, and one Inspector forwards to the others. Put it behind authentication wherever the network is not trusted, and limit its requests with an interceptor: a query reads from the store.

Methods

MethodWhat it answers
GetNodeThe node's NodeInfo: counters, dead letters, its links; and the members its Membership reports up.
ListProcessesEvery process of a node, filtered by name, label, state or minimum mailbox depth.
GetProcessOne process's snapshot, and with inspect: true what it publishes through WithInspect. A process too busy to answer still gets its snapshot, with inspect_error saying so.
SetLogLevelOne process's log threshold.
SendA message, as an Any, from a tool.
CallA call, as Node.CallTo makes it: the answer as an Any, the request's deadline as the call's, and an answer that is an error as Unknown with its text.
QueryA question to a process spawned with WithQuery, as Node.Query asks it: its function answers on the Inspector's goroutine, without the mailbox. A process spawned without one is Unimplemented. A saga engine answers queries about its runs.
ExitA request to exit; the reason defaults to killed.
WatchNode.Subscribe over the wire: spawns, exits, links, dead letters.

A watch holds a buffer of up to 4096 events, about 1.7 MB, and the client picks the size below that. The server allocates it, so limit how many streams a client may open, with grpc.MaxConcurrentStreams or an interceptor.

It is a plain gRPC service, so grpcurl works on it too.

Clients

  • Command line: grpcprocctl, in a terminal.
  • Web UI: grpcprocctl web, the cluster live in a browser.
  • AI agents: grpcprocctl mcp, the same questions as MCP tools.

All three live in grpcproc/tools, a separate module.