-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Wrong timestamps with mongodb plugin #175
Comments
You'll need to be more specific, things to include:
My first guess is that there is something wrong with your system's clock, I don't know how else to explain year 2111 |
I still don't understand the part about year 2111, but I have found a bug in setting the precision for the plugin gathering in certain situations. I will have a fix for that soon. |
Thanks for the quick response, but that didn't fix it unfortunately.
influx and telegraf compiled from master From the Line protocol docs: "Timestamps are assumed to be in nanoseconds unless a precision value is passed in the query string." Telegraf passes precision=s in params, but data from mongodb plugin has timestamps encoded in nanoseconds. Influxdb reads ns and multiplies by 1000000 so the timestamp overflows and the date becomes random. |
Okay, thanks for the info, I'll have to look into this next week. Can you please provide the debug telegraf output? and also the output of telegraf -version (if this doesn't return anything, include the commit from which you built.) |
Version v0.1.8-11-gd8482cc |
I've reproduced this, working on a fix now |
@Pomyk wow this turned into a rabbit-hole, and actually looks like it is a bug in influxfb. I have a PR up against the InfluxDB client code (influxdata/influxdb#4099) to fix this and will have a separate PR for telegraf sometime tomorrow. |
Currently adding with time is broken, because InfluxDB does not support using precision for timestamp truncation both with and without timestamps. This will be re-enabled once we fix InfluxDB to use the precision argument for truncation in all cases, and a "unit" argument in the line-protocol for adding points with non-nanosecond stamps Fixes #175
I have set the precision to seconds. Mongodb plugin writes timestamp in nanoseconds without respecting the precision.
Influxdb then reads this and gets year 2111 (that causes some strange behavior - a new WAL after every write).
The text was updated successfully, but these errors were encountered: