-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actions: add rateLimitScope #1962
Actions: add rateLimitScope #1962
Conversation
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
deaba76
to
78262f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after I guess updating this
const CustomResourceDefinitionSchemaVersion = "1.1.2" |
Really nice feature was planning to add it. Also we may want to add:
rateLimitBy="function (default) | policy_name"
@@ -1926,9 +1930,20 @@ rate_limit(__u64 ratelimit_interval, struct msg_generic_kprobe *e) | |||
ro_heap = map_lookup_elem(&ratelimit_ro_heap, &zero); | |||
|
|||
key->func_id = e->func_id; | |||
key->retprobe_id = e->retprobe_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this was never used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah was overkill.
@@ -1926,9 +1930,20 @@ rate_limit(__u64 ratelimit_interval, struct msg_generic_kprobe *e) | |||
ro_heap = map_lookup_elem(&ratelimit_ro_heap, &zero); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to memset zero those returned heap entries? (didn't check all the logic)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I overwrite the heap with a read only heap that is all zero, using a probe_read. It should cost about the same as a memset but doesn't cost me the instruction / complexity count.
Yeah I forgot the version! I'll do that now. |
Post actions can have a rateLimit argument that specifies how often identical events from the same hook and thread are generated. There is a use case to rate limit per process or generally. This commit introduces the rateLimitScope argument, to be used with rateLimit, to specify whether the rate limiting should be limited to the same thread, the same process, or globally, using values "thread" (default), "process", or "global". Signed-off-by: Kevin Sheldrake <[email protected]>
78262f0
to
abbc757
Compare
Post actions can have a rateLimit argument that specifies how often identical events from the same hook and thread are generated. There is a use case to rate limit per process or generally.
This commit introduces the rateLimitScope argument, to be used with rateLimit, to specify whether the rate limiting should be limited to the same thread, the same process, or globally, using values "thread" (default), "process", or "global".