-
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] OTTL Converter Function that is able to create a new time.Time
type from a string.
#22007
Closed
Tracked by
#16067
Labels
Comments
7 tasks
TylerHelmuth
changed the title
There is an OTTL Factory Function, probably called
[pkg/ottl] There is an OTTL Factory Function, probably called May 16, 2023
Time
, that is able to create a new time.Time
type from a string. Something similar to https://pkg.go.dev/time#Parse can be used.Time
, that is able to create a new time.Time
type from a string. Something similar to https://pkg.go.dev/time#Parse can be used.
TylerHelmuth
changed the title
[pkg/ottl] There is an OTTL Factory Function, probably called
[pkg/ottl] OTTL Converter Function that is able to create a new May 16, 2023
Time
, that is able to create a new time.Time
type from a string. Something similar to https://pkg.go.dev/time#Parse can be used.time.Time
type from a string.
TylerHelmuth
added
enhancement
New feature or request
priority:p2
Medium
pkg/ottl
labels
May 16, 2023
I've started working on this issue if someone could add me as assignee I would appreciate it. |
TylerHelmuth
changed the title
[pkg/ottl] OTTL Converter Function that is able to create a new
[pkg/ottl] OTTL Converter Function that is able to create a new May 23, 2023
time.Time
type from a string.time.Time
type from a string or int.
TylerHelmuth
changed the title
[pkg/ottl] OTTL Converter Function that is able to create a new
[pkg/ottl] OTTL Converter Function that is able to create a new May 23, 2023
time.Time
type from a string or int.time.Time
type from a string.
https://github.com/lestrrat-go/strftime seems like the most popular package for strptime |
TylerHelmuth
added a commit
that referenced
this issue
Jun 22, 2023
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 golang `time.Time` Documentation: --------- Co-authored-by: Tyler Helmuth <[email protected]>
Caleb-Hurshman
pushed a commit
to observIQ/opentelemetry-collector-contrib
that referenced
this issue
Jul 6, 2023
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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create an OTTL Converter Function(s), probably called
Time
, that is able to create a newtime.Time
type from a string. Something similar to https://pkg.go.dev/time#Parse or https://github.com/knz/strtime or https://github.com/itchyny/timefmt-go can be used.The function should take 2 parameters, a string (represented as a
StringGetter
) that represents the time and a string (represented as aStringGetter
) that represents the format that the time should be parse. We should also support standard names for common formats in the second parameter, likeRFC3339
orISO 8601
that the function would know how to interpret.The text was updated successfully, but these errors were encountered: