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] Boolean expressions are update to be able to handle comparing time.Duration types #22713

Closed
Tracked by #16067
TylerHelmuth opened this issue May 23, 2023 · 0 comments · Fixed by #24272
Closed
Tracked by #16067
Labels
enhancement New feature or request pkg/ottl priority:p2 Medium

Comments

@TylerHelmuth
Copy link
Member

Component(s)

pkg/ottl

Describe the issue you're reporting

In order to facilitate contexts returning time fields as time.Time and their inclusion in mathematical expressions we need to be able to compare time.Duration values in boolean expressions. Although not supported by the grammar as literals, OTTL should allow working with these types.

When comparing time.Duration fields, the following rules should be followed:

  • Use Go comparison for int64.

If either A or B is not a duration, the comparison is false.

@TylerHelmuth TylerHelmuth added needs triage New item requiring triage enhancement New feature or request priority:p2 Medium pkg/ottl and removed needs triage New item requiring triage labels May 23, 2023
TylerHelmuth added a commit that referenced this issue Jul 17, 2023
Description: Allows time comparison by enabling boolean behavior for
time objects.

Link to tracking Issue: Closes
#22713

Testing: Unit tests

Documentation:

---------

Co-authored-by: Tyler Helmuth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg/ottl priority:p2 Medium
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant