feat: add CLI debug snapshot command for one-shot instance state inspection

Adds `debug snapshot --id <int>` to query a running instance's current
attribute values and alarm states without the subscribe/stream overhead
of the debug view. Routes through ManagementActor → CommunicationService
→ site DeploymentManager → InstanceActor using the existing remote query
pattern.
This commit is contained in:
Joseph Doherty
2026-03-18 07:16:22 -04:00
parent 6ee820b0f0
commit 9c6e3c2e56
14 changed files with 144 additions and 4 deletions

View File

@@ -59,6 +59,14 @@ Both central and site clusters. Each side has communication actors that handle m
- Central sends an unsubscribe request when the debug view closes. The site removes its stream subscription.
- The stream is session-based and temporary.
### 6a. Debug Snapshot (Central → Site)
- **Pattern**: Request/Response (one-shot, no subscription).
- Central sends a `DebugSnapshotRequest` (identified by instance unique name) to the site.
- Site's Deployment Manager routes to the Instance Actor by unique name.
- Instance Actor builds and returns a `DebugViewSnapshot` with all current attribute values and alarm states (same payload as the streaming initial snapshot).
- No subscription is created; no stream is established.
- Uses the 30-second `QueryTimeout`.
### 7. Health Reporting (Site → Central)
- **Pattern**: Periodic push.
- Sites periodically send health metrics (connection status, node status, buffer depth, script error rates, alarm evaluation error rates) to central.
@@ -68,6 +76,7 @@ Both central and site clusters. Each side has communication actors that handle m
- Central queries sites for:
- Parked messages (store-and-forward dead letters).
- Site event logs.
- Instance debug snapshots (attribute values and alarm states).
- Central can also send management commands:
- Retry or discard parked messages.