You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(bridge): send Record timestamps at nanosecond resolution
The Bridge read only `msg.header.stamp.sec` and dropped `.nanosec`, then packed
it as the ingest protocol's plain integer time. Every Record's timestamp was
rounded to the second, so a Measurement polling faster than 1 Hz produced
Records that were indistinguishable in time — measured at 5 Hz: 8 Records,
3 distinct timestamps.
The wire format already supported the fix. Fluent Forward has an EventTime
extension (ext type 0x00, 4 bytes seconds + 4 nanoseconds), and the vendored
Vector 0.57.0 parses it with all nine digits intact — verified by feeding its
fluent source both frame shapes. Only the Bridge needed to change: Record now
carries seconds and nanoseconds, and the Forwarder packs EventTime.
Adds `epoch_nanos` as a new time_format, and makes it the default. `double`
cannot represent nanoseconds — a float64 has ~15-16 significant digits and
current epoch seconds spend 10 of them, so it tops out near microseconds. That
is IEEE 754, not an implementation limit. `double` and `iso8601` stay
available. Exactness also matters beyond precision: it is what makes the
timestamp usable as part of a Record identity, which #309 needs.
The schema follows: `date` becomes bigint in both init.sql files,
`to_timestamp(date)` becomes `to_timestamp(date / 1e9)` in the dashboard, and
params writing to those tables drop their explicit `time_format: "double"`.
Console-only demos keep theirs.
Regression cover: e2e_params.yaml's memory Measurement now polls at 5 Hz so
several Records land inside one second, and verify_zero_loss.py asserts a
nanosecond remainder exists, that some second holds 2+ Records (so it cannot
pass vacuously), and that no two Records share an instant. At 1 Hz a return to
whole-second stamps would not collide and would pass unnoticed.
Closes#308
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A5JwZEZrxEtYJdQUfsZRVo
Signed-off-by: David Bensoussan <d.bensoussan@proton.me>
0 commit comments