Skip to content

Add x-request-id capture and instance download --debug flag#3089

Draft
ronpal wants to merge 7 commits into
mainfrom
feat/instance-download-408-debug
Draft

Add x-request-id capture and instance download --debug flag#3089
ronpal wants to merge 7 commits into
mainfrom
feat/instance-download-408-debug

Conversation

@ronpal

@ronpal ronpal commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Capture the x-request-id response header into ErrorDetails/SuccessResponse and surface it on ToolkitAPIError (message + as_debug_dict), so 408 graph-query timeouts can be correlated with server-side/PG3 logs.
  • Add a --debug flag to cdf data download instances that, behind one flag:
    • requests server-side query profiling via QueryDebugParameters(profile=True) (query endpoint only), logging the returned plan, and
    • logs per-page diagnostics (endpoint, page size, truncated cursor, elapsed time, x-request-id), including on the 408 reduce-load path where the page size is halved.
  • Threaded a debug parameter through InstanceIOInstancesAPI.paginate/iterate/query/query_iterate down 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

  • mypy clean on changed modules
  • test_http_client.py: request-id captured on success and failure responses
  • test_instance_io.py: --debug injects {"debug": {"profile": true}} into the query body
  • Manual: run an instance download with --debug against a project and confirm profiling/log output

ronpal added 6 commits June 24, 2026 15:22
## 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.
@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.
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.

1 participant