sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

SentryNanotimeDate.nanoTimestamp does not provide nanosecond precision

Open markushi opened this issue 1 year ago • 1 comments

Description

Came up when working on frame delay: https://github.com/getsentry/sentry-java/blob/eedcf5ac53387d44c99f17cdc472ce0bb18dfb31/sentry-android-core/src/main/java/io/sentry/android/core/SpanFrameMetricsCollector.java#L298-L307

markushi avatar Feb 16 '24 11:02 markushi

@markushi this is a limitation on older Java SDKs and Android. If you have access to a better time source, you can provide a different SentryDate, e.g. SentryLongDate.

adinauer avatar Feb 19 '24 07:02 adinauer

Let's close this one for now, as https://developer.android.com/reference/java/lang/System#nanoTime() doesn't really provide a date instance, but rather an arbitrary origin time, which is not useful for e.g. spans per se.

markushi avatar Feb 28 '24 13:02 markushi

here's Alexes research https://github.com/getsentry/sentry-java/pull/2451#issuecomment-1396732246

romtsn avatar Feb 28 '24 13:02 romtsn