Skip to content

feat: add HTTP request headers and response status/headers to trace logs#518

Open
micookie2 wants to merge 1 commit into
mcowger:mainfrom
micookie2:feat/trace-http-metadata
Open

feat: add HTTP request headers and response status/headers to trace logs#518
micookie2 wants to merge 1 commit into
mcowger:mainfrom
micookie2:feat/trace-http-metadata

Conversation

@micookie2
Copy link
Copy Markdown
Contributor

@micookie2 micookie2 commented May 21, 2026

Closes #444

Enhance debug trace functionality to capture complete HTTP request and response metadata:

Request logging:

  • Add requestHeaders parameter to startLog for capturing request headers
  • Request structure: { headers: {...}, body: {...} }

Response logging:

  • addReconstructedRawResponse wraps response as: { status, headers, body } (Only shown in "Raw Response (Reconstructed)" field)
  • addRawResponse remains unchanged, only records body without metadata

Changes:

  • debug-manager.ts: add addResponseMeta method, optimize response wrapping logic
  • dispatcher.ts: call addResponseMeta at all response handling points
  • sanitize-headers.ts: add sensitive header filtering utility
  • Add comprehensive unit test coverage

Enhance debug trace functionality to capture complete HTTP request and response metadata:

**Request logging:**
- Add requestHeaders parameter to startLog for capturing request headers
- Request structure: { headers: {...}, body: {...} }

**Response logging:**
- Add addResponseMeta method to set response metadata (status, headers)
- addReconstructedRawResponse wraps response as: { status, headers, body }
  (Only shown in "Raw Response (Reconstructed)" field)
- addRawResponse remains unchanged, only records body without metadata

**Changes:**
- debug-manager.ts: add addResponseMeta method, optimize response wrapping logic
- dispatcher.ts: call addResponseMeta at all response handling points
- sanitize-headers.ts: add sensitive header filtering utility
- Add comprehensive unit test coverage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@micookie2
Copy link
Copy Markdown
Contributor Author

Result:

image

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Perhaps I need to see the HTTP header information in the Trace logs.

1 participant