You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
OTTL supports indexing maps and slices with dynamic values (#36644), allowing statements to access elements using any ottl.mathExprLiteral literal (Int, String, Converter, Path), which is great.
Maybe, It would be useful to extend the slice indexing support with math expressions, so we would be able to also access elements that needs some kind of computation. For example, to get the last slice's element, we can currently use:
Will add some more tests in the next days before marking it ready for review. If you have time, you can have a first look and also if you have ideas for statements you would like to have in E2E tests, it will be appreciated!
Component(s)
pkg/ottl
Is your feature request related to a problem? Please describe.
OTTL supports indexing maps and slices with dynamic values (#36644), allowing statements to access elements using any
ottl.mathExprLiteral
literal (Int
,String
,Converter
,Path
), which is great.Maybe, It would be useful to extend the slice indexing support with math expressions, so we would be able to also access elements that needs some kind of computation. For example, to get the last slice's element, we can currently use:
With math expression support, we could avoid using the cache and express the above statements as:
Describe the solution you'd like
--
Describe alternatives you've considered
Using
cache
, which also seems reasonable.Additional context
No response
The text was updated successfully, but these errors were encountered: