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: add time to int converters #25147

Merged
merged 35 commits into from
Aug 31, 2023

Conversation

fchikwekwe
Copy link
Contributor

Description: Allows conversion of time to nanoseconds, microseconds, milliseconds or seconds

Link to tracking Issue:
Related to #24686

Testing: Unit tests for each converter

Documentation:

pkg/ottl/expression.go Outdated Show resolved Hide resolved
pkg/ottl/expression.go Outdated Show resolved Hide resolved
pkg/ottl/expression.go Outdated Show resolved Hide resolved
pkg/ottl/expression.go Outdated Show resolved Hide resolved
pkg/ottl/expression.go Outdated Show resolved Hide resolved
pkg/ottl/expression_test.go Show resolved Hide resolved
pkg/ottl/expression_test.go 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.

For the failing tests, it may help for expected to be a date object that you can invoke the equivalent time.Duration function on for the .Equals comparison. I think hard-coding the numeric value is causing timezone problems.

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.

@fchikwekwe looks like the time structs fixed the unit tests. Once the linter is handled we'll be good to go

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.

@evan-bradley can you take a look at this PR as well.

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.

Looks good to me. Thanks for adding these.

.chloggen/feat_time-to-int.yaml Outdated Show resolved Hide resolved
pkg/ottl/expression.go Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/functions.go Outdated Show resolved Hide resolved
@evan-bradley evan-bradley added the ready to merge Code review completed; ready to merge by maintainers label Aug 31, 2023
@TylerHelmuth TylerHelmuth merged commit 3a6f547 into open-telemetry:main Aug 31, 2023
@github-actions github-actions bot added this to the next release milestone Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/ottl ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants