[google_workspace] - Add optional chunk_duration to Reports API data streams - #21049
Conversation
…eams The Reports API data streams advance their collection cursor only after a full time window has been paginated. When a long collection is interrupted, for example by an agent restart in an agentless deployment, the input resumes from the start of the window and re-fetches the entire backlog, which can stall progress on high-volume reports. Add an optional, hidden chunk_duration setting to all thirteen Reports API data streams. When set, each interval requests a window of at most chunk_duration starting from the last completed position and advances only after that window is collected, so an interrupted run re-fetches at most one chunk. The window is clamped to now minus lag_time so it never runs ahead of the lag margin. Leaving the setting empty, or giving a non-positive value, keeps the previous unchunked behaviour, so existing cursors are unaffected. Bump the package to 3.9.0, document the collection window settings in the README, and add system tests covering chunked collection for every stream and the disabled fallback for the token stream. Updates elastic/sdh-beats#7536
Elastic Docs Style Checker (Vale)Summary: 14 suggestions found 💡 Suggestions (14): Optional style improvements. Apply when helpful.
The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
|
✅ All changelog entries have the correct PR link. |
There was a problem hiding this comment.
🟡 Changes recommended
The README documents Chunk Duration as being available in the UI “Advanced options” while the actual chunk_duration vars are hidden (show_user: false), which is likely to mislead users.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR enhances the google_workspace integration’s Reports API data streams by adding an optional chunk_duration configuration that limits each polling interval to a bounded time window, reducing re-fetching after interruptions (e.g., restarts) and improving forward progress on high-volume backlogs.
Changes:
- Bump
google_workspacepackage version to3.9.0and add a changelog entry for the enhancement. - Add hidden
chunk_durationsupport to all 13 Reports API httpjson-based data streams, including cursor behavior updates for chunked windows. - Add system tests (and a shared mock endpoint) to validate chunked behavior across streams plus a disabled-chunk fallback test for
token; document collection window behavior in the README.
File summaries
| File | Description |
|---|---|
| packages/google_workspace/manifest.yml | Bumps the integration version to 3.9.0. |
| packages/google_workspace/changelog.yml | Adds a 3.9.0 enhancement entry for chunk_duration. |
| packages/google_workspace/docs/README.md | Documents collection window settings, including Chunk Duration. |
| packages/google_workspace/_dev/build/docs/README.md | Mirrors README doc updates for the build/docs source. |
| packages/google_workspace/_dev/deploy/docker/config.yml | Adds a shared mock endpoint for chunked-window system tests. |
| packages/google_workspace/data_stream/access_transparency/manifest.yml | Adds hidden chunk_duration var to the access_transparency stream. |
| packages/google_workspace/data_stream/access_transparency/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/access_transparency/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
| packages/google_workspace/data_stream/admin/manifest.yml | Adds hidden chunk_duration var to the admin stream. |
| packages/google_workspace/data_stream/admin/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/admin/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
| packages/google_workspace/data_stream/context_aware_access/manifest.yml | Adds hidden chunk_duration var to the context_aware_access stream. |
| packages/google_workspace/data_stream/context_aware_access/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/context_aware_access/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
| packages/google_workspace/data_stream/device/manifest.yml | Adds hidden chunk_duration var to the device stream. |
| packages/google_workspace/data_stream/device/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/device/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
| packages/google_workspace/data_stream/drive/manifest.yml | Adds hidden chunk_duration var to the drive stream. |
| packages/google_workspace/data_stream/drive/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/drive/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
| packages/google_workspace/data_stream/gcp/manifest.yml | Adds hidden chunk_duration var to the gcp stream. |
| packages/google_workspace/data_stream/gcp/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/gcp/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
| packages/google_workspace/data_stream/group_enterprise/manifest.yml | Adds hidden chunk_duration var to the group_enterprise stream. |
| packages/google_workspace/data_stream/group_enterprise/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/group_enterprise/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
| packages/google_workspace/data_stream/groups/manifest.yml | Adds hidden chunk_duration var to the groups stream. |
| packages/google_workspace/data_stream/groups/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/groups/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
| packages/google_workspace/data_stream/login/manifest.yml | Adds hidden chunk_duration var to the login stream. |
| packages/google_workspace/data_stream/login/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/login/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
| packages/google_workspace/data_stream/rules/manifest.yml | Adds hidden chunk_duration var to the rules stream. |
| packages/google_workspace/data_stream/rules/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/rules/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
| packages/google_workspace/data_stream/saml/manifest.yml | Adds hidden chunk_duration var to the saml stream. |
| packages/google_workspace/data_stream/saml/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/saml/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
| packages/google_workspace/data_stream/token/manifest.yml | Adds hidden chunk_duration var to the token stream. |
| packages/google_workspace/data_stream/token/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/token/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
| packages/google_workspace/data_stream/token/_dev/test/system/test-chunk-disabled-config.yml | Adds system test config verifying chunking is disabled for non-positive values. |
| packages/google_workspace/data_stream/user_accounts/manifest.yml | Adds hidden chunk_duration var to the user_accounts stream. |
| packages/google_workspace/data_stream/user_accounts/agent/stream/httpjson.yml.hbs | Implements chunked endTime and cursor advancement logic. |
| packages/google_workspace/data_stream/user_accounts/_dev/test/system/test-chunked-config.yml | Adds system test config for chunked collection. |
Review details
- Files reviewed: 45/45 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
🟢 No issues across the latest commits fe5533c.
🤖 AI-Generated Review | Vera Review Bot - v0.3.0 | 📚 Knowledge base: integration-skills
|
🚀 Benchmarks reportTo see the full report comment with |
💚 Build Succeeded
cc @ShourieG |
|
Tick the box to add this pull request to the merge queue (same as
|
|
Package google_workspace - 3.9.0 containing this change is available at https://epr.elastic.co/package/google_workspace/3.9.0/ |
Type of change
Proposed commit message
Checklist
changelog.ymlfile.Author's Checklist
How to test this PR locally
Related issues
Screenshots