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

[pkg/ottl] Add ConditionSequence struct #29339

Merged

Conversation

TylerHelmuth
Copy link
Member

Description:

Adds a new ConditionSequence struct to help handle processing a list of Conditions. The primary reason to use a ConditionSequence is to let the struct handle errors. Since that is its defining purpose, I opted to make ErrorMode a required argument in the "constructor" instead of an Option.

I also update internal/filterottl to use this struct instead of Statements. This is a non-breaking change.

If we like this pattern, I will do a breaking change to replace Statements with a similar StatementSequence struct in a future PR .

See these structs implemented in components here: #29294

Link to tracking Issue:

Related to #13545

Testing:

Added new tests

Documentation:
Added godoc comments

@TylerHelmuth
Copy link
Member Author

/cc @evan-bradley

Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the ping. Somehow I missed the notification for this.

pkg/ottl/parser.go Outdated Show resolved Hide resolved
pkg/ottl/parser.go Outdated Show resolved Hide resolved
pkg/ottl/parser.go Outdated Show resolved Hide resolved
pkg/ottl/parser.go Outdated Show resolved Hide resolved
internal/filter/filterottl/filter.go Show resolved Hide resolved
pkg/ottl/parser.go Show resolved Hide resolved
pkg/ottl/parser.go Show resolved Hide resolved
@TylerHelmuth TylerHelmuth force-pushed the ottl-condition-sequence branch from 777e4b4 to c06f7b9 Compare November 30, 2023 19:26
@TylerHelmuth TylerHelmuth merged commit 95a77c1 into open-telemetry:main Nov 30, 2023
83 checks passed
@TylerHelmuth TylerHelmuth deleted the ottl-condition-sequence branch November 30, 2023 23:48
@github-actions github-actions bot added this to the next release milestone Nov 30, 2023
evan-bradley pushed a commit that referenced this pull request Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants