-
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/telemetryquerylanguage] Add enums to TQL #12337
[pkg/telemetryquerylanguage] Add enums to TQL #12337
Conversation
/cc @kentquirk |
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 this is generally a good and useful change. I'd like to see the extra tests and to consider whether a more robust error scheme would be handy.
(And selfishly, I'd like to see this rebased after the merge of the and-or branch.)
@kentquirk I added more tests but have not modified the Enum API. Since Enums are being treated as fancy paths, the ParseEnum function doesn't know if the provided Ident is intended to be an Enum or not; it only know that it does or does not match something in the symbol table. If the provided path does not match anything from I'm open to ideas on how to separate Enum and Path in the grammar, but I don't love the idea of having to add anything to the symbol. Being able to interact with Enums like |
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 makes me happy now. I have no further comments.
@open-telemetry/collector-contrib-approvers please review. I'd love to get this PR in so I can complete #12221, all hopefully before Wednesday's release. There are some users who are interested in the new AND and OR where clause capabilities that are in the library but not in the processor. |
Description:
This PR adds Enums to the TQL. This is necessary before the transform processor and be updated to use the package.
The changes are copied from the current Enum implementation in the transformprocessor.This implementation improves upon the transform processor's version by separating Enums from Paths. This allows us to validate Enums and returns errors if there is no matching Symbol.
Link to tracking Issue:
#11751
Testing:
Updated unit tests
Documentation:
Updated README.