feat(session): log Meraki X-Request-Id on 5xx responses (httpx forward-port of #420)#426
Open
TKIPisalegacycipher wants to merge 1 commit into
Open
feat(session): log Meraki X-Request-Id on 5xx responses (httpx forward-port of #420)#426TKIPisalegacycipher wants to merge 1 commit into
TKIPisalegacycipher wants to merge 1 commit into
Conversation
Forward-port of #420 to the httpx branch. The session refactor moved 5xx handling into SessionBase._handle_server_error (sync) and the inline async dispatch, so the warning now includes the X-Request-Id and a new _log_server_error_exhausted helper logs it at error level once retries are exhausted. Async unifies on APIError (no AsyncAPIError) and tests target the new meraki/session/ paths and _client.request mocks. When the header is absent, "none" is logged in its place. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Forward-port of #420 to the
httpxbranch.Logs the Meraki
X-Request-Idresponse header on 5xx responses so it can be handed to Meraki for server-side log lookup. Included in the per-retry warning and, once retries are exhausted, logged at error level. When the header is absent,noneis logged in its place.#420did not apply directly because thehttpxbranch refactored sessions intomeraki/session/{sync,async_,base}.py. Manual re-port:SessionBase._handle_server_errornow includes the request id in its warning; new_log_server_error_exhaustedhelper logs at error level whenretries == 0.APIError(noAsyncAPIError); tests target the newmeraki/session/paths and_client.requestmocks, plus a newsession_with_loggerconftest fixture.Tests: full sync + async session suites pass (163), ruff clean.
🤖 Generated with Claude Code