relay icon indicating copy to clipboard operation
relay copied to clipboard

Support nanos timestamps for `Timestamp` in Relay

Open AbhiPrasad opened this issue 8 months ago • 1 comments

See context here: https://linear.app/getsentry/issue/LOGS-104

The OTEL protocol requires nanosecond precision, which we support in EAP. Right now the SDKs send timestamps in microsecond precision (as defined in the Timestamp struct): https://github.com/getsentry/relay/blob/249971e1702991c64cf0f7f89773fb019ffb4a95/relay-event-schema/src/protocol/types.rs#L812

Timestamps from the SDK can be sent as a number (f64 unix epoch with microsecond precision) or as a RFC3339 strings. To avoid friction in SDKs (and avoid breaking changes), it is hard for the SDKs to stop sending f64.

We would like to support nanos timestamps if possible though. The easiest way to do this via the current protocol is just to allow for nanosecond precision RFC3339 strings. This prevents us from breaking SDKs who send f64 strings. Unfortunately the Timestamp struct does not easily allow us to support this, so we need to figure out to get that working first before adding support.

AbhiPrasad avatar May 09 '25 16:05 AbhiPrasad

Plan is to not work on this for now, until there is a strict requirement for the product as a change to such a fundamental type is quite tricky to get right.

Dav1dde avatar May 12 '25 08:05 Dav1dde