Got a setup where telegraf is collecting system metrics from docker containers. I’d like to display the latest stats of these containers which includes; CPU usage, memory usage, IO, Net, etc. I might be misinterpreting this plugin as I couldn’t find a proper definition of all its fields, but the question is still the same.
It seems to me that the ‘io_service_bytes_recursive_(read/write)’ field contains a total representation of the bytes read/written since boot. I would love to get the current/since last checked value.
Looking through the InfluxDB documentation I found a function called ‘difference()’. With this function I can get the difference between the last point and the second last point.
The problem arises when the timestamp returned by the ‘difference()’ function is the timestamp of the second last point. Considering all the other fields I’m gathering uses the timestamp of the last point it ends up showing two separate rows for every container, as the timestamps doesn’t match.
How can I go around this?
Can I make the ‘difference()’ function return the timestamp of the LAST value and NOT the second last value?
I know I can hide the time column which visually removes it but it still keeps the two separate rows from merging.
Maybe my query is wrong or could be improved?
All values are grouped by the container name, which also is shown in the table.
Thanks in advance.