-
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
agent/accumulator: expose GetTime to give input plugins a chance to r… #4078
Conversation
…euse a timestamp for several Add* calls + use this on plugins/system to fix telegraf-sample/influxdb-point mismatch pb
This is a good fix but I think we should just create one time and use it in both calls, no need to add the GetTime function.
|
OK, and I missed the point that other plugins are alreay doing this. I thought that Telegraf was somewhat in control of the time notion (especially wrt. precision) and didn't dare to go to time.Now() directly. I'll push a simpler fix for plugins/inputs/system ASAP. |
(cherry picked from commit ec47cab)
Thanks! I include this in the next patch release (1.6.2) |
Thanks for your quick review and integration ! |
…euse a timestamp for several Add* calls + use this on plugins/system to fix telegraf-sample/influxdb-point mismatch pb
I stumbled upon curious single system measures spanning over two distinct timestamps, on a second boundary (this bug happening a few times in a day over 300 servers collecting system measures every 10s) :
I realized that the input/system plugins call three accumulator.Add* methods in a row, each fetching a distinct timestamp. This is cumbersome since its much more useful to gather all those fields as a single InfluxDB point and hence with the same timestamp.
In order to to this, I had to expose the accumulator.getTime() function. This should not break any plugin assumption and behaviour.