-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 time converter function #22811
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff! Please update the ottlfuncs/README with a new entry for this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please add a changelog entry by running chlog-new
in the root directory of the repo. Also update pkg/ottl/go.mod
with the new package dependency. Once you've updated the go.mod file run make gotidy
in the root directory of the repo.
Co-authored-by: Tyler Helmuth <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
While investigating these tests we found inconsistencies with timezones (it's always timezones). Comparing the time parsing to Investigating further we found that this was the magic that made opentelemetry-collector-contrib/pkg/stanza/operator/helper/time.go Lines 181 to 204 in d0fe5f3
and opentelemetry-collector-contrib/pkg/stanza/operator/helper/time.go Lines 113 to 130 in d0fe5f3
Handling the time in this way is necessary for a consistent time parsing strategy in the collector. Instead of duplicating these lines we should move the functionality out of stanza and into a shared place. See #23232 for implementation. |
Co-authored-by: Tyler Helmuth <[email protected]>
@evan-bradley can you review this one as well? I'm too close to it after doing the refactor in timeutils to unblock it. |
Not done |
Description: Added a converter function that takes a time string and a format string and converts to a golang time.Time object. Link to tracking Issue: open-telemetry#22007 Testing: Unit tests to check proper conversion from `stringGetter` to golang `time.Time` Documentation: --------- Co-authored-by: Tyler Helmuth <[email protected]>
Description: Added a converter function that takes a time string and a format string and converts to a golang time.Time object.
Link to tracking Issue: #22007
Testing: Unit tests to check proper conversion from
stringGetter
to golangtime.Time
Documentation: