Add x-request-id capture and instance download --debug flag#3089
Add x-request-id capture and instance download --debug flag#3089ronpal wants to merge 7 commits into
Conversation
## Bump - [x] Patch - [ ] Skip ## Changelog ### Fixed - `cdf build` rejecting unquoted timestamp-like values in config.yaml variables
Capture the x-request-id response header into ErrorDetails/SuccessResponse and surface it via ToolkitAPIError to make 408 graph-query timeouts traceable against server-side logs. Add a --debug flag to `cdf data download instances` that requests server-side query profiling (QueryDebugParameters.profile) and logs per-page diagnostics (page size, cursor, elapsed, x-request-id), including on the 408 reduce-load path.
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
The CLI download path creates the client without a console, so debug diagnostics silently no-oped; fall back to a stderr console. Also append the x-request-id to the 408 timeout error message so it is traceable even without --debug.
Summary
x-request-idresponse header intoErrorDetails/SuccessResponseand surface it onToolkitAPIError(message +as_debug_dict), so 408 graph-query timeouts can be correlated with server-side/PG3 logs.--debugflag tocdf data download instancesthat, behind one flag:QueryDebugParameters(profile=True)(query endpoint only), logging the returned plan, andx-request-id), including on the 408 reduce-load path where the page size is halved.debugparameter throughInstanceIO→InstancesAPI.paginate/iterate/query/query_iteratedown to_make_query.Context
Investigating intermittent 408s while paging a view that maps multiple containers (multi-container joins in PG3 under IOPS contention). The reduce-load-on-408 behavior already exists on the query endpoint; this PR adds the observability needed to attribute and trace those timeouts.
Test plan
mypyclean on changed modulestest_http_client.py: request-id captured on success and failure responsestest_instance_io.py:--debuginjects{"debug": {"profile": true}}into the query body--debugagainst a project and confirm profiling/log output