-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat(otel): add unified filtering API with O(1) command exclusion #3567
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
base: master
Are you sure you want to change the base?
Conversation
Add comprehensive filtering capabilities with performance-optimized command exclusion and unified filtering API. - WithExcludedCommands(): O(1) command exclusion using map lookup - WithProcessFilter(): Custom filtering for individual commands - WithProcessPipelineFilter(): Custom filtering for pipeline operations - WithDialFilterFunc(): Custom filtering for dial operations - Backward compatible with existing filtering APIs - Comprehensive test coverage and updated examples Fixes redis#3479
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
|
@zadil thank you for your contribution, will review it next week. |
|
pinging @Udhayarajan and @lucawol for comments here as they were active in the discussion. |
|
I've a few things to mark on. 0.
|
|
I would like to pull in one more person, since we're just adding toppings to the base baked by @Sovietaced |
|
Here are my 2 cents:
Although not the most performant approach, the way to address both would be to search not only the command name, but the body of the command itself. We could exclude both I haven't benchmarked this, so take my suggestion with a grain of salt:
Both filter should be applicable to both pipelines and normal commands. As for the dialer, I do not think we need a filter there in general, don't have a strong opinion if we should keep one, if you think it is going to be useful, sure, let's keep it. The map lookup may limit the flexibility of the filter, but at the same time gives the users a single way to filter a command, which should be less prone to errors from unexpected or wrong use of the filters. I would vote for the map lookup. even, would store both uppercase and lowercase cmd names in the map and skip the strings.ToUpper on each execution. |
Add comprehensive filtering capabilities with performance-optimized command exclusion and unified filtering API.
Fixes #3479