Skip to content

Add response_size field to log responses#1616

Open
elijahchancey wants to merge 1 commit into
imgproxy:masterfrom
elijahchancey:log_response_size
Open

Add response_size field to log responses#1616
elijahchancey wants to merge 1 commit into
imgproxy:masterfrom
elijahchancey:log_response_size

Conversation

@elijahchancey

Copy link
Copy Markdown

Summary

  • Adds a response_size field (integer, bytes) to all router.LogResponse() call sites
  • Covers image responses, 304 not-modified, streaming, panic/error responses, health checks, HEAD requests, and 404s
  • All 4 log formats (pretty, structured, JSON, GCP) render the new field automatically — no formatter changes needed

Test plan

  • go vet ./... passes
  • Verify response_size appears in log output for each response type
  • Confirm no regressions in existing log fields

🤖 Generated with Claude Code

Log the response body size in bytes as a "response_size" field in all
LogResponse call sites, making it available in all log formats (pretty,
structured, JSON, GCP).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DarthSim

Copy link
Copy Markdown
Member

Hey @elijahchancey!
Could you explain the need for this?

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.

2 participants