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

feat: allow math expressions for time and duration #24453

Merged
merged 18 commits into from
Aug 1, 2023

Conversation

fchikwekwe
Copy link
Contributor

Description: Allows addition and subtraction between times and duration according to rules in #22009

Link to tracking Issue: Closes #22009

Testing: Unit testing for math operations

Documentation:

pkg/ottl/math.go Outdated Show resolved Hide resolved
pkg/ottl/math.go Outdated Show resolved Hide resolved
Copy link
Member

@TylerHelmuth TylerHelmuth left a comment

Choose a reason for hiding this comment

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

Lets add some tests to Test_evaluateMathExpression_error that check that we get errors if we try to use incorrect operands or incorrect types.

pkg/ottl/__debug_bin878371663 Outdated Show resolved Hide resolved
pkg/ottl/README.md Outdated Show resolved Hide resolved
pkg/ottl/math.go Outdated Show resolved Hide resolved
@fchikwekwe
Copy link
Contributor Author

@TylerHelmuth I've added some tests checking for various cases that should error. Let me know if you think I'm missing some cases.

@TylerHelmuth
Copy link
Member

@evan-bradley can you take a look at this one

@fchikwekwe
Copy link
Contributor Author

@TylerHelmuth do you think we're ready for merge yet?

@TylerHelmuth TylerHelmuth merged commit 905674a into open-telemetry:main Aug 1, 2023
@github-actions github-actions bot added this to the next release milestone Aug 1, 2023
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.

[pkg/ottl] Mathematical Expressions are able to handle time.Time and time.Duration types.
4 participants