-
Notifications
You must be signed in to change notification settings - Fork 600
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
Prefix filter optimizations #7309
Prefix filter optimizations #7309
Conversation
Signed-off-by: Calum Murray <[email protected]>
Signed-off-by: Calum Murray <[email protected]>
By the way, there is a behaviour change, however I think it is now more "correct". Before, if any of the attributes or values was an empty string, we would return that there was "NoFilter". However, I think that the more correct behaviour is to only return this "NoFilter" value if all of the attribute/value pairs have one or both be an empty string. WDYT? I can revert this behaviour change pretty easily if needed As an example, before if I had a filter that looked like:
Then in this case, we would return "NoFilter" on every event. However, I think it makes more sense to actually check the result of filtering |
Signed-off-by: Calum Murray <[email protected]>
logger := logging.FromContext(ctx) | ||
logger.Debugw("Performing a prefix match ", zap.Any("filters", filter.filters), zap.Any("event", event)) | ||
for k, v := range filter.filters { | ||
if k == "" || v == "" { |
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'm not sure we actually even need this check, as we validate that this is the case when we initialize the filter
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #7309 +/- ##
==========================================
- Coverage 77.66% 77.52% -0.15%
==========================================
Files 250 250
Lines 13436 13529 +93
==========================================
+ Hits 10435 10488 +53
- Misses 2478 2516 +38
- Partials 523 525 +2
☔ View full report in Codecov by Sentry. |
/retest-required |
Signed-off-by: Calum Murray <[email protected]>
/lgtm |
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Cali0707, pierDipi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #7305
Fixes #7308
Proposed Changes
Performance improvements after these changes:
Pre-review Checklist
Release Note
Docs