networking(hubble): deepen the event ring to 16383 flows and gate detection on loss (F10) #44
Loading…
Reference in a new issue
No description provided.
Delete branch "netsec/hubble-event-loss"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 aHUBBLE_RING_BUFFERlost event when a backwards walk falls off the ring's read boundary, andgetFlowRate()walks a full minute backwards on everyhubble 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 statuscalls 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: recordershubble:lost_events_increase_30m/hubble:flows_processed_increase_30m; alertsHubbleFlowWindowIncomplete(any loss in a 30 min window = window is not clean),HubbleFlowLossMaterial(>0.1% of processed flows),HubbleFlowSensorMissing(counters gone).No L7 disable, no
flowdropped fromhubble-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.