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 ability to parse conditions #29315

Conversation

TylerHelmuth
Copy link
Member

@TylerHelmuth TylerHelmuth commented Nov 16, 2023

Description:
This PR adds a new public API to support parsing and using conditions.

This implementation opted to add ParseConditions directly to the existing Parser instead of creating a second Parser struct. Since any Parser needs the Context, Functions, PathExpressionParser, EnumParser, and telemetry settings the 2 structs would be incredibly similar.

See these structs implemented in components here: #29294

Link to tracking Issue:
Works towards #13545

Testing:
Added tests

Documentation:
Added godoc strings

@TylerHelmuth TylerHelmuth requested a review from a team November 16, 2023 23:04
@TylerHelmuth TylerHelmuth marked this pull request as draft November 17, 2023 03:25
@TylerHelmuth TylerHelmuth marked this pull request as ready for review November 17, 2023 04:27
pkg/ottl/parser.go Outdated Show resolved Hide resolved
@TylerHelmuth TylerHelmuth force-pushed the ottl-condition-parser-add-interfaces branch from 061e67a to 325f182 Compare November 17, 2023 16:48
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.

Nice!

pkg/ottl/parser_test.go Outdated Show resolved Hide resolved
@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 Nov 17, 2023
@TylerHelmuth TylerHelmuth merged commit 8e09b17 into open-telemetry:main Nov 17, 2023
90 of 91 checks passed
@TylerHelmuth TylerHelmuth deleted the ottl-condition-parser-add-interfaces branch November 17, 2023 23:05
@github-actions github-actions bot added this to the next release milestone Nov 17, 2023
RoryCrispin pushed a commit to ClickHouse/opentelemetry-collector-contrib that referenced this pull request Nov 24, 2023
**Description:** 
This PR adds a new public API to support parsing and using conditions. 

This implementation opted to add ParseConditions directly to the
existing Parser instead of creating a second Parser struct. Since any
Parser needs the Context, Functions, PathExpressionParser, EnumParser,
and telemetry settings the 2 structs would be incredibly similar.

See these structs implemented in components here:
open-telemetry#29294

**Link to tracking Issue:** <Issue number if applicable>
Works towards
open-telemetry#13545

**Testing:** <Describe what testing was performed and which tests were
added.>
Added tests

**Documentation:** <Describe the documentation added.>
Added godoc strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants