-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support IsMatch function take pattern parameter from attributes #29011
Comments
Pinging code owners for pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@evan-bradley we've had a "standard" (not documented anywhere) that patterns in OTTL functions be static. So far this has provided a couple things:
If we update the pattern to allow dynamic value we'll loose those features even when using static strings (unless we get fancy, which maybe we can). I've always imagined we'd have a use case where the pattern needs to come from an attribute and it has now come up. I am ok allowing dynamic values, and if we do, I'd like to allow the pattern for all functions that need them. |
I'd also like to allow providing dynamic values in any function arguments that hold arbitrary strings. We definitely can find a way to keep our current functionality for static-value arguments, but I think we will need to add to the language to enable that. |
I wonder if we could add to the Getter interface some sort of IsStatic function that helps identify this Getter as returning a static value. |
Is there any update about this issue? |
If you can come up with a way to perform regex validation of static strings when the Please add some benchmarks to the function so we can compare the performance before and after. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hi @TylerHelmuth In proposed solution, I cached compiled patterns and wrote 2 benchmark test, 1 for same pattern with same target and the other one for changing pattern in each iteration and keeping target same. Results for proposed change:
Results for existing:
|
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@rtekdogan thank you for those benchmarks. I have not had time to work on this issue yet, but I think there is still a way for a Getter to announce that it is static and can be called before hot-path execution. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
Component(s)
No response
Is your feature request related to a problem? Please describe.
While collecting stdout logs, we would like to filter some containers based on pod annotations. With current filterprocessor and static string can be used as pattern, I request to IsMatch function to accept attributes as second parameter
Describe the solution you'd like
I suggested my solution with this PR
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: