feat(logs): record timeout length and add request logging knob #7

Merged
rcsheets merged 1 commit from feat/request-logging into main 2026-07-20 13:05:37 +00:00
Owner

Two logging changes:

Timeouts now name the duration that expired, at every site one can
surface: the per-attempt retry log, the 502 body returned to the client,
and discovery probe failures. describeErr matches on net.Error.Timeout(),
which covers both shapes that actually occur -- the transport's
ResponseHeaderTimeout and discovery's context deadline. Non-timeout
errors pass through verbatim, since there is no timeout to blame.

Successful forwards can now be logged via log_requests: true in config
or --log-requests, off by default because it is a line per completion.
The knob rides in a new proxy.Options struct rather than another
positional argument to New.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

Two logging changes: Timeouts now name the duration that expired, at every site one can surface: the per-attempt retry log, the 502 body returned to the client, and discovery probe failures. describeErr matches on net.Error.Timeout(), which covers both shapes that actually occur -- the transport's ResponseHeaderTimeout and discovery's context deadline. Non-timeout errors pass through verbatim, since there is no timeout to blame. Successful forwards can now be logged via log_requests: true in config or --log-requests, off by default because it is a line per completion. The knob rides in a new proxy.Options struct rather than another positional argument to New. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat(logs): record timeout length and add request logging knob
All checks were successful
ci / check (pull_request) Successful in 45s
263309796f
Two logging changes:

Timeouts now name the duration that expired, at every site one can
surface: the per-attempt retry log, the 502 body returned to the client,
and discovery probe failures. describeErr matches on net.Error.Timeout(),
which covers both shapes that actually occur -- the transport's
ResponseHeaderTimeout and discovery's context deadline. Non-timeout
errors pass through verbatim, since there is no timeout to blame.

Successful forwards can now be logged via log_requests: true in config
or --log-requests, off by default because it is a line per completion.
The knob rides in a new proxy.Options struct rather than another
positional argument to New.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
rcsheets deleted branch feat/request-logging 2026-07-20 13:05:37 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
brooktrails/slp!7
No description provided.