Switch collector transport to ringbuf#4
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (16)
📝 WalkthroughWalkthroughThe PR switches eBPF event delivery from perf events to a ring buffer with explicit drop accounting, improves daemon buffering and flush draining, expands diff event coverage, and documents generated artifacts, workflows, and updated transport semantics. ChangesRuntime and documentation updates
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Kernel as eBPF collector
participant Ringbuf as events ring buffer
participant Reader as Linux collector
participant Ingest as daemon ingest
participant Store as event store
Kernel->>Ringbuf: reserve and submit event
Kernel->>Kernel: count failed reservations
Reader->>Ringbuf: read event
Reader->>Reader: sample ringbuf_drops
Reader->>Ingest: emit event and drop delta
Ingest->>Store: flush persisted batch
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 987a0069d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if recordsSinceDropCheck >= 256 { | ||
| kernelDropped := readRingbufDrops(coll) | ||
| dropped = kernelDropped - lastKernelDropped | ||
| lastKernelDropped = kernelDropped | ||
| recordsSinceDropCheck = 0 |
There was a problem hiding this comment.
Flush pending ringbuf drops before shutdown
When overload happens near the end of a recording, fewer than 256 records may be read after failed bpf_ringbuf_reserve calls, so this periodic-only sampling leaves the latest ringbuf_drops delta in the kernel map. If ltm stop then closes the reader, the loop returns without converting that delta into any event's DroppedBefore, and SUM(dropped_before) underreports drops for that recording; sample the counter on shutdown or reduce this delayed attribution so final drops are not lost.
Useful? React with 👍 / 👎.
Closed in favor of #5, which uses the clearer
ringbuf-transport-batching-improvementsbranch name.Summary by CodeRabbit
New Features
Bug Fixes
Documentation