Closed twi010 closed 11 months ago
@twi010, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org>
to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.
Fixes #32 in which timestamps sent to log insight always get rounded down to the closest full second, losing the millisecond information. A timestamp like this "2021-08-13T14:41:21.898738172+00:00" gets converted to a Unix timestamp of 1628865681000. The correct value would be 1628865681898.
This patch keeps the milliseconds information by converting the time variable (a Fluent EventTime object) to a floating point variable before it is multiplied by 1000 so that the millisecond information is not lost. It then rounds it down to a full long integer to get a valid Unix timestamp.