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] Expose condition-only parsing #29294

Closed

Conversation

TylerHelmuth
Copy link
Member

Description:

Link to tracking Issue:

Testing:

Documentation:

@TylerHelmuth TylerHelmuth force-pushed the ottl-condition-parser branch 2 times, most recently from eb5b622 to 8758879 Compare November 16, 2023 00:40
@TylerHelmuth TylerHelmuth force-pushed the ottl-condition-parser branch 2 times, most recently from 21376d7 to 45e3ad0 Compare November 17, 2023 16:12
TylerHelmuth added a commit that referenced this pull request Nov 17, 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:** <Issue number if applicable>
Works towards
#13545

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

**Documentation:** <Describe the documentation added.>
Added godoc strings
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
TylerHelmuth added a commit that referenced this pull request Nov 30, 2023
**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:** <Issue number if applicable>

Related to
#13545

**Testing:**

Added new tests

**Documentation:** <Describe the documentation added.>
Added godoc comments

---------

Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
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.

1 participant