Skip to content
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

[processor/transform] Add enum capabilities to grammar and contexts #11787

Merged
merged 10 commits into from
Jul 12, 2022

Conversation

TylerHelmuth
Copy link
Member

@TylerHelmuth TylerHelmuth commented Jun 28, 2022

Description:
This PR adds to the grammar the ability to handle enums. All Enums are int64. Enums are always used as native int64s in Conditions to ensure comparison between either an Enum or an int64 works as expected. If a function wants to use an Enum as a parameter, it must use the Enum type.

Contexts must supply a ParseEnum function that will attempt to parse a path as an enum. This allows contexts to define their own symbol tables.

All contexts' enum accessors have been updated to Get and Set enums as int64s.

Link to tracking Issue:
Fixes #10349

Testing:
Updated and added unit tests.

Documentation:
Updated README

@TylerHelmuth
Copy link
Member Author

/cc @anuraaga @tigrannajaryan

@TylerHelmuth
Copy link
Member Author

@open-telemetry/collector-contrib-approvers please review

@TylerHelmuth TylerHelmuth added ready to merge Code review completed; ready to merge by maintainers and removed ready to merge Code review completed; ready to merge by maintainers labels Jul 8, 2022
@TylerHelmuth TylerHelmuth added the ready to merge Code review completed; ready to merge by maintainers label Jul 11, 2022
@djaglowski djaglowski merged commit 4f30925 into open-telemetry:main Jul 12, 2022
@TylerHelmuth TylerHelmuth deleted the issue-10349 branch July 12, 2022 16:41
atoulme pushed a commit to atoulme/opentelemetry-collector-contrib that referenced this pull request Jul 16, 2022
…pen-telemetry#11787)

* Add enum capabilities to grammar and contexts

* Updated changelog and readme

* Update changelog entry
ag-ramachandran referenced this pull request in ag-ramachandran/opentelemetry-collector-contrib Sep 15, 2022
…11787)

* Add enum capabilities to grammar and contexts

* Updated changelog and readme

* Update changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[processor/transform] Improve processor's ability to handle enums
4 participants