-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[pkg/ottl] Support dynamic indexing #36719
base: main
Are you sure you want to change the base?
Conversation
1577fcb
to
87f2d33
Compare
d39f561
to
5e92cc6
Compare
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.
Thanks for taking this one on @odubajDT. I have a few questions on the implementation, but based on the tests passing, I think we're definitely on the right track.
5e92cc6
to
371c41a
Compare
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.
This is so exciting! We've wanted this feature for a long time and I'm glad to see that it fit so nicely into our Path/Key pattern.
Can you add e2e tests that use the new ottl-context scoped syntax? I want to ensure statements like
set(log.attributes[resource.attributes["flags"]], "something33")
work.
9617f82
to
8d87af0
Compare
Should be done, please have a look |
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 think we should add some extra type validations. Considering the ottl.Key
index can now be an expression (mathExprLiteral
), statements like set(severity_text, attributes[1])
and set(attributes["slice"][0.0], "bar")
would be considered valid and they would panic on the FetchValueFromExpression
function. I know they're invalid usages of the OTTL syntax, but I'd prefer to not panic if that happens. WDYT?
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
1461ded
to
8b59bb7
Compare
You got a point here. Added some additional checks and polished the error messages to be clearer where the problem lays. Also added some e2e tests. |
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Description
Link to tracking issue
Fixes #36644