Wrong timestamps with mongodb plugin
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).
You'll need to be more specific, things to include:
- operating system
- config file
- version number
- debug output
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. os - CentOS 7 relevant config part is:
[agent]
precision = "s"
[mongodb]
influx and telegraf compiled from master output from influxd: https://gist.github.com/Pomyk/d7c707ec9432dda8cdb3
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 Debug output: https://gist.github.com/Pomyk/a2929f84882b65b28622
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 (https://github.com/influxdb/influxdb/pull/4099) to fix this and will have a separate PR for telegraf sometime tomorrow.