Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

Bounded, advisory worker-telemetry samples.

Telemetry deliberately lives beside the event-sourced run state rather than inside it. Updates take the ordinary per-run lock only to validate the node’s current attempt and terminal status atomically with replacing one sample; they never append an event or rewrite a manifest/node projection.

Structs§

SystemTelemetryClock
Production telemetry clock.
TelemetryAccepted
A successfully accepted telemetry update.
TelemetryUpdate
Strict v1 telemetry update request.
TelemetryView
Read view of one node’s advisory telemetry.

Enums§

TelemetryError
Validation or state error from a telemetry update.
TelemetrySampleStatus
Classification of a telemetry sample for the node’s current attempt.
TelemetryState
The four last-told worker activity states.

Constants§

TELEMETRY_FRESHNESS_SECS
How long a received sample remains current.
TELEMETRY_MAX_BYTES
Maximum raw request, normalized request, and stored-sample size.
TELEMETRY_PROTOCOL_VERSION
Worker telemetry protocol version supported by this build.
TELEMETRY_SCHEMA_VERSION
Wire and stored-sample schema version supported by this build.

Traits§

TelemetryClock
Injectable source of wall-clock time used by telemetry updates and reads.

Functions§

parse_telemetry_update
Parse a strict JSON request, rejecting unknown fields and every representation larger than 4 KiB.
read_all_telemetry
Read every projected node’s telemetry under one shared lock and one canonical-currency check. This is the bounded read-surface API for callers that need per-run rows or counts; it avoids recursively locking and rescanning the event log once per node.
read_all_telemetry_with_clock
read_all_telemetry with an injected read clock.
read_telemetry
Read and classify a sample using the production clock.
read_telemetry_with_clock
Read and classify a sample under the run’s shared lock using an injected clock. An old-attempt sample is intentionally rendered as absent.
update_telemetry
Validate and atomically replace the node’s one advisory sample using the production clock.
update_telemetry_with_clock
Validate and atomically replace the node’s one advisory sample using an injected clock.