Feat/client httptrace#453
Merged
Merged
Conversation
Opt-in r.Trace flag that narrates the HTTP client lifecycle via net/http/httptrace: DNS, dial, TLS handshake, idle-pool reuse, request and response body chunks, time-to-first-byte and a trailing per-request summary. Designed as a problem-investigation tool (curl -vvv equivalent), orthogonal to Debug (wire-byte dumps) and OpenTelemetry (distributed traces). The toggle is not coupled to SWAGGER_DEBUG / DEBUG environment variables: it defaults to false and is only enabled by explicit assignment. Includes issue-go-openapi#336 annotations: a HEADS-UP line on reused idle conns older than 30s, plus a tail diagnostic block when round-trip fails on a stale-idle reuse. TLS-failure diagnostic mode and prose documentation follow in subsequent commits. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
When the TLS handshake fails, Runtime.Trace now emits a structured diagnostic block that classifies the failure into one of three axes and renders actionable context for each: - protocol-version: client-offered range, error class, suggested fix. Detected via the protocol_version TLS alert (70) or local "unsupported protocol" errors. - cipher-suite: configured CipherSuites, note that the server's set is not exposed by the stdlib. Detected via handshake_failure alert (40) with a non-empty client-side restriction. - cert-chain: distinguishes expired / unknown-CA / hostname-mismatch via errors.As against x509.CertificateInvalidError, x509.UnknownAuthorityError and x509.HostnameError. Each reason renders the relevant cert fields, the trust store in use and a targeted suggestion. The diagnostic introspects the http.Transport.TLSClientConfig when reachable, falling back to "configured: not introspectable" for custom transports. Tests cover all four failure axes plus the happy-path summary line. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (66.90%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #453 +/- ##
==========================================
- Coverage 85.06% 83.45% -1.62%
==========================================
Files 60 62 +2
Lines 3970 4387 +417
==========================================
+ Hits 3377 3661 +284
- Misses 449 567 +118
- Partials 144 159 +15 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change type
Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update
Short description
Fixes
Full description
Checklist