-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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(parsers.influx): Allow a user to set the timestamp precision #13419
Conversation
This is nice to have, but it does not fix the specific request in #13407 |
I noticed that your license is unclear. Can you provide more information about how your code can be used? |
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.
Just one small comment...
@eth5201314 I'm not exactly sure what you are asking... Is your question related to Telegraf as a whole? |
timeDuration := time.Duration(p.InfluxTimestampPrecsion) | ||
switch timeDuration { | ||
case 0: | ||
case time.Nanosecond, time.Microsecond, time.Millisecond, time.Second: | ||
p.SetTimePrecision(timeDuration) | ||
default: | ||
return fmt.Errorf("invalid time precision: %d", p.InfluxTimestampPrecsion) | ||
} | ||
|
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.
Why 2 different implementations? In the upstream parser, you added this check in the SetTimePrecision
func.
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.
I think the issue is that the original influx parser is code-generated and therefore we cannot simply add/modify the function. I'm fine with the second instance...
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.
But why not align them to look the same?
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
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.
Looks good to me. Thanks for the update @powersj!
Let's check after a new nightly build? I don't like that warning of file size change 😛 |
fixes: #13600