TECHNOLOGY

Keep journal monotonic timestamps inside their boot identity

In this article
THE QUICK TAKE

Keep journal monotonic time with boot and machine identity; receipt time, source time and an opaque cursor do not define one universal event order.

An incident timeline sorts journal monotonic timestamps from several reboots into one global order. A later boot’s early entry appears before an earlier boot’s failure. Monotonic journal time has a boot-relative meaning. Preserve boot and machine identity with the timestamp before calculating durations or comparing observations from independent sources.

Identify receipt-time metadata

The exported realtime timestamp describes when the journal received the entry under its wall-clock domain. The monotonic timestamp also describes receipt, but uses the boot-relative monotonic clock. Preserve which quantity the report uses. A field containing a timestamp-looking application string can describe another event boundary and must not silently replace the journal’s documented acquisition metadata.

Keep monotonic time with its boot

The timestamp API returns the monotonic value with its boot identifier. The journal-field documentation likewise says the monotonic address should be combined with _BOOT_ID. Compare elapsed intervals only within the applicable clock domain. Reusing a host name after reboot does not preserve a continuous monotonic origin, and subtracting values across boots does not measure the incident’s real duration.

Preserve the source machine

An aggregate archive can contain records from several machines. Retain _MACHINE_ID and the relevant source context alongside boot identity rather than assuming all entries share the collector’s current clock. Similar boot-relative durations on two hosts do not establish simultaneous events. Any cross-host alignment requires independent timing evidence and an explicit uncertainty account.

Separate source and receipt time

The journal distinguishes receipt realtime from source realtime where available. Forwarding and collection can introduce a different boundary between the original event and the stored observation. Keep those fields separate instead of selecting whichever produces the smoothest timeline. A later receipt does not prove the source event happened later than an independently received event on another machine.

Keep cursors opaque

A journal cursor identifies an entry position and is documented as an opaque string. Do not sort its textual fragments as a universal clock or parse undocumented structure to invent event ordering. A useful incident artifact preserves the original metadata and states which local durations are supported, which wall-clock comparisons remain uncertain and which events cannot yet be ordered from the available evidence.

Primary references

systemd Journal Field Identity and Timestamp Semantics.

systemd Journal Realtime and Monotonic Timestamp API.

systemd Journal Export Format.

Related reading: Wrong time after restart: TLS errors and misleading log chronology; Monotonic clocks for inference API latency measurements.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles