[salesforce] Bounded real-time batching for Login/Logout (requires Agent/Kibana 9.5) - #20932
[salesforce] Bounded real-time batching for Login/Logout (requires Agent/Kibana 9.5)#20932shmsr wants to merge 3 commits into
Conversation
✅ Elastic Docs Style Checker (Vale)No issues found on modified lines! 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. |
|
Tick the box to add this pull request to the merge queue (same as
|
80b23c2 to
ffa3083
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Salesforce integration to use Elastic Agent 9.5’s object.batch support to collect real-time LoginEvent/LogoutEvent data in bounded (start, end] windows, preventing a large initial backfill from issuing open-ended SOQL queries. It also raises the package compatibility floor to Kibana/Agent 9.5 and adds system-test and mock updates to exercise windowing, caps, empty windows, pagination, and failure handling.
Changes:
- Bump package to
1.10.0and require Kibana 9.5.0 + Elastic Agent 9.5.0. - Add real-time batching configuration (
object.batch) and new advanced tuning vars for window size and per-poll window caps. - Update docs, docker mock rules, and add system tests covering windowing/catch-up behaviors for login/logout real-time objects.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/salesforce/manifest.yml | Bumps version to 1.10.0 and raises Kibana/Agent minimums to 9.5.0 for object.batch. |
| packages/salesforce/docs/README.md | Documents 9.5 requirement and explains bounded real-time catch-up + scaling guidance. |
| packages/salesforce/_dev/build/docs/README.md | Mirrors rendered-doc source updates for batching + scaling guidance. |
| packages/salesforce/changelog.yml | Adds 1.10.0 changelog entry describing bounded real-time batching and new requirements. |
| packages/salesforce/data_stream/login/manifest.yml | Adds advanced vars for catch-up window + max windows; clarifies real-time polling semantics. |
| packages/salesforce/data_stream/login/agent/stream/salesforce.yml.hbs | Enables object.batch and switches object query to (batch_start_time, batch_end_time] windows. |
| packages/salesforce/data_stream/login/_dev/test/system/test-object-config.yml | Validates empty initial interval behavior for batched login object collection. |
| packages/salesforce/data_stream/login/_dev/test/system/test-object-catchup-config.yml | Tests draining a 1h lookback via 12 bounded windows (login object). |
| packages/salesforce/data_stream/login/_dev/test/system/test-object-catchup-capped-config.yml | Tests max-windows cap limiting per-poll catch-up (login object). |
| packages/salesforce/data_stream/login/_dev/test/system/test-object-window-size-config.yml | Tests window width following real_time_period (login object). |
| packages/salesforce/data_stream/login/_dev/test/system/test-object-independent-window-config.yml | Tests window override independent of poll interval (login object). |
| packages/salesforce/data_stream/login/_dev/test/system/test-object-empty-windows-config.yml | Tests that empty windows don’t halt catch-up (login object). |
| packages/salesforce/data_stream/login/_dev/test/system/test-object-sparse-windows-config.yml | Tests sparse windows don’t skip later events (login object). |
| packages/salesforce/data_stream/login/_dev/test/system/test-object-window-failure-config.yml | Tests window failure handling doesn’t skip successful window ingestion (login object). |
| packages/salesforce/data_stream/login/_dev/test/system/test-object-pagination-config.yml | Tests pagination within a bounded window (login object). |
| packages/salesforce/data_stream/login/_dev/test/system/test-object-pagination-failure-config.yml | Tests pagination failure handling within a bounded window (login object). |
| packages/salesforce/data_stream/login/_dev/test/system/test-object-multi-record-config.yml | Tests multi-record results within a bounded window (login object). |
| packages/salesforce/data_stream/logout/manifest.yml | Adds advanced vars for catch-up window + max windows; clarifies real-time polling semantics. |
| packages/salesforce/data_stream/logout/agent/stream/salesforce.yml.hbs | Enables object.batch and switches object query to (batch_start_time, batch_end_time] windows. |
| packages/salesforce/data_stream/logout/_dev/test/system/test-object-config.yml | Validates empty initial interval behavior for batched logout object collection. |
| packages/salesforce/data_stream/logout/_dev/test/system/test-object-catchup-config.yml | Tests draining a 1h lookback via 12 bounded windows (logout object). |
| packages/salesforce/data_stream/logout/_dev/test/system/test-object-catchup-capped-config.yml | Tests max-windows cap limiting per-poll catch-up (logout object). |
| packages/salesforce/data_stream/logout/_dev/test/system/test-object-window-size-config.yml | Tests window width following real_time_period (logout object). |
| packages/salesforce/data_stream/logout/_dev/test/system/test-object-empty-windows-config.yml | Tests that empty windows don’t halt catch-up (logout object). |
| packages/salesforce/data_stream/logout/_dev/test/system/test-object-window-failure-config.yml | Tests window failure handling doesn’t skip successful window ingestion (logout object). |
| packages/salesforce/_dev/deploy/docker/files/config.yml | Updates mock matching rules to accept batched LoginEvent/LogoutEvent SOQL window queries and sequences. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ffa3083 to
f88b73a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated no new comments.
Suppressed comments (2)
packages/salesforce/data_stream/login/agent/stream/salesforce.yml.hbs:41
query.defaultbecomes unbounded wheninitial_intervalis an empty string (the{{#if initial_interval}}block is skipped), which can result in a full-table SOQL query on first run. Since the intent here is to keep real-time object queries bounded, always include a lower bound, falling back toreal_time_periodwheninitial_intervalis empty.
default: SELECT FIELDS(STANDARD) FROM LoginEvent{{#if initial_interval}} WHERE EventDate > [[ (formatTime (now.Add (parseDuration "-{{initial_interval}}")) "2006-01-02T15:04:05.000Z0700") ]]{{/if}} ORDER BY EventDate DESC
packages/salesforce/data_stream/logout/agent/stream/salesforce.yml.hbs:41
query.defaultis unbounded wheninitial_intervalis an empty string (the conditional WHERE clause is omitted), which can lead to a full-table SOQL query. To keep real-time object collection bounded, always add a lower bound and fall back toreal_time_periodwheninitial_intervalis empty.
default: SELECT FIELDS(STANDARD) FROM LogoutEvent{{#if initial_interval}} WHERE EventDate > [[ (formatTime (now.Add (parseDuration "-{{initial_interval}}")) "2006-01-02T15:04:05.000Z0700") ]]{{/if}} ORDER BY EventDate DESC
f88b73a to
5bda949
Compare
Collect real-time Login and Logout events in fixed-width, bounded time windows (up to a max number of windows per poll) so a large backfill can no longer issue an unbounded SOQL query. Adds advanced Real-Time Catch-Up Window and Max Windows Per Poll settings. This uses object.batch on the Salesforce input, which requires Elastic Agent 9.5.0+, so the package now requires Kibana ^9.5.0 and Agent ^9.5.0. Stacked on top of the dedup/cursor fixes (1.9.0), which keep the lower compatibility range.
5bda949 to
ddd8083
Compare
Address review: when initial_interval is empty the {{#if}} block was
skipped, leaving query.default as an unbounded LoginEvent/LogoutEvent
scan. object.batch drives execution via query.value, but bound the
default too as defense-in-depth, falling back to real_time_period when
initial_interval is empty (mirroring batch.initial_interval).
|
✅ All changelog entries have the correct PR link. |
🚀 Benchmarks reportTo see the full report comment with |
💚 Build Succeeded
cc @shmsr |
Summary
Stacked on #20931 (base branch is
salesforce-dedup-cursor-fixes). GitHub will retarget this PR tomainautomatically once #20931 merges. Review only the batching diff here; the dedup/cursor fixes are in #20931.Adds bounded real-time collection for Login and Logout events so a large backfill can no longer issue an unbounded SOQL query:
object.batchconfiguration on the Salesforce input: fixed-width, half-open(start, end]catch-up windows, up tomax_windows_per_runper poll (default 12), window size defaulting to the real-time period.batch_start_time/batch_end_time(replaces the unboundedEventDate > first_event_time), orderedEventDate DESC.real_time_batch_window) and Max Real-Time Catch-Up Windows Per Poll (real_time_batch_max_windows).first_event_timewatermark, so existing installs resume without replay or gaps.Compatibility
object.batchrequires the Agent 9.5 Salesforce input, so this bumps the package floor tokibana: ^9.5.0+agent: ^9.5.0and releases as1.10.0. Sub-9.5 users continue to receive1.9.0(from #20931).Test plan
elastic-package check/lint/buildelastic-package test systemon a 9.5.0 stack: login 12/12 configs pass (incl. catchup, catchup-capped, window-size, independent-window, pagination, multi-record, sparse/empty windows, window/pagination failures), logout 7/7 pass.Related