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/stanza] Move core time parsing capabilities to coreinternal #23232

Merged

Conversation

TylerHelmuth
Copy link
Member

@TylerHelmuth TylerHelmuth commented Jun 8, 2023

Description:
Moves strptime and native Go format parsing from stanza's TimeParser struct to coreinternal so it can be used by OTTL.

To keep the PR as small as possible and to reduce risk only the strptime and go parsing capabilities are shared. Maybe more can be moved in the future, but these are currently the only pieces OTTL needs. The implementation in timeutils also tries to be as similar to the original implementation as possible.

The TimeParser API is unchanged so this should not be a breaking change.

Issue
Unblocks #22811, which needs this functionality to parse time the same way as stanza.

internal/coreinternal/timeutils/parser.go Outdated Show resolved Hide resolved
internal/coreinternal/timeutils/parser.go Outdated Show resolved Hide resolved
internal/coreinternal/timeutils/parser.go Outdated Show resolved Hide resolved
internal/coreinternal/timeutils/parser.go Outdated Show resolved Hide resolved
.chloggen/main.yaml Outdated Show resolved Hide resolved
@TylerHelmuth TylerHelmuth merged commit c67489a into open-telemetry:main Jun 9, 2023
89 checks passed
@TylerHelmuth TylerHelmuth deleted the move-timeparser-to-internal branch June 9, 2023 17:43
@github-actions github-actions bot added this to the next release milestone Jun 9, 2023
Caleb-Hurshman pushed a commit to observIQ/opentelemetry-collector-contrib that referenced this pull request Jul 6, 2023
…n-telemetry#23232)

* Move core time parsing capabilities to coreinternal

* Add clarifying comment

* Apply suggestions from code review

Co-authored-by: Curtis Robert <[email protected]>

* Replace StrptimeToGo with ParseStrptime

* remove changelog

---------

Co-authored-by: Faith Chikwekwe <[email protected]>
Co-authored-by: Curtis Robert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants