-
Notifications
You must be signed in to change notification settings - Fork 107
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
Router optimise doesn't work with regex grouping. #184
Comments
Ok, it's a matter of removing the optimiser code, or making it deal with simple expressions only. (I guess its heuristics still work out well for a pattern like |
Yes. Although that's not to say that being aware of regex groups is not a bad thing, where in the above example, two groups are created with the same rules inside. However for simplicity, something like the following works well enough.
So a pattern like |
That works too. The code was originally setup to be very rule-of-thumb-like (WorkingForUs(tm)) and quite naive, but worked wonders back then. Perhaps skipping the complex part would be smartest thing to do here indeed. |
If we match strings inside (conditional) groups, we're possibly exluding matches. This could use some refinement, such that (foo) or (foo)? is no problem. This commit makes sure that (bar|foo) doesn't result in a group for foo.
Now that the number of rules has grown to a big enough size to trigger
router_optimise
to walk through all patterns. I've noticed that some aggregations have stopped, where a rule like so exists.What happens is that a
bar
group is created, and all rules that matchbar
go into it. But when a metricfoo
comes in, it never hits the rule.The text was updated successfully, but these errors were encountered: