Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore(shared): document ms-aligned start_time assumption in v2 observations cursor (LFE-10405) (#14926)

Niklas Semmlerba592abcf511
diff --git a/packages/shared/src/server/repositories/events.ts b/packages/shared/src/server/repositories/events.ts
index 39f11b2958..447f29cbcc 100644
--- a/packages/shared/src/server/repositories/events.ts
+++ b/packages/shared/src/server/repositories/events.ts
@@ -1457,6 +1457,12 @@ function applyObservationsCursorFilter(
cursor: PublicApiObservationsQuery["cursor"] | undefined,
queryBuilder: EventsQueryBuilder,
): EventsQueryBuilder {
+ // The cursor carries start_time at millisecond precision (JS Date round-trip),
+ // while the column is DateTime64(6). This is lossless only because every
+ // ingestion path writes ms-aligned start_time values (OTel nanos are floored
+ // to ms). If ingestion ever preserves sub-millisecond precision, this bound
+ // floors to the boundary row's millisecond and permanently skips rows at page
+ // boundaries — carry the raw ClickHouse string through the cursor instead (LFE-10405).
return queryBuilder.when(Boolean(cursor), (b) => {
const currentCursor = cursor;
if (!currentCursor) {