Skip to content

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

Merged
mcowger merged 1 commit into
mcowger:mainfrom
micookie2:feat/trace-http-metadata
May 25, 2026
Merged

feat: add HTTP request headers and response status/headers to trace logs#518
mcowger merged 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

@micookie2
Copy link
Copy Markdown
Contributor Author

Result:

image

Copy link
Copy Markdown
Owner

@mcowger mcowger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good effort, thank you.

Howeverm the intent of the 'recontructed' views is to have a valid JSON response. Adding hte headers breaks that scenario.

I agree with storing this data, however it needs to be in a separate field.

Closes mcowger#444

- Add requestHeaders, responseHeaders, responseStatus columns to debug_logs
- Capture sanitized request headers in startLog() across all route handlers
- Capture response metadata via addResponseMeta() at all dispatch paths
- Extract sanitize-headers utility from dispatcher private method
- Add Request Headers and Response Headers accordion panels in frontend
- Include new fields in debug log export/download payloads
- Add DB migrations for SQLite and Postgres
@mcowger mcowger force-pushed the feat/trace-http-metadata branch from e51702d to 0910a6b Compare May 25, 2026 00:15
@mcowger mcowger merged commit f89c56d into mcowger:main May 25, 2026
1 of 2 checks passed
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.

2 participants