Skip to content

feat(observability): distinguish HTTP response selection from delivery failure #5398

Open
afourniernv/OpenShell
#13

Description

@afourniernv

User Story

I run OpenShell workloads that consume streaming HTTP responses. I need to distinguish receiving a successful response head from a response that was truncated, cancelled or interrupted later.

Problem Statement

An upstream 200 and a returned request-ID header do not establish that the body was completely delivered. Existing response-stage tracing does not provide bounded delivery observations.

Impact / Why This Matters

Operators can mistake initial response success for complete delivery and miss partial data or late downstream failures.

Proposed Design

Add passive observations to the existing response span. Count accepted wire bytes, including headers and framing, and retain the first bounded write/flush/shutdown failure. Distinguish framing completion, EOF, incomplete delivery, cancellation, upgrade and ambiguous successful return.

Report middleware replacement/stop paths conservatively as returned rather than claiming completion. Accepted writes do not prove peer receipt or application execution. Preserve I/O results, timeouts, parsing, middleware behavior and existing OCSF emission sites. Do not add a primary-record merger, terminal audit summaries, new response validation or a new completion API.

Suggested UX

Inspect a response span to distinguish an upstream 200 from an incomplete or cancelled body. Use the existing request ID to join security records, without treating the receipt as proof of delivery.

Acceptance Criteria

  • Normal, incomplete, cancelled, failed and upgraded paths expose bounded delivery observations without changing wire behavior.
  • Middleware replacement/stop paths do not claim stronger completion than the observer can establish.
  • Byte counts identify accepted wire bytes, not confirmed peer receipt.
  • Existing policy outcomes, parser behavior and OCSF records are unchanged; no extra routine or terminal audit records are introduced.

Alternatives Considered

Initial HTTP status alone loses late failures. Delaying or merging security records changes audit timing and classification. New completion hooks would expand the middleware API; passive observation can report uncertainty without that change.

Agent Investigation

The existing response-stage span and request scope provide the required context. Borrowed I/O wrappers can observe delivery without new buffers, background tasks or public Rust APIs. Review this separately and last because it sits on the response I/O path; it does not require the other correlation follow-ups.

Component of #5210.

Checklist

  • I've reviewed existing issues and the published docs.
  • This is a design proposal, not a "please build this" request.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:triage-neededOpened without agent diagnostics and needs triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions