x-pack/filebeat/input/cel: add support for dynamic rate limit setting#46953
Merged
efd6 merged 4 commits intoelastic:mainfrom Oct 9, 2025
Merged
x-pack/filebeat/input/cel: add support for dynamic rate limit setting#46953efd6 merged 4 commits intoelastic:mainfrom
efd6 merged 4 commits intoelastic:mainfrom
Conversation
This adds support for directly setting the mito runtime's limiter's limit and burst before return from the CEL evaluation. This is important for cases where the CEL program is making multiple requests to a set of related endpoints that share a rate limit budget before the CEL program returns as it enables the program/runtime to conform to the API's limit policies without returning from the CEL program.
Contributor
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Contributor
🔍 Preview links for changed docs |
efd6
commented
Oct 6, 2025
Comment on lines
+1120
to
+1126
| lib.LimitWithApply(limitPolicies, func(m map[string]any, h http.Header) map[string]any { | ||
| waitUntil := handleRateLimit(log, m, h, limit) | ||
| if !waitUntil.IsZero() { | ||
| log.Debugw("rate limit waiting", "reset", waitUntil) | ||
| } | ||
| return m | ||
| }), |
Contributor
Author
There was a problem hiding this comment.
We could refine the logic here; adding a couple of magic fields (bikeshed: no_apply and no_wait) to the header to signal to the callback that application of the limit result should not be done or that the wait should not be slept (we currently don't sleep, but with that we would add in a conditional sleep). I'm not sure that this complication is worth it, but putting it out there for comment.
Contributor
Author
|
/test |
1 similar comment
Contributor
Author
|
/test |
Contributor
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
andrewkroh
approved these changes
Oct 8, 2025
colleenmcginnis
approved these changes
Oct 9, 2025
andrzej-stencel
pushed a commit
to andrzej-stencel/beats
that referenced
this pull request
Dec 1, 2025
…elastic#46953) This adds support for directly setting the mito runtime's limiter's limit and burst before return from the CEL evaluation. This is important for cases where the CEL program is making multiple requests to a set of related endpoints that share a rate limit budget before the CEL program returns as it enables the program/runtime to conform to the API's limit policies without returning from the CEL program.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Disruptive User Impact
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs