networking(hubble): deepen the event ring to 16383 flows and gate detection on loss (F10) #44

Merged
sirius merged 1 commit from netsec/hubble-event-loss into master 2026-11-27 05:17:26 +00:00
Owner

Finding

Audit F10: hubble_lost_events_total{source="hubble_ring_buffer"} climbing with nothing watching it — 72,529 cumulative on siriussec, 23,787 on linode at read time.

Root cause (measured, not assumed)

The counter was not reporting dropped flows. Ring.read() synthesises a HUBBLE_RING_BUFFER lost event when a backwards walk falls off the ring's read boundary, and getFlowRate() walks a full minute backwards on every hubble status, every 5 s agent health probe and every UI status request. With the 4095-event default and ~80 flows/s on siriussec the ring only holds ~51 s, so every probe hit the boundary — a constant +12/min (720/h) with no client and no loss (cilium#46584; upstream fixed it by counting on forward reads only).

Proof: 10 back-to-back hubble status calls moved the counter by +11 (10 + ~1 s of background), while the same 40 calls on linode (ring holds 200 s at 20 flows/s) moved it by 0.

Change

  • hubble.eventBufferCapacity: "16383" (was chart default 4095). Holds >= 60 s at the 24 h peak on every node: linode 196 flows/s -> 83 s, siriussec 101/s -> 161 s, rpi 38/s -> 431 s. Ring only accepts 2^n-1.
  • monitoring/controllers/home/hubble-loss-gate.yaml: recorders hubble:lost_events_increase_30m / hubble:flows_processed_increase_30m; alerts HubbleFlowWindowIncomplete (any loss in a 30 min window = window is not clean), HubbleFlowLossMaterial (>0.1% of processed flows), HubbleFlowSensorMissing (counters gone).

No L7 disable, no flow dropped from hubble-metrics, no retention change.

## Finding Audit F10: `hubble_lost_events_total{source="hubble_ring_buffer"}` climbing with nothing watching it — 72,529 cumulative on siriussec, 23,787 on linode at read time. ## Root cause (measured, not assumed) The counter was **not** reporting dropped flows. `Ring.read()` synthesises a `HUBBLE_RING_BUFFER` lost event when a *backwards* walk falls off the ring's read boundary, and `getFlowRate()` walks a full minute backwards on every `hubble status`, every 5 s agent health probe and every UI status request. With the 4095-event default and ~80 flows/s on siriussec the ring only holds ~51 s, so every probe hit the boundary — a constant +12/min (720/h) with no client and no loss (cilium#46584; upstream fixed it by counting on forward reads only). Proof: 10 back-to-back `hubble status` calls moved the counter by +11 (10 + ~1 s of background), while the same 40 calls on linode (ring holds 200 s at 20 flows/s) moved it by 0. ## Change - `hubble.eventBufferCapacity: "16383"` (was chart default 4095). Holds >= 60 s at the 24 h peak on every node: linode 196 flows/s -> 83 s, siriussec 101/s -> 161 s, rpi 38/s -> 431 s. Ring only accepts 2^n-1. - `monitoring/controllers/home/hubble-loss-gate.yaml`: recorders `hubble:lost_events_increase_30m` / `hubble:flows_processed_increase_30m`; alerts `HubbleFlowWindowIncomplete` (any loss in a 30 min window = window is not clean), `HubbleFlowLossMaterial` (>0.1% of processed flows), `HubbleFlowSensorMissing` (counters gone). No L7 disable, no `flow` dropped from `hubble-metrics`, no retention change.
hubble_lost_events_total{source="hubble_ring_buffer"} was climbing at a
constant 12/min on siriussec (72,529 cumulative) and ~4/min on linode with
nothing dropped: Ring.read() synthesises a HUBBLE_RING_BUFFER lost event when
a backwards walk reaches the ring's read boundary, and getFlowRate() walks a
full minute on every hubble status / 5 s health probe / UI request. At
siriussec's ~80 flows/s the 4095-event default only holds ~51 s, so every
probe hit the boundary (cilium#46584).

16383 holds >= 60 s at the 24 h peak on every node (linode 196 flows/s ->
83 s, siriussec 101/s -> 161 s, rpi 38/s -> 431 s), so the walk exits on the
timestamp check instead. Ring accepts 2^n-1 only.

Also wire the sensor gate: recorders hubble:lost_events_increase_30m /
hubble:flows_processed_increase_30m, alert HubbleFlowWindowIncomplete when a
30 min window has any loss (a lossy window may not be reported as clean),
HubbleFlowLossMaterial above 0.1% of processed flows, and
HubbleFlowSensorMissing when the counters disappear entirely.
sirius merged commit 43353e9aa0 into master 2026-11-27 05:17:26 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/homek8s!44
No description provided.