Repository navigation
Description
User Story
I run remote request and response middleware in OpenShell sandboxes. I need to follow an inspected HTTP request into the middleware service and distinguish service refusals from transport failures.
Problem Statement
OpenShell already records request/response middleware stages and correlates the original security records. Those stages do not identify the remote gRPC calls or carry the supervisor's trace context into the middleware service.
Impact / Why This Matters
Operators cannot follow a slow or failing middleware call across the supervisor/service boundary or distinguish a successful policy refusal from a failed RPC.
Proposed Design
Add child gRPC client spans for remote HTTP middleware calls. Propagate the supervisor's active trace context rather than workload-supplied headers. Keep a streaming RPC span alive until its terminal status is observed or the consumer drops the stream. Reuse the shared OpenTelemetry interceptor, status guard and traced-stream support.
Keep existing request/response phase instrumentation, enforcement, and per-control OCSF records unchanged. Do not add payloads, unbounded error text, new result-struct fields, or a merged security summary. WebSocket sessions and middleware configuration RPCs are outside this change.
Suggested UX
Expand an inspected request's middleware stage to see its remote RPC and, when the service exports compatible traces, continue into the service. The matching security records retain the same request ID.
Acceptance Criteria
- Remote HTTP middleware RPCs retain correct parentage and supervisor-owned W3C propagation.
- Streaming spans remain open while their responses are consumed; early cancellation does not report successful completion.
- A policy refusal is distinguishable from a transport failure without exporting content or error messages.
- Existing middleware results, configuration, enforcement and audit records remain unchanged.
Alternatives Considered
The existing phase spans show supervisor time but not the remote boundary. Service-only tracing lacks the supervisor's causal link. New routine audit summaries would duplicate existing records.
Agent Investigation
The implementation can reuse OpenShell's shared gRPC tracing support at the remote middleware client. It does not require new external Rust APIs, middleware protobuf fields or configuration.
Component of #5210. The HTTP correlation core is already available; this change is independently reviewable above it.
Checklist
- I've reviewed existing issues and the published docs.
- This is a design proposal, not a "please build this" request.
Activity
[-]feat(observability): correlate supervisor middleware decisions and changes[/-][+]feat(observability): trace remote HTTP middleware RPCs[/+]