Skip to content

Adaptive transport

The link between a node and the control plane changes from minute to minute: the control plane asks a node to slow down, a leader fails over, a network path drops. The telemetry mux adapts to it one channel at a time. A healthy channel sends in batches, a busy logs channel streams, and a channel that just hit a failure goes to the spool for a window the control plane itself names. When the window closes the channel sends again and drains what it spooled. This page covers the three modes, the inputs to the choice, what opens and closes a failover window, and what a channel does in each mode.

For the decision order and its consequences for an operator, see Telemetry under degradation.

The three modes

Mode A channel in this mode Sends to
batch Sends its whole buffer as one request per flush The channel's batch endpoint
stream Sends logs as soon as they are flushed, for low latency /v1/dataplane/logs/batch with mode stream
failover Spools every record and sends nothing The outbox, delivered later

All three carry metadata. stream is a low-latency way to send log metadata; bodies are in your bucket in every mode. The profile's enabled_modes limits which modes the mux may use; with none enabled it uses batch.

A channel moving between modes

flowchart TB
  B(["batch"])
  S(["stream<br/>logs only"])
  F(["failover<br/>window open"])
  B -->|"logs at 100 records/s or more"| S
  S -->|"throughput falls"| B
  B -->|"send fails,<br/>or transport degraded"| F
  S -->|"send fails,<br/>or transport degraded"| F
  F -->|"window closes,<br/>transport active"| B

Each channel moves on its own. One failed events batch puts the events channel in failover while the status and logs channels keep sending; a degraded transport moves all three at once.

Inputs to the choice

Before every flush the mux chooses a mode for the channel, checking in order:

  1. A failover window is open for the channel. It chooses failover.
  2. The control-plane transport is degraded. It chooses failover. The transport is degraded when the control-plane client's mode is anything other than active. See The control-plane client.
  3. The channel is logs and carries 100 records a second or more. It chooses stream.
  4. Otherwise it chooses batch.

Failover windows

A failover window belongs to one channel and has an end time. The window's length comes from the failure that opened it:

Failure Window
HTTP 429, backpressure The control plane's Retry-After
HTTP 500, 502, 503 or 504, or an unreachable endpoint The control plane's Retry-After, or 1 second
Any other send failure The profile's retry_after_seconds, 2 by default
The status ack runtime reports its backlog degraded The profile's retry_after_seconds, for the status channel

Every window lasts at least one second. The control plane sets the pace of recovery: under load it answers with a longer Retry-After, and every channel that hits it waits that long before sending again.

While a window is open:

  • a new record goes straight to the outbox, bypassing the buffer;
  • a flush moves the whole buffer to the outbox;
  • the spool is not replayed.

The records that were in flight when the failure happened go to the outbox with the rest, so a failure loses nothing that was already produced.

After the window

The first flush after the window closes chooses batch or stream again. It sends the buffer, and when that succeeds it replays the channel's spool, up to max_batch_records a flush. A record whose own retry time has not come yet waits for a later flush. See Telemetry outbox and replay.

A status report the control plane refuses with 400, 404 or 409 opens no window: the report is marked acknowledged and the channel continues. See The telemetry batching mux.

The control plane's side

The control plane ingests each mode on its own surface and applies the same metadata-only rule to all of them. A failover delivery is identifiable as one, so a burst of spooled records after an outage reads as a recovering node. See Telemetry ingress and the mux.