Skip to content

Telemetry under degradation

Telemetry has three transport modes and switches between them on observed conditions. When the link is degraded it moves to the spooled one; when throughput is high it moves to the low-latency one. This page is how the mode is chosen and what happens to records that cannot be sent.

The three modes

Mode Used when Shape
stream Throughput is high on a channel that supports it Low-latency metadata transport
batch The ordinary case Records grouped and sent together
failover The transport is degraded, or failover is forced The process's local spool, delivered later

All three carry metadata only. None of them sends a raw tenant or workload body to the control plane; bodies go to your bucket and what crosses is a reference. See The tenant byte rule.

How the mode is chosen

flowchart TB
  A["Failover forced for this channel?"]
  B["failover"]
  C["Transport degraded?"]
  D["Logs channel above the throughput threshold?"]
  E["stream"]
  F["batch"]
  A -->|yes| B
  A -->|no| C
  C -->|yes| B
  C -->|no| D
  D -->|yes| E
  D -->|no| F

The inputs to the choice

flowchart LR
  subgraph IN["READ PER CHANNEL"]
    direction TB
    FW[("Forced failover windows")]
    TS[("Transport state")]
    TP["Logs throughput<br/>against threshold"]
  end
  MX{{"Telemetry mux"}}
  subgraph OUT["SURFACES"]
    direction TB
    SP[("Local spool<br/>then failover ingest")]
    ST["stream"]
    BA["batch"]
  end
  FW --> MX
  TS --> MX
  TP --> MX
  MX --> SP
  MX --> ST
  MX --> BA

The mux reads three things and nothing else. A channel that went to the spool was sent there by one of the first two inputs, and the tree above says which wins.

The checks are in that order, per channel. A forced failover window wins over everything, degradation wins over throughput, and throughput only promotes the logs channel to streaming once it passes its threshold.

Because the choice is per channel, one busy channel can stream while another batches, and a degraded transport moves all of them to failover together.

A record that cannot be sent is spooled. Two paths reach the spool:

Forced failover. While a channel is in a forced failover window, records go straight to the outbox instead of the in-memory buffer.

Buffer pressure. When a channel's buffer exceeds its limit, the oldest record is moved out to the outbox and the new one is kept in the buffer.

Spilling the oldest rather than rejecting the newest is what keeps the live buffer representing the present while the past waits in the spool.

Failover records carry an envelope identifier

Failover is the mode that requires an envelope identifier on every record. A record delivered later, possibly alongside a retry, is identifiable as the same record, so redelivery is a duplicate the control plane can recognise rather than a second event.

The spool is bounded and compacts

The outbox is segmented spool files with checkpoint state, bounded at 64 MiB, and the audit spool is bounded at 128 MiB in sealed, rotating segments. Delivered segments compact once acknowledgement converges. The spool carries reports through any control-plane outage, including a control-plane restart, for as long as xratud keeps running. Both spools belong to one process: a new process starts them empty, and the evidence the spool was carrying is still in each kernel's continuity store.

The budget is what bounds an outage. A node absorbs a disconnection for as long as its budget allows and no longer, which is a deployment decision made before the outage rather than during it.

What the control plane sees on recovery

A burst. The node delivers what it spooled, in order, with envelope identifiers, while producing new records at the same time. The control plane's view catches up to the present rather than resuming from it, which is why a recovered node briefly reports more than a healthy one.

See Recovering the control plane link.