Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport microsecond time precision #1305
Open
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When ordering logs from a single instance by time the logs can appear out of order. The cause I think is because of the Java 8 support in:
ApplicationInsights-Java/core/src/main/java/com/microsoft/applicationinsights/internal/util/LocalStringsUtils.java
Line 65 in 9705fc8
So only millisecond precision is supported in SimpleDateFormat, meaning we get many log entries with the same timestamp.
With Java 9 onwards Instant.now() would have the microsecond prevision we crave. It would go from a frequent issue, to a very rare issue when using microseconds I believe.
Given the widespread usage of JDKs >= 9, I would hope microsecond support could be added (even if enabled by a system property or something). The underlying application insights platform supports microsecond precision as far as I know.
In lieu of such microsecond precision I have been unable to find a simple "out of the box" solution for ordering logs generated by Java applications. Do you have a solution, or should we add a customDimension like running number to include in the order criteria ? Or do you have any other suggestions (maybe I miss a bigger picture here and we are doing something fundamentally wrong)
Thank you.