Skip to content

feat(fleet): store what the eBPF rings lost, show it, and count it as loss (#95) - #99

Open
SoFrexs wants to merge 1 commit into
mainfrom
feat/95-ring-dropped
Open

SoFrexs wants to merge 1 commit into
mainfrom
feat/95-ring-dropped

Conversation

@SoFrexs

@SoFrexs SoFrexs commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Closes #95.

Why

agent#336 puts two cumulative counters on the health beacon: ring_dropped (events the Linux eBPF probes lost to a full ring buffer, over every ring) and exec_ring_dropped (the part lost from the exec ring: process starts the rules never saw). HealthBeacon is a non-strict z.object, so the server stripped both, and a host whose sensor lost about 1,000 file_open events every 10 s (agent#334) looked healthy in the console.

Change

  • lib/health-beacon.ts: both parsed as counter.default(0), like the etw_* counters. Absent from an older agent: zero.
  • prisma/schema.prisma: two BIGINT columns, ring_dropped and exec_ring_dropped, next to the other loss counters. Only the totals: the per-ring breakdown stays in the agent log.
  • lib/fleet-health.ts: ring_dropped joins LOSS_COUNTERS, so a rise stamps lossObservedAt and a fall (agent restart) does not. exec_ring_dropped is part of it, so it never rises alone and needs no entry. New ringLossSummary for the cell: none, 1000, or 1000 (3 process starts).
  • lib/fleet.ts / ops page: a ringLoss view and an "eBPF events lost" column.
  • Clean-up the new fields forced: storeBeacon and loadFleet crossed max-lines-per-function, so their mappings move into storedCounters and healthView. The lint count stays at the 113 ceiling.

Tests

  • Unit: parse with and without the fields, negative/fractional/string values refused, a rise stamps and a restart's fall does not, ringLossSummary, loadFleet mapping.
  • Integration (written, not run here: no Docker on this machine): stored and shown in the fleet view, a rise between two beacons degrades the host, zeros for an older agent, the ops page column.
  • Local (Windows): prisma generate, tsc --noEmit clean, npm run lint 0 errors / 113 warnings, vitest run tests/unit 1484 passed.

Overlaps #94 (counter saturation at BIGINT) only by both touching lib/health-beacon.ts in different spots.

🤖 Generated with Claude Code

… loss (#95)

agent#336 puts two cumulative counters on the health beacon: ring_dropped, the events the
Linux eBPF probes lost to a full ring buffer over every ring, and exec_ring_dropped, the part
of it lost from the exec ring (process starts the rules never saw). The non-strict beacon
parse stripped both, so a host whose sensor dropped about 1,000 file_open events every 10 s
(agent#334) looked healthy in the console.

Both are parsed as counter.default(0), stored as BIGINT columns, and shown on the ops page as
"eBPF events lost". ring_dropped joins LOSS_COUNTERS, so a rise stamps lossObservedAt and
degrades the host; exec_ring_dropped is part of it and needs no entry of its own.

storeBeacon and loadFleet crossed max-lines-per-function with the new fields, so their
beacon-to-column and row-to-view mappings move into storedCounters and healthView.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: sofrexs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

health beacon: store ring_dropped and exec_ring_dropped (agent#335) and count them as loss

1 participant