feat(collector): add rate limiting, drop counters and BPF backpressure#212
Open
ariktadas144 wants to merge 5 commits into
Open
feat(collector): add rate limiting, drop counters and BPF backpressure#212ariktadas144 wants to merge 5 commits into
ariktadas144 wants to merge 5 commits into
Conversation
Signed-off-by: ariktadas144 <ariktadas144@gmail.com>
Signed-off-by: ariktadas144 <ariktadas144@gmail.com>
|
🚀 First PR — welcome aboard! A few things to expect:
If you get stuck, reply here or jump to Discussions. We want this PR to land. |
…Performance and overhead section Signed-off-by: ariktadas144 <ariktadas144@gmail.com>
Signed-off-by: ariktadas144 <ariktadas144@gmail.com>
Author
|
@btwshivam All CI checks are now passing. Here's a summary of what was addressed: Lint fixes
Implementation summary
Happy to make any changes based on your feedback. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #46.
Summary
Implements Phase 9.2.4: bounded-overhead guarantees for kerno collectors under sustained high event rates.
Changes
1. Ringbuf drop observability
kerno_drop_countPERCPU_ARRAY map added tokerno.hKERNO_RECORD_DROP()called at everybpf_ringbuf_reserve()NULL-check site (8 sites across all 6 programs)DropMapperinterface +DropMap()on all 6 loaderspollDropMaps()goroutine instart.gopolls every 5s and incrementskerno_ringbuf_drops_total{program,cpu}with observed deltas2. Adaptive userspace sampling
internal/collector/aggregator/ratelimit.go: token-bucket + probabilistic sampler, safe for concurrent useAllow()wired into all 5 collectorrecord()pathskerno_collector_sampled_total{collector}increments on every rate-limited event3. BPF-side backpressure
KERNO_BACKPRESSURE()macro +cpu_backpressureper-CPU map inkerno.hbpf_ringbuf_reserve()sites across 6 programs4. Overhead control loop
/proc/self/statevery 5s, updateskerno_overhead_pctcollectors.sampling.target_overhead_pct(default 1.0%)5. Config
New metrics
kerno_ringbuf_drops_totalkerno_collector_sampled_totalkerno_overhead_pctTest results
All packages pass. 4 new TestRateLimiter_* tests including p99 accuracy.
Acceptance criteria
kerno_overhead_pctat/metrics