Skip to content

x-pack/filebeat/input/cel: allow CEL programs to know remaining budget#46210

Merged
efd6 merged 3 commits intoelastic:mainfrom
efd6:cel_remaining_executions
Aug 26, 2025
Merged

x-pack/filebeat/input/cel: allow CEL programs to know remaining budget#46210
efd6 merged 3 commits intoelastic:mainfrom
efd6:cel_remaining_executions

Conversation

@efd6
Copy link
Contributor

@efd6 efd6 commented Aug 24, 2025

Proposed commit message

x-pack/filebeat/input/cel: allow CEL programs to know remaining budget

For CEL-based integrations with a large number of pagination cycles, it
may be helpful for the program to be aware of the number of remaining
execution cycles, either to simply avoid degraded health status, or to
react differently and store cursor state for the next periodic
evaluation.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@efd6 efd6 self-assigned this Aug 24, 2025
@efd6 efd6 added enhancement Filebeat Filebeat backport-skip Skip notification from the automated backport with mergify Team:Security-Service Integrations Security Service Integrations Team labels Aug 24, 2025
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Aug 24, 2025
@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

For CEL-based integrations with a large number of pagination cycles, it
may be helpful for the program to be aware of the number of remaining
execution cycles, either to simply avoid degraded health status, or to
react differently and store cursor state for the next periodic
evaluation.
@efd6 efd6 force-pushed the cel_remaining_executions branch from 31f3bfb to 430fef0 Compare August 24, 2025 23:44
@github-actions
Copy link
Contributor

github-actions bot commented Aug 24, 2025

🔍 Preview links for changed docs

@efd6 efd6 marked this pull request as ready for review August 25, 2025 02:05
@efd6 efd6 requested review from a team as code owners August 25, 2025 02:05
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

Copy link
Contributor

@ShourieG ShourieG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

One query though:

In most scenarios the number of pages are not known beforehand and we iterate till size(response.body) >0 . I'm guessing this is only for scenarios where we have this number available in the response.

@efd6
Copy link
Contributor Author

efd6 commented Aug 25, 2025

This feature does not need to be used. But I discovered a use for it specifically in the context that you describe, where the number of pages is not known. An example of how you might use it in that context is to put the current working state into the cursor on the last available iteration and the resume work when the next periodic run starts. In the case where I'm using a hand-rolled version, I'm always storing the working state in the cursor and using the number of runs relative to the maximum as a way to avoid triggering a degraded health update.

Copy link
Contributor

@vishaangelova vishaangelova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from the docs perspective.

@efd6 efd6 enabled auto-merge (squash) August 26, 2025 06:36
@efd6 efd6 disabled auto-merge August 26, 2025 06:37
@efd6 efd6 enabled auto-merge (squash) August 26, 2025 06:37
@efd6 efd6 merged commit eb216e4 into elastic:main Aug 26, 2025
35 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-skip Skip notification from the automated backport with mergify enhancement Filebeat Filebeat Team:Security-Service Integrations Security Service Integrations Team

4 participants