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

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.
This commit is contained in:
Lance Walters 2026-11-27 00:16:47 -05:00
commit 8f98509c8f
3 changed files with 119 additions and 0 deletions

View file

@ -59,6 +59,21 @@ prometheus:
trustCRDsExist: true
hubble:
# Ring depth, in flows. The chart default (4095) is only ~51 s of history on
# siriussec at its ~80 flows/s, and `getFlowRate()` — called by every
# `hubble status`, by the agent's own 5 s hubble health probe and by the UI —
# walks the ring backwards over a full minute. When the ring is shorter than
# that walk it reaches the read boundary, `Ring.read()` synthesises a
# HUBBLE_RING_BUFFER lost event and bumps `hubble_lost_events_total`
# (cilium#46584, fixed upstream only on forward reads). Result: a constant
# 12 increments/min on siriussec with nothing actually dropped.
# 16383 keeps >= 60 s at the 24 h peak on every node (linode 196 flows/s ->
# 83 s, siriussec 101 flows/s -> 161 s, rpi 38 flows/s -> 431 s), so the walk
# stops on the timestamp check before it can touch the boundary. Must be
# 2^n-1 (Cilium's ring only accepts 4095/8191/16383/32767/65535).
# Cost: see docs/hubble-event-loss.md — the ring retains *Event pointers, so
# the delta is bounded and measured, not assumed.
eventBufferCapacity: "16383"
# Flow/Forensics UI is reachable over WireGuard only, by bare IP on the
# dedicated `internal/hubble-ui` gateway: http://10.10.0.2:8084/ (port 8084,
# its own Gateway because Cilium merges hostname-less routes that share one).