Skip to content

Observability

Use observability to answer one debugging question at a time without leaking private prompts, API keys, or unnecessary upstream details.

Logs should be compact, structured, and privacy-preserving by default. They can help identify routing decisions, provider selection, upstream status, stream outcomes, and request hints without storing full payloads.

Logs should not include:

  • request bodies
  • Authorization headers
  • API keys
  • private prompts
  • unnecessary private upstream URL details

These rules implement Behavior Contract C23–C25.

Translation failures and recognized provider semantic failures automatically create a local diagnostic bundle under diagnostics/; this is independent of all [capture] switches. A request failure before forwarding emits fwd-error; a failure while converting an already-started SSE response emits stream-error. A provider stream that terminates cleanly but reports a semantic failure, such as Anthropic model_context_window_exceeded or an OpenAI Responses terminal error, emits provider-semantic-failure. These warnings include diag=... pointing to the bundle. Provider stream terminal and error lines carry the same compact req=... ID as their fwd line, so concurrent requests can be correlated directly.

A request-translation bundle contains record.json plus the exact normalized JSON payload that failed to deserialize or translate. A stream-translation bundle contains record.json plus the raw triggering (or immediately preceding terminal) upstream_sse_event.sse frame. A provider-semantic bundle contains only a privacy-safe response summary and the terminal upstream_terminal_event.sse; it does not copy the request or prompt. JSON paths and compact logs identify context, but cannot replace the surrounding payload/frame needed to reproduce a translation failure. ProxAI keeps only the newest 50 diagnostic bundles.

  1. 1Choose the questionWhat do you need to see: client input, provider request, upstream response, or final outbound response?
  2. 2Pick the phaseUse the narrowest capture phase that can answer the question.
  3. 3Enable brieflyUse `proxai capture enable ...` or `[capture]` switches for a short debugging window.
  4. 4Reproduce onceSend one minimal sanitized request.
  5. 5Disable and sanitizeKeep captures local; sanitize before turning anything into a fixture.

CLI example:

Terminal window
proxai capture status
proxai capture enable provider-request
# reproduce once
proxai capture disable provider-request
QuestionPhase
What did the local client send?inbound_request
Which provider payload did ProxAI prepare?provider_request
What status, headers, or bytes did the upstream return?upstream_response
What did ProxAI return to the client?outbound_response

The capture directory is fixed under the app directory. Config only controls whether each phase is written:

[capture]
inbound_request_enabled = false
provider_request_enabled = false
upstream_response_enabled = false
outbound_response_enabled = false

For exact phase boundaries and privacy risks, see Capture Phases.

Before sharing or committing anything derived from a capture:

  • remove API keys and Authorization headers
  • remove private prompts, files, tool arguments, and model outputs
  • trim unrelated request/response data
  • replace private upstream URLs with sanitized placeholders
  • keep only the smallest payload that reproduces the behavior

Request hints are small protocol-aware summaries used for diagnostics. They should help identify common routing/proxy issues without logging full payloads.

Useful hints include:

Hint typeUseful for
Detected request protocolConfirming path-based ingress behavior
Model and route summaryChecking provider selection without logging prompts
Streaming outcomeUnderstanding whether terminal events were seen
Upstream status summarySeparating provider failure from local translation failure