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(processors.timestamp): Introduce timestamp processor #15094

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

powersj
Copy link
Contributor

@powersj powersj commented Apr 2, 2024

Summary

The following introduces a new timestamp processor. This allows a user to specify a field which contains a timestamp and convert it from one format to another. Traditionally telegraf assumes data has a single timestamp and uses that as the timestamp for the metric itself. However, if a user's data contains additional timestamps that they also wish to parse into a different format, there was no existing method for that.

The date processor exists today to take a metric's timestamp and add a tag or field with a subset of that timestamp. Trying to adapt that config to do both features made for a complex configuration that was not straightforward and error prone.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #10524

@powersj powersj self-assigned this Apr 2, 2024
@telegraf-tiger telegraf-tiger bot added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/processor labels Apr 2, 2024
@powersj powersj added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Apr 4, 2024
@powersj powersj assigned srebhan and DStrand1 and unassigned powersj Apr 4, 2024
@powersj powersj marked this pull request as ready for review April 4, 2024 21:54
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks @powersj! Just a few comments/questions from my side...

plugins/processors/timestamp/README.md Outdated Show resolved Hide resolved
plugins/processors/timestamp/README.md Outdated Show resolved Hide resolved
plugins/processors/timestamp/timestamp.go Outdated Show resolved Hide resolved
plugins/processors/timestamp/timestamp.go Outdated Show resolved Hide resolved
@powersj
Copy link
Contributor Author

powersj commented Apr 10, 2024

@srebhan if you could take another look I would apprecaite it. Not sure about the destination timezone handling and if I could re-use anything we already have?

@telegraf-tiger
Copy link
Contributor

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks @powersj!

@srebhan srebhan removed their assignment Apr 11, 2024
@DStrand1 DStrand1 merged commit 7acbf58 into influxdata:master Apr 11, 2024
26 checks passed
@github-actions github-actions bot added this to the v1.31.0 milestone Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/processor ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for parsing custom/multiple time fields in data parsers
3 participants